@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Light Mode Variables */
    --bg-color: #f3f4f6;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --primary: #4f46e5;
    --primary-light: #e0e7ff;
    --primary-hover: #4338ca;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 12px;
    --radius-lg: 20px;
    --input-bg: #f9fafb;
}

[data-theme="dark"] {
    /* Dark Mode Variables */
    --bg-color: #111827;
    --surface: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --primary: #6366f1;
    --primary-light: #3730a3;
    --primary-hover: #818cf8;
    --border: #374151;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --input-bg: #374151;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}

/* ---------------- TOAST NOTIFICATIONS ---------------- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--surface);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    animation: slideInRight 0.4s forwards;
    border-left: 4px solid var(--primary);
    min-width: 250px;
}
.toast.toast-error { border-left-color: #ef4444; }
.toast.toast-success { border-left-color: #22c55e; }
@keyframes slideInRight {
    to { transform: translateX(0); }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* ---------------- RESPONSIVE DESIGN ---------------- */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 15px;
    }
    .main-content {
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ---------------- SIDEBAR ---------------- */
.sidebar {
    width: 260px;
    background: #151723; /* Very dark slate background */
    border-right: 1px solid #1e202f;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 10;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.sidebar-header {
    margin-bottom: 24px;
    padding: 0 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
}

.brand-icon {
    background: #25283c;
    color: #38bdf8;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-user {
    margin-top: 12px;
    font-size: 0.8rem;
    color: #8f93ad;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-user .dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4e5370;
    font-weight: 800;
    margin: 16px 0 6px 8px;
}

/* Sidebar Links & Group Headers */
.sidebar a, .nav-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #8f93ad;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.sidebar a .material-symbols-rounded, .nav-group-header .material-symbols-rounded {
    font-size: 20px;
    color: #4e5370;
    transition: all 0.2s ease;
}

.sidebar a:hover, .nav-group-header:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.sidebar a:hover .material-symbols-rounded, .nav-group-header:hover .material-symbols-rounded {
    color: #ffffff;
}

.sidebar a.active {
    background: rgba(56, 189, 248, 0.08);
    color: #ffffff;
    font-weight: 700;
}

.sidebar a.active .material-symbols-rounded {
    color: #38bdf8; /* Highlighted active icon */
}

/* Collapsible Nav Group */
.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-group-items {
    display: none;
    margin-left: 22px;
    padding-left: 14px;
    border-left: 1px solid #2e324e;
    margin-top: 2px;
    margin-bottom: 6px;
}

.nav-group.open .nav-group-items {
    display: block;
}

.nav-group-items a {
    position: relative;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.nav-group-items a::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    width: 8px;
    height: 1px;
    background: #2e324e;
}

.chevron {
    margin-left: auto;
    font-size: 16px !important;
    transition: transform 0.2s ease;
}

.nav-group.open .chevron {
    transform: rotate(180deg);
}

.sidebar a.logout {
    margin-top: auto;
    color: #ef4444;
    background: transparent;
}
.sidebar a.logout .material-symbols-rounded {
    color: #ef4444;
}
.sidebar a.logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

/* ---------------- MAIN CONTENT ---------------- */
.main-content {
    flex: 1;
    padding: 40px;
    max-height: 100vh;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

/* Glass/Card Panel */
.glass-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 30px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-info h4 {
    margin: 0 0 5px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-info .value {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Colors for Icons */
.icon-blue { background: #eff6ff; color: #3b82f6; }
.icon-purple { background: #fdf4ff; color: #d946ef; }
.icon-green { background: #f0fdf4; color: #22c55e; }
.icon-orange { background: #fff7ed; color: #f97316; }

/* ---------------- FORMS & BUTTONS ---------------- */
label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.btn {
    padding: 14px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}
.btn:hover { 
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.btn-add-review-premium {
    background: #00a8ff;
    color: #ffffff;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    height: 44px !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
}
.btn-add-review-premium:hover {
    background: #0097e6;
    color: #ffffff;
    text-decoration: none;
}

/* ---------------- LOGIN PAGE ---------------- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f3f4f6;
    background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 20px 20px;
}

.login-box {
    width: 100%;
    max-width: 440px;
    padding: 48px;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.login-box h2 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 800;
    font-size: 2.2rem;
}
.login-box p.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 500;
}

/* ---------------- ALERTS ---------------- */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}
.alert-danger {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}
.alert-success {
    background: #f0fdf4;
    color: #22c55e;
    border: 1px solid #bbf7d0;
}
