/* ==========================================================================
   1. GLOBAL & RESET (NEUMORPHIC BASE)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;800;900&display=swap');

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: #FAF3E1; /* Signature Cream */
    margin: 0; 
    padding: 0;
    color: #333;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }

/* Helpers */
.spacer { flex-grow: 1; }
.text-center { text-align: center; }
.divider-3d {
    border: 0; height: 1px;
    background-image: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0));
    margin: 15px 0;
}

/* ==========================================================================
   2. THE RED HEADER (UPDATED)
   ========================================================================== */
.app-header {
    background: #D32F2F; /* Match your buttons */
    height: 70px; /* INCREASED HEIGHT (was 60px) */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 1100;
    
    /* NEW: ROUNDED CORNERS */
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    
    /* Soft shadow to make it pop */
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.3); 
    color: white;
}

.header-left { display: flex; align-items: center; gap: 20px; }
.hamburger-btn { font-size: 24px; cursor: pointer; color: white; transition: 0.2s; }
.hamburger-btn:hover { transform: scale(1.1); opacity: 0.8; }

.header-title { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: 0.5px; }

/* LOGO IMAGE STYLE */
.header-logo-img {
    height: 55px; /* Slightly larger */
    width: auto;
    object-fit: contain;
    
    /* CSS MAGIC: Turns your Red logo into Cream (#FAF3E1) */
    filter: brightness(0) saturate(100%) invert(93%) sepia(9%) saturate(444%) hue-rotate(334deg) brightness(105%) contrast(94%);
    
    /* Adds a soft shadow so it stands out against the red */
    drop-shadow: 2px 2px 2px rgba(0,0,0,0.2);
}
/* ==========================================================================
   3. HIDDEN SIDEBAR (DRAWER STYLE)
   ========================================================================== */
.sidebar {
    height: 100vh;
    width: 260px;
    position: fixed;
    top: 0; 
    left: 0;
    background-color: #FAF3E1; /* Keep Cream! */
    z-index: 1200;
    
    /* HIDDEN BY DEFAULT */
    transform: translateX(-100%); 
    transition: transform 0.3s ease-in-out;
    
    padding: 20px;
    box-shadow: 5px 0 15px rgba(210, 200, 180, 0.4); /* 3D Shadow on right */
    display: flex; flex-direction: column;
}

/* Class to show sidebar */
.sidebar.active { transform: translateX(0); }

/* Sidebar Header */
.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; height: 40px; /* Align with top bar */
}
.brand-logo-text { font-size: 24px; font-weight: 900; color: #D32F2F; font-style: italic; }
.close-btn { font-size: 24px; color: #D32F2F; cursor: pointer; }

/* Sidebar Links */
.nav-group { margin-top: 10px; flex-grow: 1; }
.nav-item {
    display: flex; align-items: center; gap: 15px;
    padding: 15px 20px; margin-bottom: 10px;
    color: #777; font-weight: 600;
    border-radius: 15px; transition: all 0.2s ease;
}
.nav-item:hover { color: #333; transform: translateX(5px); }
.nav-item.active {
    color: #D32F2F; background: #FAF3E1;
    /* The 3D Pressed Effect */
    box-shadow: inset 4px 4px 8px rgba(210, 200, 180, 0.6), 
                inset -4px -4px 8px rgba(255,255,255, 0.8);
}
.sidebar-footer { margin-top: auto; }

/* Overlay */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1150;
    display: none; backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ==========================================================================
   4. CONTENT LAYOUT
   ========================================================================== */
.main-content {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ==========================================================================
   5. NEUMORPHIC 3D COMPONENTS (RESTORED)
   ========================================================================== */
/* Cards */
.card-3d {
    background: #FAF3E1;
    border-radius: 20px;
    box-shadow: 9px 9px 16px rgba(210, 200, 180, 0.6), 
               -9px -9px 16px rgba(255,255,255, 0.8);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Inputs */
.input-group-3d { margin-bottom: 20px; }
.input-wrapper { position: relative; width: 100%; }
.input-3d {
    width: 100%; padding: 12px 15px 12px 45px;
    border: none; border-radius: 15px;
    background: #FAF3E1;
    box-shadow: inset 5px 5px 10px rgba(210, 200, 180, 0.6), 
                inset -5px -5px 10px rgba(255,255,255, 0.8);
    font-size: 14px; color: #333; outline: none;
}
.input-wrapper i {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: #888; font-size: 14px; pointer-events: none;
}
.connector {
    height: 20px; border-left: 2px dashed #bbb;
    margin-left: 21px; margin-top: -5px; margin-bottom: -5px;
}

/* Buttons */
.btn-3d-red {
    width: 100%; padding: 15px; border: none; border-radius: 50px;
    background: linear-gradient(145deg, #D32F2F, #b71c1c);
    color: white; font-size: 16px; font-weight: bold; letter-spacing: 1px;
    box-shadow: 5px 5px 10px rgba(210, 200, 180, 0.6), -5px -5px 10px rgba(255,255,255, 0.5);
    cursor: pointer; transition: 0.2s;
}
.btn-3d-red:hover { transform: translateY(-2px); background: linear-gradient(145deg, #e53935, #c62828); }
.btn-3d-red:active { transform: translateY(0); box-shadow: inset 4px 4px 8px rgba(0,0,0,0.2); }

.btn-3d-white {
    width: 100%; padding: 12px; border: none; border-radius: 15px;
    background: #FAF3E1; color: #333; font-weight: bold;
    box-shadow: 6px 6px 10px 0 rgba(210, 200, 180, 0.7), -6px -6px 10px 0 rgba(255,255,255, 0.8);
    cursor: pointer;
}
.btn-3d-red-outline {
    flex: 1; padding: 10px; border: 1px solid rgba(211,47,47,0.1); border-radius: 12px;
    background: #FAF3E1; color: #D32F2F; font-weight: bold;
    box-shadow: 5px 5px 10px rgba(210, 200, 180, 0.6), -5px -5px 10px rgba(255,255,255, 0.8);
    cursor: pointer;
}
.btn-3d-green {
    flex: 1; padding: 10px; border: none; border-radius: 12px;
    background: linear-gradient(145deg, #4CAF50, #43A047); color: white; font-weight: bold;
    box-shadow: 5px 5px 10px rgba(210, 200, 180, 0.5), -5px -5px 10px rgba(255,255,255, 0.6);
    cursor: pointer;
}

/* Feature Icons (Circle) */
.feature-icon-circle {
    width: 40px; height: 40px; background: #D32F2F; color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* Toggle & Badges */
.toggle-3d {
    width: 50px; height: 26px; background: #FAF3E1; border-radius: 50px; position: relative;
    box-shadow: inset 3px 3px 6px rgba(210, 200, 180, 0.6), inset -3px -3px 6px rgba(255,255,255, 0.8);
    cursor: pointer;
}
.toggle-circle {
    width: 22px; height: 22px; background: #ccc; border-radius: 50%;
    position: absolute; top: 2px; left: 2px; transition: 0.3s;
}
.toggle-3d.active .toggle-circle { transform: translateX(24px); background: #4CAF50; }

.status-badge { font-size: 11px; font-weight: bold; padding: 5px 12px; border-radius: 12px; text-transform: uppercase; }
.warning { background-color: #fff3cd; color: #856404; }
.success { background-color: #d4edda; color: #155724; }

/* ==========================================================================
   6. LOGIN PAGE SPECIFIC STYLES
   ========================================================================== */
.login-wrapper-3d {
    display: flex;
    width: 900px;
    max-width: 95%; /* Prevents overflow on mobile */
    padding: 0;
    overflow: hidden;
    min-height: 550px;
    border: none;
    margin: 20px auto;
}

.login-brand-panel {
    flex: 1;
    background: #D32F2F;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 40px;
    text-align: center;
}

.login-form-panel {
    flex: 1;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #FAF3E1;
}

/* ==========================================================================
   7. GRIDS, UTILS & MOBILE RESPONSIVE
   ========================================================================== */
.split-row { display: flex; gap: 20px; margin-bottom: 25px; }
.student-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 30px; }
.driver-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }

.route-row { display: flex; align-items: center; gap: 15px; margin: 10px 0; }
.location-text { font-size: 15px; font-weight: 600; color: #333; }
.map-view-large {
    background: #e0e0e0; border-radius: 20px;
    box-shadow: inset 5px 5px 10px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .student-grid, .driver-grid, .split-row { display: flex; flex-direction: column; }
    .main-content { padding: 20px; }
    
    /* Header Adjustments */
    .app-header { padding: 0 15px; }
    .header-title { display: none; } /* Hide title on small screens to prevent overlap */
    .header-logo-img { height: 45px; } 

    /* Login Page Adjustments */
    .login-wrapper-3d {
        flex-direction: column; /* Stacks the red panel and form vertically */
        height: auto;
    }
    .login-brand-panel {
        padding: 40px 20px;
    }
    .login-brand-panel i {
        font-size: 60px !important;
    }
    .login-brand-panel h1 {
        font-size: 36px !important;
    }
    .login-form-panel {
        padding: 40px 20px;
    }
}