/* Modern Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    --gradient-orange: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-red: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Gradient Backgrounds */
.gradient-primary { background: var(--gradient-primary); }
.gradient-blue { background: var(--gradient-blue); }
.gradient-green { background: var(--gradient-green); }
.gradient-purple { background: var(--gradient-purple); }
.gradient-orange { background: var(--gradient-orange); }
.gradient-red { background: var(--gradient-red); }

/* Gradient Text */
.gradient-text {
    /* Fallback so text remains visible if gradient text clipping is unavailable */
    color: #6d28d9;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .gradient-text {
        background: var(--gradient-primary);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Enhanced Cards */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Stat Card with Gradient Border */
.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.stat-card.gradient-blue { border-left-color: #3b82f6; }
.stat-card.gradient-green { border-left-color: #10b981; }
.stat-card.gradient-purple { border-left-color: #8b5cf6; }
.stat-card.gradient-orange { border-left-color: #f59e0b; }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

/* Professional Button Hover Effects */
button, .btn, a[class*="bg-"], a[class*="text-white"] {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

button:hover:not(:disabled):not(.password-toggle), .btn:hover, a[class*="bg-"]:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Password toggle button - prevent movement on hover */
button.password-toggle,
button.password-toggle:hover,
button.password-toggle:focus,
button.password-toggle:active {
    transform: none !important;
    box-shadow: none !important;
}

button:active:not(:disabled), .btn:active, a[class*="bg-"]:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Link Hover Effects */
a.text-blue-600:hover, a.text-purple-600:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Table Row Hover - Purple to Blue Gradient */
tr.hover\:bg-gray-50, tr[class*="hover:bg-gray"] {
    transition: all 0.2s ease-in-out;
}

tr.hover\:bg-gradient-to-r:hover {
    background: linear-gradient(to right, rgb(250 245 255), rgb(239 246 255)) !important;
}

/* Card Hover for Dashboard */
.bg-white.rounded-lg.shadow-md {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-white.rounded-lg.shadow-md:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Input Focus Effects */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
}

/* Form Field Hover */
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) {
    border-color: #d1d5db;
    background-color: #fafafa;
}

/* Badge Hover Effect */
.grade-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.grade-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Navigation Link Effect */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Student/Subject Card Hover */
.student-card, .subject-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.student-card:hover, .subject-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.12);
    border-color: rgba(139, 92, 246, 0.2);
}

/* Statistics Card Hover */
.bg-white.rounded-lg.shadow-md.p-4 {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-white.rounded-lg.shadow-md.p-4:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Filter Section Hover Effect */
.glass-effect.rounded-xl {
    transition: all 0.3s ease;
}

.glass-effect.rounded-xl:hover {
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Professional Shadow on Focus */
*:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.5);
    outline-offset: 2px;
}

/* Mobile Menu Styles */
.mobile-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Mobile menu animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu:not(.hidden) {
    animation: slideDown 0.2s ease-out;
}

/* Mobile Menu Slide-in Panel */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 60;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
}

.mobile-menu-overlay:not(.hidden) {
    display: block;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 70;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    border-left: 1px solid rgba(139, 92, 246, 0.1);
    display: none;
}

.mobile-menu-panel.open {
    transform: translateX(0);
}

/* Mobile menu scrolling containment */
.mobile-menu-panel .overflow-y-auto {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.mobile-menu-panel .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
}

.mobile-menu-panel .overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-menu-panel .overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 2px;
}

.mobile-menu-panel .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

@media (max-width: 1023px) {
    .mobile-menu-panel {
        display: flex;
    }
    .mobile-menu-overlay {
        display: none;
    }
    .mobile-menu-overlay:not(.hidden) {
        display: block;
    }
}

/* Hide elements on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
    
    /* Smaller page titles on mobile */
    h1.text-2xl {
        font-size: 1.25rem !important;
        line-height: 1.75rem !important;
    }
}
