:root {
    --primary-color: #0066cc; /* Agency Blue */
    --primary-dark: #004d99;
    --secondary-color: #f5f7fa;
    --text-color: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
    --font-family: 'Poppins', sans-serif;
}

/* Critical Utilities */
.hidden { display: none !important; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header */
.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

/* Currency Dropdown */
.currency-wrapper {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.currency-dropdown {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: var(--white);
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.currency-dropdown:hover {
    border-color: var(--primary-color);
}

.currency-dropdown:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #0066cc 0%, #00c6ff 100%);
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 100px; /* Header height + extra */
    padding-bottom: 50px;
    color: var(--white);
    text-align: center;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px; /* Wider for horizontal layout */
    padding: 0 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Search Container */
.search-container {
    background-color: var(--white);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    text-align: left;
    color: var(--text-color);
    position: relative;
    /* top: 30px; Remove overlap to keep it clean in center */
}

/* Service Tabs (Top Level) - Beautified */
.service-tabs-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: -1px; /* Overlap border */
    position: relative;
    z-index: 10;
}

.service-tabs {
    display: inline-flex;
    justify-content: center;
    gap: 1rem;
    padding: 0;
}

.service-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    color: var(--white);
    cursor: pointer;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    display: flex;
    align-items: center;
    backdrop-filter: blur(5px);
}

.service-btn i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.service-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.service-btn.active {
    background-color: var(--white);
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    transform: none;
    position: relative;
    z-index: 20;
}

/* Search Container Adjustment */
.search-container {
    background-color: var(--white);
    border-radius: 24px;
    /* Remove top corners radius if tabs are attached, or keep them for "floating" look. 
       Let's keep them but make tabs sit nicely. */
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: left;
    color: var(--text-color);
    position: relative;
    margin-top: 0; 
    z-index: 15;
}

/* Search Grid Layouts */
.search-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Default 4 columns */
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
}

/* Hotel Grid Specifics - Force 4 columns */
.search-container form .search-grid.hotel-search-grid {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr 1fr !important;
    gap: 1rem;
}

/* Flight Grid Specifics */
.search-container form .search-grid:not(.hotel-search-grid) {
    grid-template-columns: 2fr 50px 2fr 1.5fr 2fr; /* 5 cols for flights */
}
.search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.tab-btn {
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: var(--transition);
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1rem; /* Align with border-bottom of container */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: transparent;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab-btn.active::after {
    background-color: var(--primary-color);
}

/* Forms */
.search-form {
    display: none;
    animation: fadeIn 0.4s ease;
}

.search-form.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Old Grid Layout - Removed in favor of unified definitions above */
/* 
.search-grid {
    display: grid;
    grid-template-columns: 2fr 50px 2fr 1.5fr 2fr;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
}

.search-grid.hotel-search-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr !important;
}
*/

.round-trip-grid {
    grid-template-columns: 2fr 50px 2fr 1.2fr 1.2fr 2fr;
}

.form-group {
    position: relative;
    width: 100%;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .search-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .search-grid > .form-group:first-child,
    .search-grid > .form-group:nth-child(3) {
        grid-column: span 1;
    }
    
    .swap-btn-wrapper {
        display: none; /* Hide swap on smaller screens or adjust */
    }
    
    .hotel-search-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Make city full width on tablet for better layout */
    .hotel-search-grid > .form-group:first-child {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .search-container {
        padding: 1.5rem;
    }
    
    .search-grid, .hotel-search-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        width: 100%;
    }

    .service-tabs {
        width: 100%;
        justify-content: space-between;
    }
    
    .service-btn {
        flex: 1;
        justify-content: center;
        padding: 0.75rem;
    }
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 4px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--primary-color);
    font-size: 1.1rem;
    z-index: 2;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 16px 16px 16px 48px; /* Taller input */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-family);
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
    outline: none;
    background-color: #f8f9fa;
    position: relative; /* Ensure it sits correctly */
    z-index: 5; /* Above icon but below dropdowns */
}

.form-input:focus {
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.form-input::placeholder {
    color: #999;
    font-weight: 400;
}

/* Swap Button Wrapper */
.swap-btn-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 54px; /* Match input height approx */
    padding-top: 4px; /* Visual alignment */
}

.swap-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f4ff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.swap-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: rotate(180deg);
}

/* Search Button Container */
.btn-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.search-btn {
    background: linear-gradient(135deg, #0066cc 0%, #005bb5 100%);
    color: var(--white);
    border: none;
    padding: 16px 60px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Suggestions Dropdown */
.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.2s;
}

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

.suggestion-item:hover {
    background-color: #f0f4ff;
}

.code {
    font-weight: 700;
    color: var(--primary-color);
    background: #e6f0ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Travellers Dropdown Styling */
.travellers-dropdown-wrapper {
    position: relative;
}

.travellers-dropdown {
    display: none; /* Hidden by default - controlled by JS 'hidden' class or direct display */
    position: absolute;
    top: calc(100% + 12px);
    right: 0; /* Align to right if needed, or left */
    left: 0;
    width: 340px;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 1.5rem;
    z-index: 1000;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.2s ease-out;
}

.travellers-dropdown.hidden {
    display: none;
}

.travellers-dropdown:not(.hidden) {
    display: block;
}

.traveller-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.traveller-info {
    display: flex;
    flex-direction: column;
}

.traveller-label {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.95rem;
}

.traveller-sub {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 2px;
}

.traveller-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    padding-bottom: 3px;
    line-height: 1;
}

.qty-btn:hover {
    background-color: #f0f4ff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.qty-display {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--text-color);
}

.dropdown-divider {
    height: 1px;
    background-color: #f0f0f0;
    margin: 1rem 0 1.5rem;
}

.class-section {
    margin-bottom: 1rem;
}

.class-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-color);
}

.class-options {
    display: flex;
    background-color: #f5f7fa;
    padding: 4px;
    border-radius: 12px;
}

.class-option {
    flex: 1;
    position: relative;
    cursor: pointer;
    margin: 0; /* Reset default label margin */
}

.class-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.class-text {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition);
}

.class-option input:checked + .class-text {
    background-color: var(--white);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dropdown-footer {
    text-align: right;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    margin-top: 1rem;
}

.done-btn {
    color: var(--primary-color);
    background: none;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: var(--transition);
}

.done-btn:hover {
    background-color: #f0f4ff;
}

/* Multi City Grid */
.multicity-grid {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr;
    gap: 1rem;
    align-items: end;
    width: 100%;
}

.multi-city-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.remove-segment-btn {
    width: 40px;
    height: 54px; /* Match input height */
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: #ff4d4d;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.remove-segment-btn:hover {
    background-color: #ffe6e6;
    border-color: #ffcccc;
}

.add-city-btn {
    background: none;
    border: 2px dashed var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-city-btn:hover {
    background-color: #f0f4ff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .search-grid, .round-trip-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns */
        gap: 1.5rem;
    }
    
    .swap-btn-wrapper {
        display: none; /* Hide swap on tablet/mobile for simplicity or move it */
    }
}

@media (max-width: 768px) {
    .search-grid, .round-trip-grid, .multicity-grid {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .search-container {
        padding: 1.5rem;
    }

    .multi-city-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .remove-segment-btn {
        height: 40px;
        margin-top: 0.5rem;
    }
}
