/* =========================================
   GLOBAL STYLES & RESET
   ========================================= */

@import 'variables.css';

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-family-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 1rem;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-light);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--text-white);
    color: var(--text-white);
}

.btn-outline:hover {
    background: var(--text-white);
    color: var(--primary-color);
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.mb-4 {
    margin-bottom: var(--spacing-xl);
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: var(--spacing-sm);
}

.gap-2 {
    gap: var(--spacing-md);
}

/* Section Styling */
.section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-dark);
}

.section-title p {
    color: var(--text-medium);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================
   HEADER STYLES
   ========================================= */
.top-bar {
    background-color: var(--primary-dark);
    color: var(--text-white);
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.top-bar a {
    color: var(--text-white);
    margin-right: 1.5rem;
    opacity: 0.9;
    text-decoration: none;
}

.top-bar a:hover {
    opacity: 1;
}

.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    height: 100px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark);
    position: relative;
    text-decoration: none;
    font-family: var(--font-family-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

/* Mobile Responsive Header */
@media (max-width: 968px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links,
    .auth-buttons {
        display: none;
    }

    .navbar.mobile-open .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-white);
        padding: 1rem;
        box-shadow: var(--shadow-md);
        gap: 1rem;
    }

    .navbar.mobile-open .auth-buttons {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: calc(100% + 280px);
        left: 0;
        width: 100%;
        background: var(--bg-white);
        padding: 1rem;
        border-top: 1px solid var(--bg-light);
    }

    .top-bar {
        display: none;
    }
}

/* =========================================
   FOOTER STYLES
   ========================================= */
.footer {
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding: 4rem 0 1rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    height: 100px;
    margin-bottom: 1.5rem;
}

.footer-col h3 {
    color: var(--text-white);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    font-family: var(--font-family-heading);
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.contact-list li {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.footer .social-links {
    margin-top: 1.5rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    text-decoration: none;
}

.social-links a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.agent-link,
.admin-link {
    font-size: 0.8rem;
    opacity: 0.5;
    color: #b0b0b0;
    text-decoration: none;
}

.agent-link:hover,
.admin-link:hover {
    opacity: 1;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

/* =========================================
   FORM & AUTOCOMPLETE STYLES (Migrated from modern-search.css)
   ========================================= */

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Enhanced Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-items {
    padding: 0;
    margin: 0;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: #f8f9fa;
}

.autocomplete-item strong {
    display: block;
    color: #333;
    font-size: 14px;
}

.autocomplete-item small {
    display: block;
    color: #777;
    font-size: 12px;
}

/* Passenger Dropdown */
.passenger-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    display: none;
    min-width: 250px;
}

.passenger-dropdown.show {
    display: block;
}

.passenger-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
}

.passenger-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.passenger-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.passenger-btn:hover {
    background: var(--primary-color);
    color: white;
}

.passenger-btn:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
    background: white;
}

.passenger-count {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* =========================================
   RESPONSIVE GRID SYSTEM (Bootstrap-like Shim)
   ========================================= */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-md-3, .col-md-4, .col-md-6, .col-md-12, .col-12 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Mobile Stacking Overrides */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    /* Hero optimization */
    .hero-section {
        padding: 4rem 0 3rem; /* Reduced padding */
        min-height: auto;
    }
    
    .section-title h2 {
        font-size: 1.75rem; /* Smaller section titles */
    }

    .hero-content h1 {
        font-size: 2rem !important; /* Force smaller hero title */
        line-height: 1.2;
    }
    
    .hero-content p {
        font-size: 1rem !important;
    }
    
    /* Force columns to stack */
    .col-md-3, .col-md-4, .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Adjust form spacing */
    .form-group-booking {
        margin-bottom: 1rem;
    }
    
    /* Stack header elements */
    .top-bar .container {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .top-bar .social-links {
        justify-content: center;
    }
    
    /* Search Widget Mobile Fixes */
    .search-widget {
        padding: 1rem; /* Compact padding */
        margin: 0 -10px; /* Bleed slightly specific to small screens if container has padding */
        border-radius: 12px;
    }

    .search-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px; /* Scrollbar space if needed */
        justify-content: flex-start; /* Align left to invite scroll */
    }

    .search-tab {
        padding: 10px 15px;
        font-size: 0.9rem;
        flex-shrink: 0; /* Prevent squishing */
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Input heights for touch */
    .form-control, .btn-search {
        height: 50px; /* Comfortable touch target */
    }
}

/* =========================================
   MOBILE MENU ANIMATION
   ========================================= */
.mobile-menu-btn {
    z-index: 1001;
    position: relative;
}

.navbar.mobile-open .nav-links {
    display: flex !important;
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Fix for Passenger Dropdown Visibility */
#paxDropdownContent {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 250px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
}

#paxDropdownContent.show {
    display: block !important;
}

.passenger-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.passenger-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.passenger-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.passenger-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.passenger-done-btn {
    width: 100%;
    padding: 8px;
    background: var(--primary-color, #0056b3);
    color: white;
    border: none;
    border-radius: 4px;
    margin-top: 10px;
    cursor: pointer;
}
