/**
 * Travel Booking Manager - Public Styles
 * Responsive and modern design for pricing tables and booking forms
 */

/* ========================================
   Pricing Tables
======================================== */

.tbm-pricing-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.tbm-pricing-table {
    background: #ffffff;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tbm-pricing-table:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #0073aa;
}

.tbm-pricing-table.tbm-highlighted {
    border: 3px solid #0073aa;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
}

.tbm-pricing-table.tbm-highlighted::before {
    content: "Recommended";
    position: absolute;
    top: 15px;
    right: 15px;
    background: #0073aa;
    color: #ffffff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.tbm-pricing-image {
    margin: -30px -30px 20px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tbm-pricing-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.tbm-pricing-header {
    margin-bottom: 20px;
}

.tbm-pricing-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 10px;
    color: #333;
}

.tbm-pricing-destination {
    color: #666;
    font-size: 14px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tbm-pricing-price {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tbm-price-amount {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: #0073aa;
    line-height: 1;
}

.tbm-price-duration {
    display: block;
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.tbm-pricing-description {
    flex: 1;
    margin: 15px 0;
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

.tbm-pricing-features {
    flex: 1;
    margin: 20px 0;
}

.tbm-pricing-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tbm-pricing-features li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: #555;
    position: relative;
    padding-left: 25px;
}

.tbm-pricing-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #0073aa;
    font-weight: bold;
}

.tbm-pricing-features li:last-child {
    border-bottom: none;
}

.tbm-pricing-footer {
    margin-top: 20px;
}

.tbm-booking-button {
    display: inline-block;
    width: 100%;
    padding: 15px 30px;
    background: #0073aa;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.tbm-booking-button:hover {
    background: #005a87;
    transform: scale(1.02);
}

.tbm-highlighted .tbm-booking-button {
    background: #d54e21;
}

.tbm-highlighted .tbm-booking-button:hover {
    background: #b33d18;
}

/* ========================================
   Booking Form
======================================== */

.tbm-booking-form-wrapper {
    max-width: 800px;
    margin: 40px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.tbm-booking-form {
    /* Form container */
}

.tbm-form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.tbm-form-section:last-of-type {
    border-bottom: none;
}

.tbm-form-section h3 {
    margin: 0 0 20px;
    color: #333;
    font-size: 20px;
    font-weight: bold;
}

.tbm-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.tbm-form-field {
    display: flex;
    flex-direction: column;
}

.tbm-form-field.full-width {
    grid-column: 1 / -1;
}

.tbm-form-field label {
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.tbm-form-field .required {
    color: #d54e21;
}

.tbm-form-field input[type="text"],
.tbm-form-field input[type="email"],
.tbm-form-field input[type="tel"],
.tbm-form-field input[type="date"],
.tbm-form-field input[type="number"],
.tbm-form-field select,
.tbm-form-field textarea {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tbm-form-field input:focus,
.tbm-form-field select:focus,
.tbm-form-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.tbm-discount-wrapper {
    display: flex;
    gap: 10px;
}

.tbm-discount-wrapper input {
    flex: 1;
}

.tbm-discount-wrapper .button {
    padding: 12px 20px;
    background: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tbm-discount-wrapper .button:hover {
    background: #005a87;
}

.tbm-message {
    padding: 12px 15px;
    border-radius: 5px;
    margin-top: 10px;
    display: none;
}

.tbm-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

.tbm-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

.tbm-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    display: block;
}

.tbm-price-summary {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
}

.tbm-price-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 16px;
}

.tbm-price-row.tbm-total {
    border-top: 2px solid #ddd;
    margin-top: 10px;
    padding-top: 15px;
    font-weight: bold;
    font-size: 20px;
    color: #0073aa;
}

.tbm-form-actions {
    margin-top: 30px;
    text-align: center;
}

.tbm-submit-button {
    padding: 15px 50px;
    background: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tbm-submit-button:hover {
    background: #005a87;
    transform: scale(1.05);
}

.tbm-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Spinner for loading state */
.tbm-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tbmSpinnerRotate 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes tbmSpinnerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Checkmark for success state */
.tbm-checkmark {
    display: inline-block;
    color: #27ae60;
    font-size: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

/* ========================================
   Modal Styles
======================================== */

.tbm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.tbm-modal-container {
    position: relative;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 2;
    overflow-y: auto;
    animation: tbmModalSlideIn 0.3s ease-out;
}

@keyframes tbmModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tbm-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    transition: all 0.3s ease;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.tbm-modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

.tbm-modal-content {
    padding: 20px;
}

.tbm-modal-title {
    margin: 0 0 20px 0;
    font-size: 26px;
    font-weight: bold;
    color: #333;
    padding-right: 50px;
}

/* Prevent body scroll when modal is open */
body.tbm-modal-open {
    overflow: hidden;
}

/* Adjust form wrapper inside modal */
.tbm-modal .tbm-booking-form-wrapper {
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
}

/* ========================================
   Responsive Design
======================================== */

@media (max-width: 768px) {
    .tbm-pricing-tables-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tbm-booking-form-wrapper {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .tbm-form-row {
        grid-template-columns: 1fr;
    }
    
    .tbm-pricing-table.tbm-highlighted::before {
        font-size: 10px;
        padding: 3px 10px;
    }
    
    .tbm-discount-wrapper {
        flex-direction: column;
    }
    
    .tbm-submit-button {
        width: 100%;
    }
    
    .tbm-modal-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 5px;
    }
    
    .tbm-modal-content {
        padding: 15px;
    }
    
    .tbm-modal-title {
        font-size: 22px;
    }
    
    .tbm-modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .tbm-pricing-title {
        font-size: 20px;
    }
    
    .tbm-price-amount {
        font-size: 28px;
    }
    
    .tbm-booking-form-wrapper {
        padding: 15px;
    }
}


/* ==========================================================================
   Version 1.3.0 Styles - Tooltips, Price Breakdown, Customer Portal
   ========================================================================== */

/* Tooltip Styles */
/* ========================================
   Tooltip System - Pure CSS Approach
   ======================================== */

/* Tooltip Container with Relative Positioning */
.tbm-form-field label {
    position: relative;
    display: inline-block;
}

/* Tooltip Icon (?) */
.tbm-tooltip-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #0073aa;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    margin-left: 5px;
    vertical-align: middle;
    position: relative;
}

/* Tooltip Text Container (hidden by default) */
.tbm-tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px); /* Position to the right of icon */
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 280px;
    width: max-content;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    white-space: normal;
    word-wrap: break-word;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    font-weight: normal;
}

/* Tooltip Arrow (pointing to icon) */
.tbm-tooltip-icon::before {
    content: '';
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #333;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show Tooltip on Hover */
.tbm-tooltip-icon:hover::after,
.tbm-tooltip-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Position tooltip to the left if not enough space (for right-aligned fields) */
.tbm-form-field:last-child .tbm-tooltip-icon::after {
    left: auto;
    right: calc(100% + 10px);
}

.tbm-form-field:last-child .tbm-tooltip-icon::before {
    left: auto;
    right: calc(100% + 4px);
    border-right-color: transparent;
    border-left-color: #333;
}

/* Mobile: Position tooltip above on small screens */
@media (max-width: 768px) {
    .tbm-tooltip-icon::after {
        left: 50%;
        right: auto;
        top: auto;
        bottom: calc(100% + 10px);
        transform: translateX(-50%);
        max-width: 250px;
    }
    
    .tbm-tooltip-icon::before {
        left: 50%;
        right: auto;
        top: auto;
        bottom: calc(100% + 4px);
        transform: translateX(-50%);
        border-right-color: transparent;
        border-top-color: #333;
    }
    
    /* Override last-child positioning on mobile */
    .tbm-form-field:last-child .tbm-tooltip-icon::after {
        left: 50%;
        right: auto;
        bottom: calc(100% + 10px);
        transform: translateX(-50%);
    }
    
    .tbm-form-field:last-child .tbm-tooltip-icon::before {
        left: 50%;
        right: auto;
        bottom: calc(100% + 4px);
        transform: translateX(-50%);
        border-left-color: transparent;
        border-top-color: #333;
    }
}

/* Price Breakdown Styles */
.tbm-price-breakdown {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.tbm-price-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.tbm-price-row:last-child {
    border-bottom: none;
}

.tbm-price-row.tbm-total {
    font-size: 20px;
    font-weight: bold;
    color: #0073aa;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid #0073aa;
}

.tbm-price-row.tbm-discount-row {
    color: #27ae60;
}

.tbm-price-row.tbm-additional-price {
    color: #666;
    font-size: 14px;
}

/* Field Hints */
.tbm-field-hint {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0 0;
    font-style: italic;
}

.tbm-field-error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 1px #d63638 !important;
}

/* Checkbox Labels */
.tbm-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.tbm-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.tbm-checkbox-label a {
    color: #0073aa;
    text-decoration: none;
}

.tbm-checkbox-label a:hover {
    text-decoration: underline;
}

/* Section Description */
.tbm-section-description {
    font-size: 14px;
    color: #666;
    margin: 10px 0 20px 0;
}

/* Location Static Display (for modal) */
.tbm-location-static {
    padding: 12px 15px;
    background: #f0f8ff;
    border: 2px solid #0073aa;
    border-radius: 5px;
    font-size: 16px;
    color: #0073aa;
}

.tbm-location-static strong {
    font-weight: 600;
}

/* Customer Portal Styles */
.tbm-customer-portal {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.tbm-login-form-wrapper {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
}

.tbm-login-form-wrapper h3 {
    margin-top: 0;
    text-align: center;
    color: #333;
}

.tbm-login-form .tbm-form-field {
    margin-bottom: 20px;
}

.tbm-login-form .tbm-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.tbm-login-form .tbm-form-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.tbm-login-form .tbm-form-actions {
    text-align: center;
    margin-top: 20px;
}

.tbm-login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.tbm-login-footer a {
    color: #0073aa;
    text-decoration: none;
}

.tbm-login-footer a:hover {
    text-decoration: underline;
}

.tbm-login-footer .tbm-hint {
    color: #666;
    font-size: 13px;
    margin-top: 10px;
}

/* Dashboard Styles */
.tbm-dashboard-wrapper {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tbm-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.tbm-dashboard-header h3 {
    margin: 0;
    color: #0073aa;
    font-size: 24px;
}

.tbm-dashboard-content h4 {
    color: #333;
    margin-bottom: 20px;
}

.tbm-bookings-list {
    overflow-x: auto;
}

.tbm-bookings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

.tbm-bookings-table th,
.tbm-bookings-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.tbm-bookings-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.tbm-bookings-table tbody tr {
    transition: background-color 0.2s;
}

.tbm-bookings-table tbody tr:hover {
    background-color: #f9f9f9;
}

.tbm-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tbm-status-pending {
    background-color: #fef8e7;
    color: #856404;
}

.tbm-status-confirmed {
    background-color: #d4edda;
    color: #155724;
}

.tbm-status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.tbm-status-completed {
    background-color: #d1ecf1;
    color: #0c5460;
}

.tbm-button-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.tbm-button-secondary:hover {
    background-color: #5a6268;
}

/* Notice Styles */
.tbm-notice {
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid #0073aa;
    background: #f0f8ff;
    border-radius: 4px;
}

.tbm-notice-info {
    border-color: #0073aa;
    background: #f0f8ff;
    color: #004085;
}

.tbm-notice-error {
    border-color: #d63638;
    background: #fef0f0;
    color: #721c24;
}

.tbm-notice-warning {
    border-color: #f39c12;
    background: #fef8e7;
    color: #856404;
}

.tbm-notice p {
    margin: 0;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .tbm-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .tbm-bookings-table {
        font-size: 14px;
    }
    
    .tbm-bookings-table th,
    .tbm-bookings-table td {
        padding: 8px;
    }
    
    .tbm-tooltip-container {
        max-width: 220px;
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* ========================================
   v1.3.3 - New Form Field Styles
   ======================================== */

/* Accommodation Note */
.accommodation-note {
    background: #e7f3ff;
    border-left: 4px solid #2271b1;
    padding: 12px 15px;
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #1d2327;
    border-radius: 3px;
}

/* Alternative Billing Address Section */
.tbm-alt-billing-section {
    background: #f9f9f9;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tbm-alt-billing-section .tbm-form-row:last-child {
    margin-bottom: 0;
}

/* Checkbox Group for Special Needs */
.tbm-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tbm-checkbox-group .tbm-checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tbm-checkbox-group .tbm-checkbox-label:hover {
    background: #f5f5f5;
    border-color: #999;
}

.tbm-checkbox-group .tbm-checkbox-label input[type="checkbox"] {
    margin: 0 10px 0 0;
    cursor: pointer;
}

.tbm-checkbox-group .tbm-checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 500;
}

/* Field Label for Checkbox Groups */
.tbm-field-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

/* Enhanced Checkbox Labels */
label.tbm-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
}

label.tbm-checkbox-label input[type="checkbox"] {
    margin: 3px 8px 0 0;
    cursor: pointer;
}

@media screen and (max-width: 480px) {
    .tbm-login-form-wrapper,
    .tbm-dashboard-wrapper {
        padding: 20px;
    }
    
    .tbm-bookings-table {
        font-size: 12px;
    }
    
    .tbm-bookings-table th,
    .tbm-bookings-table td {
        padding: 6px;
    }
    
    /* Make checkbox group more compact on mobile */
    .tbm-checkbox-group {
        gap: 8px;
    }
    
    .tbm-checkbox-group .tbm-checkbox-label {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    /* Accommodation note responsive */
    .accommodation-note {
        font-size: 13px;
        padding: 10px 12px;
    }
}
