@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Outfit:wght@300;400;500;600;700&display=swap');

/* Premium Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 2px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

:root {
    --primary: #f97316;
    --primary-light: rgba(249, 115, 22, 0.15);
    --primary-hover: #ea6807;
    --accent: #fbbf24;
    --bg-dark: #08090e;
    --sidebar-bg: #0b0c12;
    --card-bg: rgba(20, 23, 33, 0.6);
    --card-border: rgba(255, 255, 255, 0.05);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-subtle: #475569;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-glow: rgba(249, 115, 22, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

/* Base Ambient Glow */
body::before {
    content: '';
    position: fixed;
    top: -20vh;
    right: -10vw;
    width: 50vw;
    height: 50vh;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.05) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────── */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo .logo-img {
    height: 28px;
    width: auto;
}

.sidebar-logo .logo-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.logo-text {
    font-family: 'Sora', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
    line-height: 1.1;
}

.logo-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0.75rem;
    gap: 0.25rem;
    flex: 1;
}

.nav-section-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-subtle);
    padding: 0.75rem 1rem 0.25rem;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar nav a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar nav a.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.admin-content {
    flex: 1;
    padding: 2.5rem;
    overflow-x: hidden;
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
}

.admin-content.fluid {
    max-width: none;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-topbar h1 {
    font-family: 'Sora', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    font-family: 'Sora', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
}

/* ─── Section Card ─────────────────────── */
.section-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(12px);
    margin-bottom: 2rem;
}

.section-card h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* ─── Data Table ───────────────────────── */
.data-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ─── Status Badges ────────────────────── */
.status-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-pending {
    background: rgba(250, 204, 21, 0.1);
    color: #facc15;
}

.status-preparing {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
}

.status-outfordelivery {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.status-delivered {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
}

.status-cancelled {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
}

/* ─── Forms ────────────────────────────── */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* ─── Buttons ──────────────────────────── */
.btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* ─── Alerts ────────────────────────────── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    color: #f87171;
}

/* ─── Utilities ─────────────────────────── */
.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

/* ─── Login Page ────────────────────────── */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--primary);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary);
    font-size: 2rem;
    font-family: 'Sora', sans-serif;
    font-weight: 800;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ─── Dashboard Specifics ────────────────── */
.topbar-welcome {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ─── Mobile Responsiveness ──────────────── */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }
    .sidebar.active {
        left: 0;
    }
    .admin-content {
        padding: 1.5rem;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .admin-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-top: 3.5rem;
    }
    .mobile-nav-toggle {
        display: flex !important;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(4px);
        z-index: 90;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
    }
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    width: 45px;
    height: 45px;
    background: var(--primary);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 1000;
    cursor: pointer;
    box-shadow: 0 8px 20px var(--shadow-glow);
    transition: 0.3s;
}

.mobile-nav-toggle:hover {
    transform: scale(1.05);
}

/* =====================
   APP LOADER (PREMIUM)
   ===================== */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content {
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loader-logo {
    font-family: 'Sora', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1.5px;
    animation: pulse-logo 1.5s ease-in-out infinite;
}

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

.loader-ring {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(249, 115, 22, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: rotate-loader 1s linear infinite;
    box-shadow: 0 0 15px var(--shadow-glow);
}

@keyframes rotate-loader {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse-logo {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

.app-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* =====================
   LEAFLET THEME INTEGRATION
   ===================== */
.leaflet-container {
    background: var(--bg-dark) !important;
    font-family: inherit;
    z-index: 1 !important;
}

.leaflet-control-zoom a {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-control-zoom a:hover {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
}

.leaflet-bar {
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5) !important;
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.5) !important;
    color: var(--text-muted) !important;
    font-size: 0.65rem !important;
}
