/**
 * DNE Transport — Professional UI Theme
 * Colorful icons, animations, glass cards, gradients
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    --dne-font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --dne-sidebar: #0c1222;
    --dne-sidebar-border: rgba(255,255,255,0.06);
    --dne-glow: 0 0 40px -8px rgba(99, 102, 241, 0.45);
    --dne-card-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 12px 32px -8px rgba(15, 23, 42, 0.1);
    --dne-card-hover: 0 20px 40px -12px rgba(15, 23, 42, 0.15);
}

body {
    font-family: var(--dne-font) !important;
}

/* ─── App shell background ─── */
.dne-app-bg {
    background-color: #f8fafc;
    background-image:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(16, 185, 129, 0.06), transparent),
        radial-gradient(ellipse 50% 30% at 80% 100%, rgba(244, 114, 182, 0.05), transparent);
}
.dark .dne-app-bg {
    background-color: #0f172a;
    background-image:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(16, 185, 129, 0.08), transparent);
}

/* ─── Sidebar ─── */
.dne-sidebar {
    background: linear-gradient(180deg, #0c1222 0%, #111827 50%, #0f172a 100%);
    border-right: 1px solid var(--dne-sidebar-border);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
.dne-sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.15), transparent);
    pointer-events: none;
    z-index: 0;
}

.dne-sidebar-nav {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
.dne-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.dne-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 9999px;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.5rem;
    line-height: 1.25;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.sidebar-link .ml-auto {
    margin-left: auto;
    flex-shrink: 0;
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 0 var(--nav-accent, #6366f1);
}
.sidebar-link.active .nav-icon {
    transform: scale(1.08);
    box-shadow: var(--dne-glow);
}

.dne-sidebar-section {
    padding-top: 1rem;
    margin-top: 0.75rem;
    border-top: 1px solid rgba(51, 65, 85, 0.55);
}
.dne-sidebar-section-label {
    padding: 0 0.75rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

/* ─── Colorful nav icons ─── */
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.sidebar-link:hover .nav-icon {
    transform: scale(1.08);
}
.nav-icon-svg {
    width: 1.125rem;
    height: 1.125rem;
    color: #fff;
}

.nav-icon-violet  { background: linear-gradient(135deg, #8b5cf6, #6366f1); --nav-accent: #8b5cf6; }
.nav-icon-blue    { background: linear-gradient(135deg, #3b82f6, #2563eb); --nav-accent: #3b82f6; }
.nav-icon-emerald { background: linear-gradient(135deg, #10b981, #059669); --nav-accent: #10b981; }
.nav-icon-orange  { background: linear-gradient(135deg, #f97316, #ea580c); --nav-accent: #f97316; }
.nav-icon-amber   { background: linear-gradient(135deg, #f59e0b, #d97706); --nav-accent: #f59e0b; }
.nav-icon-rose    { background: linear-gradient(135deg, #f43f5e, #e11d48); --nav-accent: #f43f5e; }
.nav-icon-cyan    { background: linear-gradient(135deg, #06b6d4, #0891b2); --nav-accent: #06b6d4; }
.nav-icon-teal    { background: linear-gradient(135deg, #14b8a6, #0d9488); --nav-accent: #14b8a6; }
.nav-icon-pink    { background: linear-gradient(135deg, #ec4899, #db2777); --nav-accent: #ec4899; }
.nav-icon-indigo  { background: linear-gradient(135deg, #6366f1, #4f46e5); --nav-accent: #6366f1; }
.nav-icon-lime    { background: linear-gradient(135deg, #84cc16, #65a30d); --nav-accent: #84cc16; }
.nav-icon-red     { background: linear-gradient(135deg, #ef4444, #dc2626); --nav-accent: #ef4444; }
.nav-icon-sky     { background: linear-gradient(135deg, #0ea5e9, #0284c7); --nav-accent: #0ea5e9; }
.nav-icon-slate   { background: linear-gradient(135deg, #64748b, #475569); --nav-accent: #64748b; }

/* Icon pulse animation on active page load */
@keyframes navIconPop {
    0% { transform: scale(0.8); opacity: 0.5; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.sidebar-link.active .nav-icon {
    animation: navIconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Header glass ─── */
.dne-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.dark .dne-header {
    background: rgba(15, 23, 42, 0.85);
    border-bottom-color: rgba(51, 65, 85, 0.5);
}

/* ─── Cards (global) ─── */
main .dne-card,
main .bg-white.rounded-xl.shadow-sm,
main .bg-white.dark\:bg-slate-800.rounded-xl.shadow-sm {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
main a.dne-card:hover,
main a.bg-white.rounded-xl.shadow-sm.block:hover,
main a.bg-white.rounded-xl.shadow-sm:hover {
    transform: translateY(-4px);
    box-shadow: var(--dne-card-hover) !important;
}

.dne-card {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--dne-card-shadow);
}
.dark .dne-card {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(51, 65, 85, 0.6);
}

/* Stat cards with gradient accent bar */
.dne-stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--dne-card-shadow);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .dne-stat-card {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(51, 65, 85, 0.6);
}
.dne-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--stat-gradient, linear-gradient(90deg, #6366f1, #8b5cf6));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.dne-stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--dne-card-hover);
}
.dne-stat-card:hover::before { opacity: 1; }

.dne-stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dne-stat-card:hover .dne-stat-icon {
    transform: scale(1.15) rotate(5deg);
}
.dne-stat-icon svg { width: 1.5rem; height: 1.5rem; color: #fff; }

.dne-stat-blue   .dne-stat-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.dne-stat-blue   { --stat-gradient: linear-gradient(90deg, #3b82f6, #1d4ed8); }
.dne-stat-emerald .dne-stat-icon { background: linear-gradient(135deg, #10b981, #047857); }
.dne-stat-emerald { --stat-gradient: linear-gradient(90deg, #10b981, #047857); }
.dne-stat-amber  .dne-stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.dne-stat-amber  { --stat-gradient: linear-gradient(90deg, #f59e0b, #d97706); }
.dne-stat-violet .dne-stat-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.dne-stat-violet { --stat-gradient: linear-gradient(90deg, #8b5cf6, #6d28d9); }
.dne-stat-rose   .dne-stat-icon { background: linear-gradient(135deg, #f43f5e, #be123c); }
.dne-stat-rose   { --stat-gradient: linear-gradient(90deg, #f43f5e, #be123c); }
.dne-stat-cyan   .dne-stat-icon { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.dne-stat-cyan   { --stat-gradient: linear-gradient(90deg, #06b6d4, #0e7490); }

/* ─── Buttons ─── */
.dne-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
    background-size: 200% auto;
    color: #fff;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px -2px rgba(99, 102, 241, 0.45);
}
.dne-btn-primary:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.55);
}

main button.bg-primary-600,
main a.bg-primary-600 {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    box-shadow: 0 4px 14px -2px rgba(99, 102, 241, 0.4);
    transition: all 0.25s ease !important;
}
main button.bg-primary-600:hover,
main a.bg-primary-600:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.5) !important;
}

/* ─── Page entrance animations ─── */
@keyframes dneFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes dneFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes dneShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes dneFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes dnePulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 20px 4px rgba(99, 102, 241, 0.2); }
}

.dne-animate-in {
    animation: dneFadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.dne-animate-in-delay-1 { animation-delay: 0.05s; }
.dne-animate-in-delay-2 { animation-delay: 0.1s; }
.dne-animate-in-delay-3 { animation-delay: 0.15s; }
.dne-animate-in-delay-4 { animation-delay: 0.2s; }
.dne-animate-in-delay-5 { animation-delay: 0.25s; }
.dne-animate-in-delay-6 { animation-delay: 0.3s; }

.dne-page-header h1 {
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.dark .dne-page-header h1 {
    background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ─── Logo glow ─── */
.dne-logo {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    background-size: 200% auto;
    animation: dneShimmer 4s linear infinite;
    box-shadow: 0 4px 20px -4px rgba(99, 102, 241, 0.6);
}
.dne-logo-float {
    animation: dneFloat 3s ease-in-out infinite;
}

/* ─── Tables ─── */
main table thead {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}
.dark main table thead {
    background: linear-gradient(180deg, rgba(51,65,85,0.5), rgba(30,41,59,0.8));
}
main table tbody tr {
    transition: background 0.2s ease, transform 0.2s ease;
}
main table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

/* ─── Flash / alerts ─── */
.dne-alert {
    border-radius: 0.875rem;
    animation: dneFadeUp 0.4s ease;
    backdrop-filter: blur(8px);
}

/* ─── Avatar ring ─── */
.dne-avatar {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(99, 102, 241, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.dne-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px #fff, 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* ─── Login page ─── */
.dne-login-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 100%);
}
.dne-login-card {
    animation: dneFadeUp 0.6s ease;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}
.dne-login-icon {
    animation: dneFloat 3s ease-in-out infinite;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

/* ─── Driver portal bottom nav ─── */
.dne-tab-active {
    color: #6366f1 !important;
}
.dne-tab-active svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.4));
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
