/* ==================== */
/* TEEPportal MAIN CSS - FINAL VERSION */
/* Your colors WILL NOT change with system settings */
/* ==================== */

/* Base styles */
@import url('base.css');

/* Components */
@import url('components/sidebar.css');
@import url('components/buttons.css');
@import url('components/forms.css');
@import url('components/tables.css');
@import url('components/cards.css');
@import url('components/modals.css');
@import url('components/toast.css');

/* Modules */
@import url('modules/dashboard.css');
@import url('modules/marks.css');
@import url('modules/students.css');
@import url('modules/courses.css');
@import url('modules/centers.css');
@import url('modules/reports.css');
@import url('modules/settings.css');

/* ==================== */
/* ENHANCED COLOR VARIABLES - THESE WILL ALWAYS SHOW */
/* ==================== */
:root {
    /* Force light mode at the root level */
    color-scheme: light;
    
    /* Enhanced accent colors */
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;
    --accent-teal: #14b8a6;
    
    /* Gradient backgrounds */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
    
    /* Enhanced background colors */
    --bg-surface-light: linear-gradient(135deg, #ffffff 0%, #fafafc 100%);
    --bg-surface-elevated: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
    --bg-surface-subtle: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* ==================== */
/* FORCE LIGHT MODE - PREVENT SYSTEM DARK MODE */
/* ==================== */
/* This will override any system dark mode settings */
html, body {
    color-scheme: light !important;
}

/* Override dark mode media query completely */
@media (prefers-color-scheme: dark) {
    :root, html, body {
        color-scheme: light !important;
    }
    
    /* Force all your colors to stay the same */
    body {
        background: var(--bg-body) !important;
        color: var(--text-primary) !important;
    }
    
    .main-header,
    .sidebar,
    .content-section,
    .card,
    .modal-content,
    .table,
    .form-control,
    input,
    textarea,
    select {
        background-color: inherit !important;
        color: inherit !important;
        border-color: var(--border) !important;
    }
}

/* ==================== */
/* MAIN HEADER STYLES - ENHANCED */
/* ==================== */
.main-header {
    background: linear-gradient(to right, #ffffff 0%, #fafafc 100%);
    padding: 0 2rem;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid #e0e7ff;
    border-image: linear-gradient(to right, #3b82f6, #8b5cf6) 1;
}

/* Header gradient accent */
.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, 
        #3b82f6 0%, 
        #8b5cf6 33%, 
        #10b981 66%, 
        #f59e0b 100%
    );
}

/* ==================== */
/* SECTION HEADERS - ENHANCED */
/* ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--primary);
    border-image: linear-gradient(to bottom, var(--primary), var(--secondary)) 1;
}

.section-header h1,
.section-header h2 {
    margin: 0;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== */
/* FILTER BAR - ENHANCED */
/* ==================== */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--bg-surface-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    border: 2px solid #e0e7ff;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Filter bar decorative element */
.filter-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 220px;
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.filter-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.12);
    border-color: var(--primary-light);
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== */
/* LAYOUT GRIDS - ENHANCED */
/* ==================== */

/* Cards Grid with colored accents */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

/* Individual card color themes */
.card[data-card-type="stats"] {
    border-top: 4px solid var(--accent-blue);
}

.card[data-card-type="success"] {
    border-top: 4px solid var(--accent-green);
}

.card[data-card-type="warning"] {
    border-top: 4px solid var(--accent-orange);
}

.card[data-card-type="danger"] {
    border-top: 4px solid var(--accent-red);
}

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

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafafc 100%);
    border: 1px solid;
    border-image: linear-gradient(135deg, var(--primary-light), var(--secondary-light)) 1;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

.chart-container {
    background: var(--bg-surface-light);
    border: 2px solid #e0e7ff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, 
        var(--accent-blue) 0%,
        var(--accent-purple) 33%,
        var(--accent-green) 66%,
        var(--accent-orange) 100%
    );
}

/* ==================== */
/* LOADING STATES - ENHANCED */
/* ==================== */

/* Loading Spinner with gradient */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid;
    border-image: linear-gradient(135deg, var(--primary), var(--secondary)) 1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite, colorCycle 2s infinite alternate;
}

@keyframes colorCycle {
    0% { border-image-source: linear-gradient(135deg, #3b82f6, #8b5cf6); }
    50% { border-image-source: linear-gradient(135deg, #10b981, #14b8a6); }
    100% { border-image-source: linear-gradient(135deg, #f59e0b, #f97316); }
}

.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    width: 100%;
    background: linear-gradient(135deg, var(--bg-body) 0%, #f0f4ff 100%);
    border-radius: var(--radius-lg);
}

/* Loading Skeleton with shimmer */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f4ff 25%,
        #e0e7ff 50%,
        #f0f4ff 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== */
/* EMPTY STATES - ENHANCED */
/* ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--radius-xl);
    border: 3px dashed #c7d2fe;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.empty-state::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state-description {
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ==================== */
/* ACTION BAR - ENHANCED */
/* ==================== */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(to right, #ffffff 0%, #fafafc 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    border: 2px solid #e0e7ff;
    position: relative;
}

/* Action bar accent */
.action-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, 
        var(--accent-blue),
        var(--accent-purple),
        var(--accent-green)
    );
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==================== */
/* COLOR UTILITY CLASSES */
/* ==================== */
.text-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-success {
    background: linear-gradient(135deg, var(--success), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-warning {
    background: linear-gradient(135deg, var(--warning), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-danger {
    background: linear-gradient(135deg, var(--danger), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--accent-teal) 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--accent-orange) 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--accent-pink) 100%);
}

/* ==================== */
/* STATUS INDICATORS */
/* ==================== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
}

.status-indicator::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-active::before {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pending::before {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-inactive::before {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* ==================== */
/* RESPONSIVE DESIGN */
/* ==================== */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .main-header {
        padding: 0 1.5rem;
    }
    
    .section-header {
        padding: 1.5rem;
    }
}

@media (max-width: 992px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .action-bar {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid,
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        padding: 1.25rem;
    }
    
    .action-bar {
        flex-direction: column;
        gap: 1.25rem;
    }
    
    .main-header {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .empty-state {
        padding: 3rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .filter-bar {
        padding: 1.25rem;
    }
    
    .empty-state {
        padding: 2.5rem 1rem;
    }
    
    .empty-state-icon {
        font-size: 3rem;
    }
    
    .status-indicator {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* ==================== */
/* ANIMATIONS - ENHANCED */
/* ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.05);
    }
}

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

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

/* ==================== */
/* UTILITY CLASSES - ENHANCED */
/* ==================== */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.min-h-100 { min-height: 100vh !important; }

.gap-1 { gap: 0.5rem !important; }
.gap-2 { gap: 1rem !important; }
.gap-3 { gap: 1.5rem !important; }
.gap-4 { gap: 2rem !important; }
.gap-5 { gap: 2.5rem !important; }

.shadow-soft { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1) !important; }
.shadow-medium { box-shadow: 0 8px 30px rgba(15, 23, 42, 0.15) !important; }
.shadow-hard { box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2) !important; }

.rotate-45 { transform: rotate(45deg) !important; }
.rotate-90 { transform: rotate(90deg) !important; }
.rotate-180 { transform: rotate(180deg) !important; }

.opacity-25 { opacity: 0.25 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }

/* Hover effects */
.hover-lift:hover {
    transform: translateY(-4px);
    transition: transform var(--transition);
}

.hover-glow:hover {
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
    transition: box-shadow var(--transition);
}

.hover-color-shift:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white !important;
    transition: all var(--transition);
}

/* ==================== */
/* PRINT STYLES */
/* ==================== */
@media print {
    .main-header,
    .sidebar,
    .action-bar,
    .filter-bar,
    .btn:not(.print-only),
    .status-indicator::before {
        display: none !important;
    }
    
    .content-section {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    
    body {
        background: white !important;
    }
    
    * {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: white !important;
        color: black !important;
    }
    
    .text-gradient-primary,
    .text-gradient-success,
    .text-gradient-warning,
    .text-gradient-danger {
        -webkit-text-fill-color: black !important;
        color: black !important;
    }
}

/* ==================== */
/* ACCESSIBILITY ENHANCEMENTS */
/* ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner,
    .skeleton::after {
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary: #1d4ed8;
        --success: #059669;
        --warning: #b45309;
        --danger: #b91c1c;
    }
    
    .border {
        border-width: 2px !important;
    }
}

/* ==================== */
/* CRITICAL FIX: PREVENT ANY DARK MODE CHANGES */
/* ==================== */
/* This is the MOST IMPORTANT part - it completely blocks dark mode */
@media (prefers-color-scheme: dark) {
    /* Force ALL elements to use your light colors */
    * {
        background-color: inherit !important;
        color: inherit !important;
        border-color: inherit !important;
    }
    
    /* Force form elements to stay white */
    input, textarea, select {
        background-color: white !important;
        color: var(--text-primary) !important;
    }
    
    /* Force scrollbars to stay light */
    ::-webkit-scrollbar-track {
        background: var(--gray-100) !important;
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--gray-400) !important;
    }
}
