/* Brand Color */
:root {
    --brand-color: #70be54;
    --brand-color-hover: #5da843;
    --brand-color-light: #e8f5e3;
}

/* Header Styles */
.ubuk-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.header-top-info {
    background: #f5f5f5;
    font-size: 11px;
    color: #666;
    height: 24.5px;
    display: flex;
    align-items: center;
}

.header-top-info .container-fluid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.company-info {
    font-size: 11px;
    line-height: 1.2;
}

.social-icons {
    display: flex;
    gap: 8px;
}

.social-icon {
    color: #666;
    text-decoration: none;
    font-size: 13px;
}

.ubuk-logo {
    display: flex;
    flex-direction: column;
    line-height: 1;
    text-decoration: none;
    justify-content: center;
}

.logo-image {
    width: 90px;
    height: auto;
}

.logo-ubuk {
    font-size: 24px;
    font-weight: bold;
    color: var(--brand-color);
    line-height: 1;
}

.logo-tagline {
    font-size: 9px;
    color: #666;
    font-style: italic;
    margin-top: 2px;
}

.navbar {
    padding: 0;
    height: 61px;
    display: flex;
    align-items: center;
}

.navbar .container-fluid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-collapse {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-nav {
    flex-grow: 0;
    margin: 0 0 0 5px;
}

.navbar-nav .nav-link {
    color: #333;
    font-weight: 700;
    padding: 8px 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-nav .nav-link .nav-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* Agency Management Button - same style as other nav items */
.navbar-nav .nav-agency {
    color: #333;
    font-weight: 700;
    text-decoration: none;
}

.navbar-nav .nav-agency:hover {
    color: #70be54;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.btn-account {
    background: white;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 12px;
    height: 32px;
}

.account-icon {
    font-size: 14px;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-icon-container {
    position: relative;
    width: 40px;
    height: 40px;
}

.phone-icon {
    width: 40px;
    height: 40px;
}

.phone-label {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #ef4223;
    color: white;
    padding: 2px 5px;
    border-radius: 2px;
    font-size: 9px;
    font-weight: bold;
    line-height: 1;
}

.phone-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1;
}

.phone-line-1 {
    display: block;
    white-space: nowrap;
}

.phone-title {
    font-size: 12px;
    color: #000;
    font-weight: bold;
    display: inline;
}

.header-phone-number {
    color: #ef4223 !important;
    font-weight: normal;
    font-size: 14px;
    text-decoration: none !important;
    display: inline;
    margin-left: 3px;
}

.header-phone-number:hover,
.header-phone-number:visited,
.header-phone-number:active,
.header-phone-number:focus {
    color: #ef4223 !important;
    text-decoration: none !important;
}

.work-hours {
    font-size: 11px;
    color: #000;
    font-weight: bold;
    display: block;
    margin-top: 2px;
}

/* Flight Search Styles */
.flight-search-container {
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 20px;
}

.search-header {
    margin-bottom: 15px;
}

.search-title {
    color: #000;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.search-subtitle {
    color: #666;
    font-size: 14px;
}

.search-form-container {
    background: var(--brand-color-light);
    padding: 20px;
    border-radius: 8px;
}


/* Flight Segment Styles */
.flight-segment {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.flight-segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.flight-segment-title {
    color: #000;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.btn-delete-flight {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    padding: 4px 8px;
}

.btn-delete-flight:hover {
    color: #d9534f;
}

.flight-inputs {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    align-items: stretch;
}
.from-to-group {
    display: flex;
    align-items: center;
    position: relative;
    gap: 10px;
}
.from-to-group .input-group {
    flex: 1;
    min-width: 0;
}
.btn-swap-airports {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.btn-swap-airports:hover {
    border-color: var(--brand-color);
    color: var(--brand-color);
}
.input-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.input-group label {
    display: none;
}

.input-group input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    height: 38px;
}

.input-group input::placeholder {
    color: #999;
    font-weight: 500;
}

.input-group input:focus {
    outline: none;
    border-color: var(--brand-color);
}

.airport-code {
    background: var(--brand-color);
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    display: inline-block;
    margin-top: 4px;
}

.swap-icon {
    display: none;
}

/* Add Flight Section */
.add-flight-section {
    text-align: center;
    margin: 10px 0;
}

.btn-add-flight {
    background: white;
    border: 2px dashed #ccc;
    padding: 8px 20px;
    height: 36px;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-add-flight:not(:disabled):hover {
    border-color: var(--brand-color);
    color: var(--brand-color);
}

.btn-add-flight:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.plus-icon {
    font-size: 18px;
}

/* Passenger Section */
.passenger-section {
    margin: 10px 0;
}

.passenger-input {
    background: white;
    padding: 0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.passenger-input label {
    display: none;
}

.passenger-input input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    height: 38px;
    cursor: pointer;
    background: white;
}

.passenger-input input::placeholder {
    color: #999;
    font-weight: 500;
}

/* Search Button */
.search-button-section {
    margin-top: 12px;
}

.btn-search-flights {
    background: var(--brand-color);
    color: white;
    border: none;
    padding: 11px 14px;
    height: 44px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    width: 100%;
}

.btn-search-flights:hover {
    background: var(--brand-color-hover);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 16px;
    max-width: 360px;
    width: 90%;
}

/* Passenger Modal */
.passenger-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.passenger-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.passenger-label strong {
    font-size: 15px;
    margin-bottom: 0;
}

.passenger-label small {
    font-size: 11px;
    color: #999;
}

.passenger-counter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-counter {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-counter:hover:not(:disabled) {
    border-color: var(--brand-color);
    color: var(--brand-color);
}

.btn-counter:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.counter-value {
    font-size: 16px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

.passenger-class-option {
    padding: 12px 0 8px 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-label {
    font-size: 14px;
}

.modal-actions {
    margin-top: 12px;
    text-align: center;
}

.btn-modal-ok {
    background: var(--brand-color);
    color: white;
    border: none;
    padding: 9px 36px;
    height: 38px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-modal-ok:hover {
    background: var(--brand-color-hover);
}

/* Date Picker Modal - Positioned dropdown style */
#datePickerModal {
    background: transparent; /* No overlay background */
    position: absolute; /* Changed from fixed */
    height: auto;
    display: none;
    z-index: 1000;
}

#datePickerModal.active {
    display: block; /* Changed from flex */
}

.date-picker-modal {
    min-width: 390px;
    padding: 7px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.date-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
}

.current-month {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.btn-nav {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--brand-color);
    padding: 4px 10px;
    min-width: 30px;
}

.btn-nav:hover {
    background: var(--brand-color-light);
    border-radius: 4px;
}

.calendar-container {
    width: 100%;
    overflow: hidden;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    padding: 6px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    border-radius: 3px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
    min-height: 45px;
    padding: 2px;
}

.calendar-day:hover:not(.disabled):not(.other-month) {
    background: var(--brand-color-light);
    border-color: var(--brand-color);
}

.calendar-day.selected {
    background: var(--brand-color);
    color: white;
    font-weight: bold;
}

.calendar-day.today {
    border: 2px solid var(--brand-color);
}

.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-day.other-month {
    color: #ccc;
}

.day-number {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.day-price {
    font-size: 11px;
    color: #666;
    line-height: 1.2;
    font-weight: 500;
    margin-top: 2px;
}

.calendar-day.selected .day-price {
    color: rgba(255, 255, 255, 0.9);
}

.calendar-day.disabled .day-price {
    color: #ccc;
}

/* Airport Selector Popup */
.airport-selector-popup {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 720px;
    max-width: 750px;
    max-height: 450px;
    overflow: hidden;
}

.airport-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
}

.airport-selector-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.btn-close-airport-selector {
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 3px;
}

.btn-close-airport-selector:hover {
    background: #e9ecef;
}

.airport-selector-tabs {
    display: flex;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid #e5e5e5;
    background: white;
    overflow-x: auto;
}

.airport-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    transition: all 0.2s;
}

.airport-tab:hover {
    color: var(--brand-color);
}

.airport-tab.active {
    color: var(--brand-color);
    border-bottom-color: var(--brand-color);
    font-weight: 600;
}

.airport-selector-content {
    padding: 12px;
    max-height: 350px;
    overflow-y: auto;
}

/* Column layout - sections and items flow vertically in columns (left to right) */
.airport-flow-container {
    column-count: 3;
    column-gap: 12px;
}

.airport-section-title {
    background: var(--brand-color);
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    margin: 6px 0 4px 0;
    border-radius: 3px;
    break-inside: avoid; /* Không bị cắt ngang section */
}

.airport-section-title:first-child {
    margin-top: 0;
}

.airport-item {
    padding: 6px 10px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.15s;
    text-align: left;
    border-radius: 3px;
    margin-bottom: 3px;
    break-inside: avoid; /* Không bị cắt ngang item */
}

.airport-item:hover {
    background: #f0f9f4;
    color: var(--brand-color);
}

.airport-selector-content::-webkit-scrollbar {
    width: 6px;
}

.airport-selector-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.airport-selector-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.airport-selector-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    max-width: 500px;
    min-width: 350px;
    max-height: 300px;
    overflow: hidden;
}

/* ============================================
   RESPONSIVE: Header + Search Form
   ============================================ */

/* Tablet / Mobile: navbar hamburger layout */
@media (max-width: 991.98px) {
    /* Ẩn bar thông tin công ty */
    .header-top-info {
        display: none;
    }

    /* Reset display: flex để Bootstrap collapse hoạt động đúng */
    .navbar-collapse {
        display: none;
        flex-grow: 0;
    }

    /* Khi collapse mở: absolute dropdown dưới navbar */
    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        z-index: 200;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
        border-top: 1px solid #eee;
        padding: 8px 0;
    }

    /* Nav links stack dọc */
    .navbar-collapse .navbar-nav {
        flex-direction: column;
        width: 100%;
        margin: 0;
    }

    .navbar-collapse .navbar-nav .nav-link {
        padding: 10px 15px;
        border-bottom: 1px solid #f5f5f5;
    }

    /* navbar-right: giữ account + lang, ẩn phone */
    .navbar-right {
        flex-direction: row;
        flex-wrap: wrap;
        margin-left: 0;
        padding: 8px 15px;
        border-top: 1px solid #f5f5f5;
        gap: 8px;
    }

    /* Ẩn phone contact — quá rộng trên mobile */
    .contact-info {
        display: none;
    }

    /* Navbar cần position relative để collapse absolute hoạt động */
    .navbar .container-fluid {
        position: relative;
    }
}

/* Mobile: search form */
@media (max-width: 767.98px) {
    /* Logo nhỏ hơn */
    .logo-image {
        width: 72px;
    }

    /* Search title nhỏ hơn */
    .search-title {
        font-size: 22px;
    }

    .flight-search-container {
        padding: 0 12px;
        margin: 10px auto;
    }

    /* Flight inputs: 3 cột → 1 cột */
    .flight-inputs {
        grid-template-columns: 1fr;
    }

    /* Airport selector popup: fixed, full width */
    .airport-selector-popup {
        position: fixed !important;
        min-width: auto !important;
        max-width: calc(100vw - 20px) !important;
        width: calc(100vw - 20px) !important;
        left: 10px !important;
        right: 10px !important;
        top: 70px !important;
        z-index: 10020 !important;
        max-height: 75vh;
        overflow-y: auto;
    }

    /* Airport flow: 3 cột → 1 cột */
    .airport-flow-container {
        column-count: 1;
    }

    /* Date picker: fixed centered */
    #datePickerModal {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 9999 !important;
        height: auto;
    }

    .date-picker-modal {
        min-width: auto;
        width: calc(100vw - 40px);
        max-width: 360px;
    }

    /* Autocomplete: fixed, full width */
    .autocomplete-dropdown {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        min-width: auto;
        max-width: calc(100vw - 20px);
        z-index: 10021 !important;
        top: auto;
    }
}

.autocomplete-list {
    max-height: 300px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f0f9f4;
}

.autocomplete-item-code {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.autocomplete-item-details {
    color: #666;
    font-size: 13px;
}

.autocomplete-list::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.autocomplete-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.autocomplete-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

