/* ═══════════════════════════════════════════════════════════════════════════════
   🎨 ULTRA-MODERN DASHBOARD CSS v3.0
   Glassmorphism, Micro-animations, Advanced Effects & Latest Trends
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* Primary Colors */
    --primary-blue: #3b82f6;
    --primary-purple: #8b5cf6;
    --primary-pink: #ec4899;
    --primary-green: #10b981;
    --primary-red: #ef4444;
    --primary-orange: #f97316;
    --primary-amber: #f59e0b;
    --primary-cyan: #06b6d4;
    
    /* Neutral Colors */
    --neutral-900: #0f172a;
    --neutral-800: #1e293b;
    --neutral-700: #334155;
    --neutral-600: #475569;
    --neutral-400: #cbd5e1;
    --neutral-300: #e2e8f0;
    
    /* Gradients */
    --gradient-blue-purple: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-pink-orange: linear-gradient(135deg, #ec4899, #f97316);
    --gradient-cyan-blue: linear-gradient(135deg, #06b6d4, #3b82f6);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ✨ GLOBAL STYLES & FOUNDATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.6) transparent;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.6), rgba(139, 92, 246, 0.6));
    border-radius: 10px;
    border: 2px solid transparent;
    transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.8), rgba(236, 72, 153, 0.8));
}

/* Hide scrollbar completely */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--neutral-900) 0%, #0f172a 50%, var(--neutral-800) 100%);
    color: #ffffff;
    line-height: 1.6;
    font-smooth: always;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   💎 GLASSMORPHISM EFFECTS
   ═══════════════════════════════════════════════════════════════════════════════ */

.glass-effect {
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.glass-effect-strong {
    backdrop-filter: blur(20px);
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.glass-effect-light {
    backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎯 KPI CARDS - MODERN DESIGN WITH ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

.kpi-card {
    position: relative;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(100, 116, 139, 0.5);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-base);
    transform-style: preserve-3d;
    perspective: 1000px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 1 !important;
    visibility: visible !important;
}

.kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.2), 0 0 60px rgba(59, 130, 246, 0.1);
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
}

/* Counter animation styles */
.counter-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--transition-base);
}

.counter-value.counter-updating {
    animation: counter-pulse 0.3s ease-out;
}

.counter-value.counter-complete {
    animation: counter-complete-flash 0.4s ease-out;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   📊 STATUS CARDS - COLOR CODED WITH SMOOTH EFFECTS
   ═══════════════════════════════════════════════════════════════════════════════ */

.status-card {
    position: relative;
    background: rgba(30, 41, 59, 0.85);
    border: 2px solid rgba(100, 116, 139, 0.4);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-base);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 24px;
}

.status-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.status-card:hover::after {
    opacity: 1;
}

.status-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 50px rgba(59, 130, 246, 0.15);
}

/* Status-specific colors */
.status-card.status-pending {
    border-color: rgba(249, 115, 22, 0.5);
}

.status-card.status-pending:hover {
    border-color: rgba(249, 115, 22, 0.8);
    box-shadow: 0 20px 40px rgba(249, 115, 22, 0.2);
}

.status-card.status-confirmed {
    border-color: rgba(16, 185, 129, 0.5);
}

.status-card.status-confirmed:hover {
    border-color: rgba(16, 185, 129, 0.8);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.2);
}

.status-card.status-delivered {
    border-color: rgba(139, 92, 246, 0.5);
}

.status-card.status-delivered:hover {
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2);
}

.status-card.status-cancelled {
    border-color: rgba(239, 68, 68, 0.5);
}

.status-card.status-cancelled:hover {
    border-color: rgba(239, 68, 68, 0.8);
    box-shadow: 0 20px 40px rgba(239, 68, 68, 0.2);
}

.status-card i {
    font-size: 2rem;
    transition: all var(--transition-base);
}

.status-card:hover i {
    transform: scale(1.15) rotate(5deg);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   📋 TABLE STYLES - MODERN & INTERACTIVE
   ═══════════════════════════════════════════════════════════════════════════════ */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, 0.3);
    backdrop-filter: blur(10px);
}

thead {
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 2px solid rgba(100, 116, 139, 0.3);
}

thead th {
    padding: 16px 12px;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(203, 213, 225, 0.8);
}

tbody tr {
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    transition: all var(--transition-fast);
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.05);
}

tbody td {
    padding: 14px 12px;
    color: rgba(203, 213, 225, 0.9);
    transition: color var(--transition-fast);
}

tbody tr:hover td {
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎬 ANIMATION KEYFRAMES - ULTRA-MODERN EFFECTS
   ═══════════════════════════════════════════════════════════════════════════════ */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@keyframes pulse-subtle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes counter-pulse {
    0% {
        scale: 0.95;
        opacity: 0.8;
    }
    50% {
        scale: 1.02;
    }
    100% {
        scale: 1;
        opacity: 1;
    }
}

@keyframes counter-complete-flash {
    0% {
        color: rgba(255, 255, 255, 1);
    }
    50% {
        color: rgba(59, 130, 246, 1);
    }
    100% {
        color: rgba(255, 255, 255, 1);
    }
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes rotate-gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎨 UTILITY ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

.animate-pulse-glow {
    animation: pulse-glow 1s ease-out;
}

.animate-pulse-subtle {
    animation: pulse-subtle 2s ease-in-out infinite;
}

.animate-counter-pulse {
    animation: counter-pulse 0.4s ease-out;
}

.animate-bounce-in {
    animation: bounce-in 0.5s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.animate-rotate-gradient {
    background-size: 400% 400%;
    animation: rotate-gradient 15s ease infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ✨ RIPPLE EFFECT
   ═══════════════════════════════════════════════════════════════════════════════ */

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.6) 0%, rgba(59, 130, 246, 0.2) 70%, transparent 100%);
    transform: scale(0);
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   📱 RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Tablet (480px - 768px) */
@media (max-width: 768px) {
    .kpi-card {
        padding: 16px;
    }
    
    .counter-value {
        font-size: 1.875rem;
    }
    
    .status-card {
        padding: 16px;
    }
    
    thead th {
        font-size: 0.75rem;
        padding: 12px 8px;
    }
    
    tbody td {
        padding: 10px 8px;
        font-size: 0.875rem;
    }
}

/* Mobile (< 480px) */
@media (max-width: 480px) {
    .kpi-card {
        padding: 12px;
        border-radius: 12px;
    }
    
    .counter-value {
        font-size: 1.5rem;
    }
    
    .status-card {
        padding: 12px;
        border-radius: 12px;
    }
    
    .status-card i {
        font-size: 1.5rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    thead th {
        font-size: 0.65rem;
        padding: 8px 4px;
    }
    
    tbody td {
        padding: 8px 4px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ♿ ACCESSIBILITY FEATURES
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: light) {
    body {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #ecf0f5 100%);
        color: #0f172a;
    }
    
    .kpi-card,
    .status-card,
    table {
       background: rgba(255, 255, 255, 0.8);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎯 FOCUS & ACTIVE STATES
   ═══════════════════════════════════════════════════════════════════════════════ */

button:focus,
a:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

button:active {
    transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🔝 BACK TO TOP BUTTON
   ═══════════════════════════════════════════════════════════════════════════════ */

#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-blue-purple);
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    z-index: 50;
}

#back-to-top:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.6);
}

#back-to-top:active {
    transform: translateY(0) scale(0.98);
}

@media (max-width: 640px) {
    #back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
        font-size: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎪 PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

@media print {
    body {
        background: white;
        color: black;
    }
    
    .kpi-card,
    .status-card {
        background: white;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    table {
        background: white;
        border: 1px solid #ddd;
    }
}
