/* Pokedex Theme Styles */
:root {
    --dex-red: #dc0a2d;
    --dex-dark-red: #8B0000;
    --dex-blue: #28AAFD;
    --dex-yellow: #FFCB05;
    --dex-green: #4CAF50;
    --dex-bg: #f4f4f4;
    --dex-screen: #E0F7FA;
    --dex-border: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dex-red);
    color: var(--dex-border);
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    border-radius: 15px;
    position: relative;
    overflow-x: hidden;
}

/* Add Pokedex top light decorations */
body::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: var(--dex-blue);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(0,0,0,0.5), inset -2px -2px 5px rgba(0,0,0,0.3);
}

body::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 80px;
    width: 15px;
    height: 15px;
    background: var(--dex-yellow);
    border-radius: 50%;
    border: 2px solid var(--dex-border);
    box-shadow: 15px 0 0 var(--dex-yellow), 30px 0 0 var(--dex-green);
}

h1, h2, h3 {
    margin-top: 50px;
    color: white;
    text-shadow: 2px 2px 0px var(--dex-border);
    text-align: center;
}

/* Inner Screen Area */
.screen-area {
    background-color: var(--dex-screen);
    border: 5px solid var(--dex-border);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

/* Base styles for anchors in navs */
.nav-links a {
    text-decoration: none;
    font-weight: bold;
    border: none;
}

/* Desktop layout styles (Sidebar Navigation) */
@media screen and (min-width: 769px) {
    body {
        max-width: 1180px; /* Give room for sidebar + original 900px main content */
        padding-left: 280px; /* Offset to center main content with sidebar active */
        box-sizing: border-box;
        margin-left: max(20px, calc(50vw - 730px)); /* Shift left edge to perfectly center the 900px main content */
        margin-right: auto;
    }

    /* Adjust pokedex lights to sit over the new main content */
    body::before {
        left: 300px;
    }
    body::after {
        left: 360px;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: max(40px, calc(50vw - 710px)); /* Sync natively 20px inside the red box container */
        width: 240px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 15px;
        z-index: 1000;
        background: transparent;
        padding: 0;
        margin: 0;
        border: none;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 12px 20px;
        width: auto;
        font-size: 20px;
        color: var(--dex-border);
        background: white;
        border-radius: 30px; /* Pill shaped like Twitter */
        box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
        transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
        border: 2px solid var(--dex-border);
    }
    
    .nav-links a.active {
        color: var(--dex-red);
    }

    .nav-links a:hover {
        transform: translate(2px, 2px);
        box-shadow: 0 0 0 rgba(0,0,0,0.2);
        background: #f0f0f0;
    }

    .nav-links a svg {
        flex-shrink: 0;
    }
}

/* Cards (Bussydex & Details) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.card {
    background: #ebebeb;
    padding: 15px;
    border-radius: 8px;
    border: 3px solid #b0b0b0;
    position: relative;
    text-align: center;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.card.active {
    background: #e8f5e9;
    border-color: var(--dex-green);
    box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}

.card.archived {
    background: #d0d0d0;
    border-color: #888888;
}

.card.archived.active {
    background: #b2d4b6;
    border-color: #6a9c70;
}

.card:hover {
    transform: scale(1.02);
}

.badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #81c784;
    color: var(--dex-border);
    border: 2px solid var(--dex-border);
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

.bus-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #888;
}

.active .bus-name {
    color: #333;
}

.bus-details {
    font-size: 13px;
    color: #999;
    line-height: 1.4;
}

.active .bus-details {
    color: #555;
}

.filter-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--dex-border);
}

select, input {
    padding: 8px 16px;
    border: 2px solid var(--dex-border);
    background: white;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

button, .button, .filter-btn {
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 0;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-color: var(--dex-blue);
    color: white;
}

select {
    cursor: pointer;
}

input {
    cursor: text;
}

button:hover, .button:hover, .filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

button:active, .button:active, .filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bus-form {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 3px solid var(--dex-border);
}

.bus-form h3 {
    margin-top: 0;
    color: var(--dex-border);
    text-shadow: none;
}

/* Leaderboard Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border: 3px solid var(--dex-border);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background-color: var(--dex-blue);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 0 var(--dex-border);
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

a {
    color: var(--dex-blue);
    font-weight: bold;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Result and history boxes */
.result-card, .bus-header, .overview {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 3px solid var(--dex-border);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.leaderboard-table tr td { color: #333; }
.leaderboard-table tr.podium-1 { background-color: #fffac9 !important; }
.leaderboard-table tr.podium-2 { background-color: #e0e0e0 !important; }
.leaderboard-table tr.podium-3 { background-color: #ffe6cc !important; }

/* Timeline profile specific */
.timeline {
    text-align: left;
    margin-top: 20px;
}
.timeline-item {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}
.timeline-item span.date { color: #888; font-size: 0.9em; float: right; }
.timeline-item h4 { margin: 0 0 5px 0; color: var(--dex-border); text-shadow: none; font-size: 1.1em; }


/* Desktop defaults for burger menu */
.mobile-menu-header {
    display: none;
    margin-top: 60px;
    margin-bottom: 5px;
    text-align: right;
}
.burger-btn {
    background-color: var(--dex-blue);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}
.burger-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0;
}

/* Mobile Optimization */
@media screen and (max-width: 600px) {
    body {
        margin: 5px;
        padding: 5px;
        border-radius: 8px;
        border: none;
    }
    
    /* Scale down top Pokedex decorations */
    body::before {
        top: 10px; left: 10px; width: 25px; height: 25px;
    }
    body::after {
        top: 15px; left: 45px; width: 10px; height: 10px;
        box-shadow: 15px 0 0 var(--dex-yellow), 30px 0 0 var(--dex-green);
    }
    
    /* Adjust headings */
    h1 { font-size: 1.6em; margin-top: 40px; }
    h2 { font-size: 1.4em; }
    h3 { font-size: 1.2em; }
    
    /* Mobile Burger Menu logic */
    .mobile-menu-header {
        display: block;
        margin-top: 40px;
    }
    .nav-links {
        display: none;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 0;
        background: transparent;
        padding: 0;
        border: none;
    }
    .nav-links.show {
        display: grid;
    }
    .nav-links a {
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Adjust grids for smaller screens */
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
    .bus-name { font-size: 16px; }
    .bus-details { font-size: 12px; }
    
    /* Login & register boxes */
    .login-box {
        width: calc(100% - 20px);
        margin: 40px auto;
        padding: 15px;
    }
    
    /* Forms and inputs */
    input, button, #reg-input {
        width: 100% !important;
        box-sizing: border-box;
        margin: 5px 0;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    /* Handle wide tables so they don't break viewport */
    .screen-area {
        padding: 10px;
        border: none;
        border-radius: 8px;
        margin-top: 10px;
        overflow-x: auto;
    }
    
    th, td {
        padding: 8px 4px;
        font-size: 0.85em;
    }
    
    /* Timeline adjustments */
    .timeline-item span.date {
        float: none;
        display: block;
        margin-bottom: 5px;
    }
    
    .overview {
        font-size: 15px;
        padding: 10px;
    }
}

/* Mobile Navigation CSS */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px; /* Space for fixed nav */
    }
    .mobile-menu-header, .nav-links {
        display: none !important; /* Hide old nav completely on mobile */
    }
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        background: rgba(255, 255, 255, 0.45);
        backdrop-filter: blur(12px) saturate(150%);
        -webkit-backdrop-filter: blur(12px) saturate(150%);
        border: 1px solid rgba(255, 255, 255, 0.8);
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
        border-radius: 30px;
        height: 60px;
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
    }
    
    .mobile-nav a {
        color: #3f3f3f;
        width: 40px;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: color 0.2s;
    }
    
    .mobile-nav a:hover, .mobile-nav a:active {
        color: #dc0a2d;
    }

    .mobile-nav a.active {
        background-color: #dc0a2d;
        color: #fff !important;
        border-radius: 50%;
    }

    .mobile-nav a svg {
        width: 28px;
        height: 28px;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none !important; /* Hide new nav on desktop */
    }
}
. i n s t a l l - c o n t a i n e r   {   b a c k g r o u n d :   w h i t e ;   b o r d e r - r a d i u s :   1 0 p x ;   p a d d i n g :   2 0 p x ;   t e x t - a l i g n :   l e f t ;   m a r g i n :   2 0 p x   a u t o ;   m a x - w i d t h :   4 0 0 p x ;   b o x - s h a d o w :   0   4 p x   6 p x   r g b a ( 0 , 0 , 0 , 0 . 1 ) ;   b o r d e r :   2 p x   s o l i d   v a r ( - - d e x - b o r d e r ) ;   } 
 
 
h1, h2, h3, h4, h5, h6, .modal-title, .title { text-shadow: none !important; }
