/* Modern Teacher Dashboard CSS Variables & Reset */
:root {
    --primary: #4e73df;
    --primary-dark: #224abe;
    --secondary: #858796;
    --success: #1cc88a;
    --info: #36b9cc;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --light: #f8f9fc;
    --dark: #5a5c69;
    
    /* Modern Palette */
    --accent: #6366f1;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.teacher-dashboard-modern {
    background-color: #f0f2f5;
    font-family: var(--font-main);
    color: var(--dark);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html, body, input, button, select, textarea {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, svg, video, canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: optimizeQuality;
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
}

/* Dashboard Header & Banner */
.welcome-banner {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 20px;
    padding: 30px;
    color: white;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.welcome-banner h2 {
    font-weight: 700;
    margin-bottom: 10px;
}

.welcome-banner p {
    opacity: 0.9;
    margin-bottom: 0;
}

/* Stats Widgets */
.stat-widget {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-info .stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-info .stat-label {
    font-size: 13px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick Sections & Tables */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--accent);
}

/* Custom Table Styles */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.modern-table thead th {
    background: transparent;
    border: none;
    color: var(--secondary);
    font-size: 12px;
    text-transform: uppercase;
    padding: 10px 20px;
}

.modern-table tbody tr {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.modern-table tbody tr:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    background: #fbfbfb;
}

.modern-table tbody td {
    padding: 15px 20px;
    border: none;
}

.modern-table tbody td:first-child {
    border-radius: 12px 0 0 12px;
}

.modern-table tbody td:last-child {
    border-radius: 0 12px 12px 0;
}

/* Attendance Badges */
.badge-attendance {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-present { background: #d1fae5; color: #065f46; }
.badge-absent { background: #fee2e2; color: #991b1b; }
.badge-late { background: #fef3c7; color: #92400e; }

/* Micro-animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeIn 0.5s ease forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* =====================================================
   Bootstrap 4 Compatibility Shims
   (gap-*, x-small, flex utilities not in BS4)
   ===================================================== */

/* Gap utilities (Bootstrap 5 feature, polyfilled here) */
.gap-2 > * + * { margin-left: 0.5rem; }
.gap-3 > * + * { margin-left: 1rem; }
.gap-4 > * + * { margin-left: 1.5rem; }

.gap-2.flex-column > * + * { margin-left: 0; margin-top: 0.5rem; }
.gap-3.flex-column > * + * { margin-left: 0; margin-top: 1rem; }

/* x-small text */
.x-small {
    font-size: 0.72rem;
    line-height: 1.3;
}

/* Hover pointer */
.hover-pointer { cursor: pointer; }

/* flex-grow compat */
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

/* Attendance button group active state */
.attendance-btn-group .btn.active {
    box-shadow: none;
}
.attendance-btn-group .btn-outline-success.active {
    background-color: #1cc88a;
    color: #fff;
}
.attendance-btn-group .btn-outline-danger.active {
    background-color: #e74a3b;
    color: #fff;
}
.attendance-btn-group .btn-outline-warning.active {
    background-color: #f6c23e;
    color: #fff;
}

/* Class cards stream badge */
.stream-badge {
    display: inline-block;
    font-size: 11px;
    opacity: 0.8;
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    margin-top: 4px;
}

/* Chat bubbles */
.chat-bubble-in {
    background: #fff;
    border-radius: 0 12px 12px 12px;
    padding: 10px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    max-width: 75%;
    display: inline-block;
}
.chat-bubble-out {
    background: var(--accent, #6366f1);
    color: #fff;
    border-radius: 12px 0 12px 12px;
    padding: 10px 14px;
    max-width: 75%;
    display: inline-block;
}

/* Exam card mini buttons */
.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    line-height: 1.5;
}

/* Line clamp for descriptions */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
