/* =========================
   SMART GARAGE SYSTEM CSS
   Futuristic • Clean • Fast
========================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(255,255,255,0.05);
    --primary: #38bdf8;
    --primary-soft: rgba(56,189,248,0.15);
    --success: #22c55e;
    --warning: #facc15;
    --danger: #ef4444;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-soft: rgba(255,255,255,0.08);
    --radius: 14px;
    --blur: blur(14px);
    --surface-color: rgba(255,255,255,0.05);
    --border-color: rgba(255,255,255,0.08);
    --primary-color: #38bdf8;
    --text-secondary: #94a3b8;
    --success-color: #22c55e;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.2);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a, #020617);
    color: var(--text-main);
    min-height: 100vh;
}

/* =========================
   Layout
========================= */

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: 260px;
    background: rgba(255,255,255,0.03);
    backdrop-filter: var(--blur);
    border-right: 1px solid var(--border-soft);
    padding: 30px 20px;
    position: fixed;
    height: 100%;
}

.sidebar h2,
.sidebar-brand h2 {
    color: var(--primary);
    margin-bottom: 40px;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar a,
.sidebar-link {
    display: block;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-muted);
    transition: 0.3s;
}

.sidebar a:hover,
.sidebar a.active,
.sidebar-link:hover,
.sidebar-link.active {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Main Content */

.main,
.content-panel {
    margin-left: 260px;
    padding: 40px;
    width: 100%;
}

/* =========================
   Cards
========================= */

.card,
.panel,
.form-container,
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    backdrop-filter: var(--blur);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
    transition: 0.3s ease;
}

.card:hover,
.panel:hover,
.form-container:hover,
.login-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-soft);
}

/* Dashboard Stat Cards */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
}

.stat h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat p {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

/* =========================
   Tables
========================= */

.table,
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td,
.data-table th, .data-table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}

.table th,
.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
}

.table tr:hover,
.data-table tr:hover {
    background: rgba(255,255,255,0.03);
}

/* =========================
   Buttons
========================= */

.btn,
.button {
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    pointer-events: auto;
    display: inline-block;
    text-align: center;
}

.btn-primary,
.button-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover,
.button-primary:hover {
    opacity: 0.85;
}

.btn-success,
.button-success {
    background: var(--success);
    color: #000;
}

.btn-danger,
.button-danger {
    background: var(--danger);
    color: #fff;
}

button {
    cursor: pointer;
    pointer-events: auto;
}

/* =========================
   Forms
========================= */

input, select, textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.04);
    color: var(--text-main);
    margin-bottom: 15px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* =========================
   Login Page
========================= */

.login-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    width: 380px;
    padding: 40px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    backdrop-filter: var(--blur);
}

.login-card h2 {
    margin-bottom: 25px;
    color: var(--primary);
    text-align: center;
}

/* =========================
   Badges / Status
========================= */

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: var(--success); color: #000; }
.badge-warning { background: var(--warning); color: #000; }
.badge-danger  { background: var(--danger); color: #fff; }

/* =========================
   Search Bar
========================= */

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
}

/* =========================
   Alerts
========================= */

.alert {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border: 1px solid var(--border-soft);
}

.alert-success { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.2); color: #d1fae5; }
.alert-warning { background: rgba(250,204,21,0.12); border-color: rgba(250,204,21,0.2); color: #fef08a; }
.alert-danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.2); color: #fecaca; }
.alert-info { background: rgba(56,189,248,0.12); border-color: rgba(56,189,248,0.2); color: #bfdbfe; }

/* Misc helpers */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 1rem;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header p {
    color: var(--text-muted);
}

/* Topbar + animated cars */
.topbar {
    position: relative;
    height: 100px;
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    overflow: visible;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
}

.topbar-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.road {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #424242 0%, #424242 40%, #ffffff 40%, #ffffff 50%, #424242 50%, #424242 90%, #ffffff 90%);
    background-size: 200px 6px;
    animation: road-move 3s linear infinite;
    opacity: 0.6;
}

.car {
    position: absolute;
    bottom: 20px;
    width: 70px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    animation: car-move 6s ease-in-out infinite;
}

.car-drift { animation-delay: 0s; }
.car-saloon { animation-delay: 2s; }
.car-track { animation-delay: 4s; }

@keyframes road-move {
    0% { background-position: 0 0; }
    100% { background-position: 200px 0; }
}

@keyframes car-move {
    0% { left: 100%; transform: translateY(0px) rotateZ(0deg); }
    25% { transform: translateY(-8px) rotateZ(-3deg); }
    50% { transform: translateY(0px) rotateZ(0deg); }
    75% { transform: translateY(-8px) rotateZ(3deg); }
    100% { left: -80px; transform: translateY(0px) rotateZ(0deg); }
}

.topbar-content {
    position: absolute;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    color: white;
}

.topbar-brand a,
.topbar-actions a {
    color: white;
    text-decoration: none;
}

.sidebar-brand,
.sidebar h2 {
    margin-bottom: 0;
}

.sidebar-brand {
    margin-bottom: 2rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-toggle {
    display: inline-block;
    width: 24px;
    height: 24px;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.sidebar-toggle.expanded { transform: rotateZ(180deg); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    opacity: 1;
}

.sidebar-nav.collapsed {
    max-height: 0;
    opacity: 0;
}

.sidebar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    background-color: transparent;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
    white-space: nowrap;
}

.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    font-size: 1rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: var(--primary-soft);
    color: var(--primary);
    padding-left: 1.5rem;
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link.active .sidebar-icon {
    background: rgba(56,189,248,0.2);
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =========================
   Responsive
========================= */

@media(max-width: 900px) {
    .sidebar {
        display: none;
    }
    .main,
    .content-panel {
        margin-left: 0;
        padding: 20px;
    }
}
