:root {
    /* Main background: Very light gray-blue */
    --bg: #f8fafc; 
    
    /* Card backgrounds: Pure white */
    --card: #ffffff; 
    
    /* Primary Aero Blue (#3f6ac9) */
    --mint: #3f6ac9; 
    
    /* Deep Navy for secondary buttons/accents */
    --violet: #1e293b; 
    
    /* Text: High contrast charcoal */
    --text-high: #0f172a; 
    
    /* Muted text: Slate gray */
    --text-low: #64748b; 
    
    /* Borders: Soft blue-tinted gray */
    --border: rgba(63, 106, 201, 0.1); 
}

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

body {
    background-color: var(--bg);
    color: var(--text-high);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* --- NAVIGATION --- */
.dashboard-nav {
    padding: 15px 5%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0; 
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.nav-search {
    flex: 1;
    max-width: 500px;
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search i { position: absolute; left: 15px; color: var(--text-low); }
.nav-search input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 10px 15px 10px 45px;
    border-radius: 12px;
    color: var(--text-high);
    transition: 0.3s;
}

.nav-search input:focus {
    outline: none;
    border-color: var(--mint);
    box-shadow: 0 0 0 4px rgba(63, 106, 201, 0.05);
}

.user-actions { display: flex; align-items: center; gap: 20px; }

.btn-list-sm {
    background: var(--mint);
    color: white;
    border: none; 
    padding: 10px 20px;
    border-radius: 10px; 
    font-weight: 700; 
    cursor: pointer;
    transition: 0.3s;
}

.btn-list-sm:hover {
    background: var(--violet);
    transform: translateY(-1px);
}

.avatar { 
    width: 35px; 
    height: 35px; 
    background: var(--violet); 
    color: white;
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 800; 
    font-size: 0.8rem; 
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-decoration: none;
    color: var(--text-high);
}

.logo span { color: var(--mint); }

/* --- BROWSE LAYOUT --- */
.browse-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 5%;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
}

/* Sidebar Filters */
.filter-sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 100px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.filter-group { margin-bottom: 30px; }
.filter-group h4 { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: var(--text-low); 
    margin-bottom: 15px; 
    font-weight: 700;
}

.filter-select, .filter-input {
    width: 100%; 
    background: #f1f5f9; 
    border: 1px solid var(--border);
    color: var(--text-high); 
    padding: 12px; 
    border-radius: 10px;
    font-family: inherit;
}

.btn-reset { 
    width: 100%; 
    background: transparent; 
    border: 1px solid var(--border); 
    color: var(--text-low); 
    padding: 12px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: 600;
    transition: 0.2s;
}

.btn-reset:hover {
    background: #f1f5f9;
    color: var(--text-high);
}

/* Listing Grid Header */
.listing-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.listing-header h2 { font-size: 1.25rem; color: var(--text-high); }
.listing-header h2 span { font-weight: 400; color: var(--text-low); font-size: 1rem; }
.sort-dropdown { font-size: 0.9rem; cursor: pointer; color: var(--text-low); font-weight: 600; }
.sort-dropdown b { color: var(--mint); }

.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

/* --- SWAP CARD --- */
.swap-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.swap-card:hover { 
    transform: translateY(-5px); 
    border-color: var(--mint); 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05); 
}

.swap-card.featured { border-color: var(--mint); border-width: 2px; position: relative; }
.swap-card.featured::after { 
    content: "HOT MATCH"; 
    position: absolute; 
    top: -12px; 
    right: 20px; 
    background: var(--mint); 
    color: white; 
    padding: 4px 12px; 
    border-radius: 6px; 
    font-size: 0.65rem; 
    font-weight: 800; 
}

.card-top { display: flex; justify-content: space-between; margin-bottom: 20px; }
.airline-tag { font-size: 0.75rem; font-weight: 700; color: var(--text-low); }
.seat-tag { 
    font-size: 0.7rem; 
    background: #f1f5f9; 
    color: var(--text-low);
    padding: 4px 10px; 
    border-radius: 6px; 
    font-weight: 600;
}

.card-main { text-align: center; margin-bottom: 20px; }
.route-display { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 10px; }
.point { font-size: 1.8rem; font-weight: 800; color: var(--violet); }
.line { flex: 1; height: 1px; background: #e2e8f0; position: relative; max-width: 60px; }
.line i { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 0.8rem; color: var(--mint); background: #fff; padding: 0 5px; }

.date-display { font-size: 0.85rem; color: var(--text-low); font-weight: 500; }

.card-swap-info {
    background: rgba(63, 106, 201, 0.05);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid rgba(63, 106, 201, 0.1);
}
.card-swap-info i { color: var(--mint); }
.card-swap-info span { color: var(--text-low); }
.card-swap-info b { color: var(--violet); }

.card-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn-view { 
    background: #f8fafc; 
    border: 1px solid var(--border); 
    color: var(--text-low); 
    padding: 12px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: 600;
    transition: 0.2s;
}
.btn-view:hover { background: #f1f5f9; color: var(--text-high); }

.btn-swap-now { 
    background: var(--violet); 
    border: none; 
    color: white; 
    padding: 12px; 
    border-radius: 10px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: 0.3s; 
}
.btn-swap-now:hover { 
    background: var(--mint); 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(63, 106, 201, 0.2);
}

/* --- RESPONSIVE --- */
@media (max-width: 1000px) {
    .browse-container { grid-template-columns: 1fr; }
    .filter-sidebar { display: none; }
}


/* Mobile Devices */
@media (max-width: 768px) {
    .dashboard-nav {
        padding: 10px 4%;
    }

    .nav-container {
        flex-wrap: wrap; /* Allow wrapping for search bar */
        gap: 10px;
    }

    .logo {
        order: 1;
        font-size: 1rem;
    }

    .user-actions {
        order: 2;
    }

    .nav-search {
        order: 3;
        max-width: 100%;
        width: 100%; /* Search bar takes full width on mobile */
    }

    .nav-search input {
        padding: 8px 15px 8px 40px;
    }

    .btn-list-sm span {
        display: none; /* Hide text, show only icon/shorter version if you add an icon */
    }
    
    /* Make the button just a "+" icon on very small screens if desired */
    .btn-list-sm::before {
        content: '+';
        display: inline-block;
    }

    .listing-grid {
        grid-template-columns: 1fr; /* Single column cards */
    }

    .browse-container {
        margin: 10px auto;
    }

    .filter-sidebar {
        flex-direction: column; /* Stack filters back on mobile */
        overflow-x: hidden;
    }
    
    .filter-group {
        width: 100%;
    }

    .listing-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}