/*
   ================================================================
   ENHANCED ADMIN UI - MK ADMIN DASHBOARD
   Modern Design with Animations & Beautiful Icons
   ================================================================
*/

/* === GOOGLE FONTS - INTER & POPPINS === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

/* === CSS VARIABLES === */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* === GLOBAL RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f1f5f9 0%, #e8ecf1 50%, #f8fafc 100%);
    min-height: 100vh;
    color: var(--gray-700);
    /* Safari: overflow-x:hidden breaks position:fixed elements */
    overflow-x: clip;
}

/* === ANIMATED BACKGROUND - SIMPLE & CLEAN === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.03) 0%, transparent 60%),
        radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* === FLOATING ORBS === */
body::after {
    display: none;
}

/* === SIDEBAR - MODERN GLASS DESIGN === */
#sidenav {
    width: var(--sidebar-width) !important;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 10040;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 30%, #3730a3 70%, #4338ca 100%) !important;
    border-right: none !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15) !important;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all var(--transition-normal);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
    animation: sidebarSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes sidebarSlideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

#sidenav::-webkit-scrollbar {
    width: 4px;
}

#sidenav::-webkit-scrollbar-track {
    background: transparent;
}

#sidenav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

/* === SIDEBAR HEADER === */
#sidenav .menu.card-header {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 20px 18px !important;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#sidenav .menu.card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: shimmer 4s infinite linear;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

#sidenav .menu.card-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff !important;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
    animation: fadeInDown 0.5s ease-out 0.3s both;
}

/* === SIDEBAR MENU ITEMS === */
#sidenav a.menu,
#sidenav .dropdown-btn {
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 12px 18px !important;
    margin: 2px 8px;
    border-radius: var(--border-radius-sm) !important;
    border-left: none !important;
    transition: all var(--transition-normal) !important;
    display: flex !important;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    opacity: 0;
    animation: menuItemFadeIn 0.4s ease-out forwards;
}

/* Stagger animation for menu items */
#sidenav a.menu:nth-child(1) { animation-delay: 0.1s; }
#sidenav a.menu:nth-child(2) { animation-delay: 0.15s; }
#sidenav a.menu:nth-child(3) { animation-delay: 0.2s; }
#sidenav a.menu:nth-child(4) { animation-delay: 0.25s; }
#sidenav a.menu:nth-child(5) { animation-delay: 0.3s; }
#sidenav a.menu:nth-child(6) { animation-delay: 0.35s; }
#sidenav a.menu:nth-child(7) { animation-delay: 0.4s; }
#sidenav a.menu:nth-child(8) { animation-delay: 0.45s; }
#sidenav .dropdown-btn:nth-child(1) { animation-delay: 0.1s; }
#sidenav .dropdown-btn:nth-child(2) { animation-delay: 0.15s; }
#sidenav .dropdown-btn:nth-child(3) { animation-delay: 0.2s; }
#sidenav .dropdown-btn:nth-child(4) { animation-delay: 0.25s; }
#sidenav .dropdown-btn:nth-child(5) { animation-delay: 0.3s; }

@keyframes menuItemFadeIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Glassmorphism hover effect */
#sidenav a.menu:hover,
#sidenav .dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Active state */
#sidenav a.menu.active,
#sidenav .dropdown-btn.active {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#sidenav a.menu.active::before,
#sidenav .dropdown-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(180deg, var(--accent), var(--primary-light));
    border-radius: 0 4px 4px 0;
    animation: activeIndicator 0.4s ease-out;
}

@keyframes activeIndicator {
    0% { height: 0; opacity: 0; }
    100% { height: 60%; opacity: 1; }
}

/* === SIDEBAR ICONS - BEAUTIFUL STYLING === */
#sidenav a.menu i.fa,
#sidenav .dropdown-btn i.fa:first-child,
#sidenav .dropdown-container a i.fa:first-child {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 15px !important;
    transition: all var(--transition-bounce) !important;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#sidenav a.menu:hover i.fa,
#sidenav .dropdown-btn:hover i.fa:first-child {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#sidenav a.menu.active i.fa,
#sidenav .dropdown-btn.active i.fa:first-child {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary)) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    animation: iconPulse 4s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5); }
}

/* === DROPDOWN CONTAINER === */
#sidenav .dropdown-container {
    background: rgba(0, 0, 0, 0.1);
    margin: 0 8px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    animation: dropdownSlide 0.3s ease-out;
}

@keyframes dropdownSlide {
    0% { opacity: 0; max-height: 0; }
    100% { opacity: 1; max-height: 500px; }
}

#sidenav .dropdown-container a {
    color: rgba(255, 255, 255, 0.65) !important;
    padding: 8px 12px 8px 20px !important;
    font-size: 12.5px;
    border-radius: 6px;
    margin: 2px 6px;
    transition: all var(--transition-fast);
}

#sidenav .dropdown-container a:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    transform: translateX(6px);
}

#sidenav .dropdown-container a.active {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Dropdown arrow */
#sidenav .dropdown-btn i.fa-caret-down,
#sidenav .dropdown-btn i.fa-angle-down,
#sidenav .dropdown-btn i.fa-chevron-down {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.5) !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
    box-shadow: none !important;
    margin-left: auto;
    font-size: 10px !important;
    transition: transform var(--transition-normal);
}

#sidenav .dropdown-btn.active i.fa-caret-down,
#sidenav .dropdown-btn.active i.fa-angle-down,
#sidenav .dropdown-btn.active i.fa-chevron-down {
    transform: rotate(180deg);
    color: var(--accent) !important;
}

/* === MAIN CONTENT AREA === */
#main {
    margin-left: var(--sidebar-width) !important;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    transition: margin-left var(--transition-normal);
}

/* === TOP NAVIGATION BAR === */
.header-bar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-bar .header-title {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-bar .header-title i {
    color: var(--primary);
    font-size: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* === MODERN CARDS === */
.card {
    border-radius: var(--border-radius-lg) !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md) !important;
    transition: all var(--transition-normal) !important;
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg) !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
}

.card:hover::before {
    opacity: 0.8;
}

.card-header {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8), rgba(241, 245, 249, 0.8)) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6) !important;
    padding: 16px 20px !important;
    position: relative;
}

.card-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary);
    font-size: 16px;
}

.card-body {
    padding: 20px;
}

/* === STAT CARDS === */
.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.stat-card:hover::after {
    top: -30%;
    right: -30%;
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    transition: all var(--transition-bounce);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

.stat-card .stat-icon.primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat-card .stat-icon.success { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-card .stat-icon.warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-card .stat-icon.danger { background: linear-gradient(135deg, #ef4444, #f87171); }
.stat-card .stat-icon.info { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.stat-card .stat-icon.cyan { background: linear-gradient(135deg, #06b6d4, #22d3ee); }

.stat-card .stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* === MODERN BUTTONS === */
.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 13px;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, var(--info), #60a5fa);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* === MODERN TABLES === */
.table-container {
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    padding: 14px 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    color: var(--gray-700);
    transition: background var(--transition-fast);
}

.table tbody tr {
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* === BADGES === */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-primary { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }

/* === FORM CONTROLS === */
.form-control {
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    transition: all var(--transition-normal);
    background: #ffffff;
    color: var(--gray-700);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-control:hover {
    border-color: var(--gray-300);
}

.form-label {
    font-weight: 600;
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 6px;
    display: block;
}

/* === ALERTS === */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    border: none;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: alertSlide 0.4s ease-out;
}

@keyframes alertSlide {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.1));
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.1));
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
    color: var(--warning);
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(96, 165, 250, 0.1));
    color: var(--info);
    border-left: 4px solid var(--info);
}

/* === LOADING SPINNER === */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === FLOATING ACTION BUTTON === */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    transition: all var(--transition-bounce);
    z-index: 1000;
    border: none;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

/* === TOOLTIP === */
.tooltip-wrapper {
    position: relative;
}

.tooltip-wrapper::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: var(--gray-800);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
}

.tooltip-wrapper:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* === PROGRESS BAR === */
.progress {
    height: 8px;
    border-radius: 10px;
    background: var(--gray-200);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 1s ease-out;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* === NEXT-GEN MODERN ANIMATIONS SYSTEM === */
:root {
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth-out: cubic-bezier(0.16, 1, 0.3, 1);
  --snappy-in-out: cubic-bezier(0.85, 0, 0.15, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes modernScalePop {
    0% { opacity: 0; transform: scale(0.92) translateY(20px); filter: blur(4px); }
    60% { opacity: 1; transform: scale(1.01) translateY(-2px); filter: blur(0); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

@keyframes modernGlassGlimmer {
    0% { transform: translateX(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 0.6; }
    100% { transform: translateX(200%) rotate(45deg); opacity: 0; }
}

@keyframes modernFloatGlow {
    0%, 100% { transform: translateY(0px); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3); }
    50% { transform: translateY(-6px); box-shadow: 0 16px 35px rgba(99, 102, 241, 0.5); }
}

@keyframes modernModalSpring {
    0% { opacity: 0; transform: translateY(40px) scale(0.92); filter: blur(6px); }
    65% { opacity: 1; transform: translateY(-4px) scale(1.008); filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes modernBackdropFade {
    0% { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); }
    100% { opacity: 1; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}

/* Glassmorphic Cards & Stat Cards Next-Gen Hover Physics */
.card, .admin-card, .session-item, .stat-card, .glass-card, .modern-form-card {
    transition: transform 0.35s var(--smooth-out), 
                box-shadow 0.35s var(--smooth-out), 
                border-color 0.3s ease, 
                background 0.3s ease !important;
    will-change: transform, box-shadow;
}

.card:hover, .admin-card:hover, .session-item:hover, .stat-card:hover, .glass-card:hover {
    transform: translateY(-5px) scale(1.006) !important;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(99, 102, 241, 0.25) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
}

/* Interactive Buttons & Micro-Interactions */
.btn, .btn-hero, .btn-modern, .action-chip, .action-pill, .btn-filter-os, .session-actions a, .modern-action, .fab {
    transition: transform 0.25s var(--smooth-out), 
                box-shadow 0.25s var(--smooth-out), 
                background 0.25s ease, 
                border-color 0.25s ease !important;
    will-change: transform, box-shadow;
}

.btn:hover, .btn-hero:hover, .btn-modern:hover, .action-chip:hover, .action-pill:hover, .btn-filter-os:hover, .session-actions a:hover, .modern-action:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
}

.btn:active, .btn-hero:active, .btn-modern:active, .action-chip:active, .action-pill:active, .btn-filter-os:active, .session-actions a:active, .modern-action:active, .fab:active {
    transform: translateY(0) scale(0.98) !important;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.15) !important;
}

/* Inputs & Focus Glow */
.form-control, select.form-control {
    transition: border-color 0.25s ease, box-shadow 0.25s var(--smooth-out), transform 0.2s ease !important;
}

.form-control:focus, select.form-control:focus {
    transform: translateY(-2px) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18), 0 8px 20px rgba(99, 102, 241, 0.08) !important;
    border-color: #6366f1 !important;
}

/* Switches & Checkbox Spring Physics */
.switch-dot {
    transition: transform 0.35s var(--spring-bounce), background-color 0.25s ease !important;
}

input[type="checkbox"] {
    transition: transform 0.25s var(--spring-bounce), box-shadow 0.2s ease !important;
}

input[type="checkbox"]:checked {
    transform: scale(1.15) !important;
}

/* Modal Popup Next-Gen Blur & Spring */
#editAccessModal, #editRoleModal, .modal-modern {
    animation: modernBackdropFade 0.35s var(--smooth-out) both;
}

#editAccessModal > div, #editRoleModal > div, .modal-modern > div {
    animation: modernModalSpring 0.42s var(--smooth-out) both;
}

/* Animation classes */
.animate-fadeIn { animation: fadeIn 0.5s ease-out; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease-out; }
.animate-fadeInDown { animation: fadeInDown 0.5s ease-out; }
.animate-fadeInLeft { animation: fadeInLeft 0.5s ease-out; }
.animate-fadeInRight { animation: fadeInRight 0.5s ease-out; }
.animate-scaleIn { animation: scaleIn 0.4s ease-out; }
.animate-bounceIn { animation: bounceIn 0.6s ease-out; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* === GRID LAYOUT === */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* === FLEX UTILITIES === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }

/* === SPACING === */
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* === TEXT UTILITIES === */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-muted { color: var(--gray-500); }
.text-white { color: #ffffff; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.fs-18 { font-size: 18px; }
.fs-20 { font-size: 20px; }
.fs-24 { font-size: 24px; }

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* === GLASS MORPHISM CARD === */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

/* === NAVIGATION RIPPLE EFFECT === */
.nav-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to { transform: scale(4); opacity: 0; }
}

/* === SKELETON LOADING === */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === NOTIFICATION DOT === */
.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #ffffff;
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* === DARK MODE SUPPORT === */
html.dm-dark,
body.dm-dark {
    --light: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-700: #e2e8f0;
    --gray-800: #f8fafc;
}

/* === PRINT STYLES === */
@media print {
    #sidenav, .header-bar, .fab { display: none !important; }
    #main { margin-left: 0 !important; }
}
