/* Variables & Reset */
:root {
    --primary-color: #E11D48;
    /* Crimson / Rose for ValueTrip brand */
    --primary-light: #f43f5e;
    --primary-dark: #be123c;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Font families */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Poppins', sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-hover: 0 20px 25px -5px rgba(225, 29, 72, 0.1), 0 10px 10px -5px rgba(225, 29, 72, 0.04);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background-color: var(--card-bg);
    padding: 1.25rem 20px 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-logo {
    height: 55px;
    max-width: 280px;
    object-fit: contain;
}

/* Tabs */
.tabs-container {
    max-width: 1000px;
    margin: 1.25rem auto 0;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.5rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem 20px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

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

/* Controls (Search) */
.controls {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.1);
}

/* Loading & Error States */
.loading-state,
.error-state {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(225, 29, 72, 0.2);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.error-state i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Route Container */
.fare-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.route-group {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1.5px solid #d0d7de;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* ========================================================== */
/* DESKTOP VIEW STYLING                                      */
/* ========================================================== */
.desktop-route-wrapper {
    display: block;
}

.route-header {
    background-color: #F3F4F6;
    padding: 8px 14px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.route-header:hover {
    background-color: #e5e7eb;
}

.route-header.center-title {
    text-align: center;
}

.route-header span,
.route-src,
.route-dst {
    font-family: 'Saira', sans-serif;
    font-size: 20px;
    color: #1F2937;
    letter-spacing: 1.0px;
    font-weight: 700;
}

.route-src {
    flex: 1;
    text-align: right;
}

.route-dst {
    flex: 1;
    text-align: left;
}

.route-plane {
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fares-table {
    width: 100%;
    border-collapse: collapse;
}

.fares-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #E5E7EB;
    font-size: 16px;
}

.fares-table td:nth-child(1) { width: 25%; } /* Date */
.fares-table td:nth-child(2) { width: 30%; } /* Airline */
.fares-table td:nth-child(3) { width: 15%; } /* Transit */
.fares-table td:nth-child(4) { width: 15%; } /* Food */
.fares-table td:nth-child(5) { width: 15%; } /* Price */

.fares-table tr:last-child td {
    border-bottom: none;
}

.date-cell {
    text-align: right;
    padding-right: 20px !important;
    white-space: nowrap;
}

.date-num {
    font-family: 'Trebuchet MS', 'Lucida Grande', sans-serif;
    font-weight: bold;
    color: black;
}

.date-month {
    font-family: 'Trebuchet MS', 'Lucida Grande', sans-serif;
    font-weight: normal;
    color: #616161;
}

.airline-cell {
    text-align: left;
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    color: black;
}

.transit-cell,
.food-cell {
    text-align: left;
    font-family: 'Trebuchet MS', 'Lucida Grande', sans-serif;
    color: #616161;
}

.price-cell {
    text-align: right;
    font-family: 'Saira', sans-serif;
    font-weight: bold;
    color: black;
    padding-right: 25px !important;
}

.route-body {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.route-body.expanded {
    display: block;
}

.transition-icon {
    transition: transform 0.3s ease !important;
    color: #64748b;
    font-size: 1.1rem;
}

.expanded-header .transition-icon {
    transform: translateY(-50%) rotate(180deg) !important;
}

.center-title.expanded-header .transition-icon {
    transform: rotate(180deg) !important;
}

/* ========================================================== */
/* MOBILE VIEW STYLING (Exact match to reference design)       */
/* ========================================================== */
.mobile-route-wrapper {
    display: none;
}

.m-route-header {
    background-color: #E5ECEB;
    padding: 11px 40px 11px 22px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #D1DCDB;
    transition: background-color 0.2s ease;
}

.m-route-header:hover {
    background-color: #DDE6E5;
}

.m-header-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    text-align: left;
}

.m-city-name {
    font-family: 'Outfit', 'Poppins', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #243038;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.m-plane-icon {
    font-size: 15px;
    color: #4A5568;
    transform: rotate(0deg);
    margin: 0 2px;
}

.m-chevron-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #64748B;
    transition: transform 0.3s ease;
}

.expanded-header .m-chevron-icon {
    transform: translateY(-50%) rotate(180deg);
}

.m-route-body {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    padding: 10px;
    background-color: #F1F5F9;
}

.m-route-body.expanded {
    display: block;
}

.m-fares-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Mobile Fare Card Box */
.m-fare-card {
    background-color: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    display: flex;
    align-items: stretch;
    min-height: 52px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.m-card-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6px 4px;
}

/* Date Column */
.m-col-date {
    flex: 0 0 39%;
    max-width: 39%;
    border-right: 1px dashed #CBD5E1;
}

.m-date-top {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #000000;
    text-align: center;
    line-height: 1.2;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

.m-dashed-divider {
    width: 88%;
    border: none;
    border-bottom: 1px dashed #CBD5E1;
    margin: 3px auto;
}

.m-month-bottom {
    font-family: 'Poppins', sans-serif;
    font-size: 9.5px;
    font-weight: 700;
    color: #000000;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

/* Info Column (Airline + Transit + Meal) */
.m-col-info {
    flex: 0 0 37%;
    max-width: 37%;
    border-right: 1px dashed #CBD5E1;
}

.m-airline-top {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #000000;
    text-align: center;
    line-height: 1.2;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

.m-details-bottom {
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #000000;
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    line-height: 1.2;
}

.m-transit-text,
.m-meal-text {
    white-space: nowrap;
}

/* Price Column */
.m-col-price {
    flex: 0 0 24%;
    max-width: 24%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.m-price-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.m-price-val {
    font-family: 'Outfit', 'Saira', sans-serif;
    font-size: 17.5px;
    font-weight: 800;
    color: #000000;
    letter-spacing: -0.3px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

/* ========================================================== */
/* RESPONSIVE MEDIA QUERIES                                   */
/* ========================================================== */
@media (max-width: 768px) {
    /* Show Mobile View, Hide Desktop View */
    .desktop-route-wrapper {
        display: none !important;
    }

    .mobile-route-wrapper {
        display: block !important;
    }

    .header {
        padding: 0.85rem 14px 0.5rem;
    }

    .brand-logo {
        height: 44px;
        max-width: 220px;
    }

    .tabs-container {
        margin: 0.85rem auto 0;
        gap: 0.5rem;
    }

    .tab-btn {
        font-size: 1rem;
        padding: 0.4rem 1.2rem;
    }

    .main-content {
        padding: 1rem 12px;
    }

    .controls {
        margin-bottom: 1rem;
    }

    .search-bar input {
        font-size: 0.95rem;
        padding: 0.75rem 1rem 0.75rem 2.5rem;
    }

    .fare-container {
        gap: 14px;
    }
}

@media (min-width: 769px) {
    /* Show Desktop View, Hide Mobile View */
    .desktop-route-wrapper {
        display: block !important;
    }

    .mobile-route-wrapper {
        display: none !important;
    }
}

/* About Card */
.about-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.about-card h2 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-card h3 {
    font-family: var(--font-heading);
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}