/* Custom CSS for Educationali Platform - Optimized */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --transition: all 0.3s ease;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --line-height: 1.6;
    --spacing: 1rem;
}

body {
    padding-top: 64px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%, 75% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-delay {
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.fade-in-delay-2 {
    animation: fadeIn 1s ease-out 0.4s both;
}

.slide-in {
    animation: slideIn 0.6s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #131e32 0%, #410280 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-image {
    transition: transform 0.3s ease;
}

.hero-image:hover {
    transform: scale(1.05);
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
    will-change: transform;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.1) !important;
}

/* Step Numbers */
.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 12px 24px;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

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

.card-hover-effect:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.is-invalid {
    animation: shake 0.5s ease-in-out;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--primary-color);
}

/* PWA Specific Styles */
.pwa-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 2rem 0;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-bottom: 1rem;
}

.demo-video {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.demo-video:hover {
    transform: scale(1.02);
}

.teacher-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.teacher-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.rating {
    color: #ffc107;
}

.rating-interactive {
    cursor: pointer;
}

/* Admin Panel Styles */
.admin-sidebar {
    background: var(--dark-color);
    min-height: calc(100vh - 76px);
    color: white;
}

.admin-sidebar .nav-link {
    color: #ccc;
    padding: 12px 12px;
    border-radius: 6px;
    margin: 2px 10px;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .btn-lg {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Alert Animations */
.alert {
    border-radius: var(--border-radius);
    border: none;
    animation: slideIn 0.3s ease-out;
}

.alert.fade-out {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
    border-radius: 8px;
    border: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

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

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.border-radius-lg {
    border-radius: 12px;
}

.cursor-pointer {
    cursor: pointer;
}

/* Test Series Specific Styles */
.test-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.test-card.featured {
    border: 2px solid var(--primary-color);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.question-nav-btn {
    width: 40px;
    height: 40px;
    margin: 2px;
}

.question-container {
    min-height: 500px;
}

.question-content-area {
    min-height: 400px;
}

.test-timer {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
}

.test-timer.warning {
    color: #ffc107 !important;
    animation: pulse 1s infinite;
}

.test-timer.danger {
    color: #dc3545 !important;
    animation: pulse 0.5s infinite;
}

/* Test Taking Interface Styles */
.test-interface {
    background: #f8f9fa;
    min-height: 100vh;
}

.question-sidebar {
    background: white;
    border-right: 1px solid #dee2e6;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
}

.question-content {
    background: white;
    min-height: calc(100vh - 76px);
}

.question-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 8px;
}

.question-nav-btn {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.question-nav-btn.answered {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.question-nav-btn.current {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.question-nav-btn.not-visited {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.question-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.question-nav-btn.marked-for-review {
    border: 3px solid #ffc107;
}

.question-nav-btn.marked-for-review.answered {
    background-color: var(--success-color);
    border-color: #ffc107;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.option-card {
    transition: all 0.2s ease;
    cursor: pointer;
}

.option-card:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

.option-card.selected {
    background-color: #e3f2fd;
    border-color: var(--primary-color);
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.form-check-label:hover {
    background-color: #f8f9fa;
}

/* Test Result Styles */
.performance-chart {
    max-width: 300px;
    margin: 0 auto;
}

/* Teacher Test Management Styles */
.test-management-header {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.question-preview {
    max-height: 200px;
    overflow-y: auto;
}

/* Mobile Responsiveness for Test Interface */
@media (max-width: 768px) {
    .question-sidebar {
        position: fixed;
        top: 76px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 76px);
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .question-sidebar.show {
        left: 0;
    }
    
    .question-nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }
    
    .question-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }
    
    .test-timer {
        font-size: 1rem;
    }
}

/* Print Styles for Test Results */
@media print {
    .navbar,
    .footer,
    .btn,
    .modal {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .pwa-header {
        background: none !important;
        color: #000 !important;
    }
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.stats-card.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
}

.stats-card.bg-success {
    background: linear-gradient(135deg, var(--success-color), #1e7e34);
    color: white;
}

.stats-card.bg-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
    color: white;
}

.stats-card.bg-info {
    background: linear-gradient(135deg, var(--info-color), #138496);
    color: white;
}

.btn-purple {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
    color: white;
    border: none;
}

.btn-purple:hover {
    background: linear-gradient(135deg, #5a2d91, #d91a72);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

.stats-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stats-card p {
    margin-bottom: 0;
    opacity: 0.9;
}

.stats-card:active {
    transform: translateY(-3px);
}

/* Test Taking Interface */
.test-interface {
    background: #f8f9fa;
    min-height: 100vh;
}

.question-sidebar {
    background: white;
    border-right: 1px solid #dee2e6;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
}

.question-content {
    background: white;
    padding: 2rem;
}

.question-actions {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

.question-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 8px;
}

.question-nav-btn {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.question-nav-btn.answered {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.question-nav-btn.current {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.question-nav-btn.not-visited {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.question-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.question-nav-btn.marked-for-review {
    border: 3px solid #ffc107;
}

.question-nav-btn.marked-for-review.answered {
    background-color: var(--success-color);
    border-color: #ffc107;
}

/* Activity Feed */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background-color: #f8f9fa;
}

.activity-item:last-child {
    border-bottom: none;
}

.rating {
    color: #ffc107;
}

.rating i {
    font-size: 0.9rem;
}

.option-card {
    transition: all 0.2s ease;
}

.option-card:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

.option-card.selected {
    background-color: #e3f2fd;
    border-color: var(--primary-color);
}

/* Test Interface Enhancements */
.test-interface {
    background: #f8f9fa;
    min-height: 100vh;
}

.question-sidebar {
    background: white;
    border-right: 1px solid #dee2e6;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
}

.question-content {
    background: white;
    min-height: calc(100vh - 76px);
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.form-check-label:hover {
    background-color: #f8f9fa;
}

/* Test Card Enhancements */
.test-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.test-card.featured {
    border: 2px solid var(--primary-color);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

/* Timer Styles */
.test-timer {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
}

.test-timer.warning {
    color: #ffc107 !important;
    animation: pulse 1s infinite;
}

.test-timer.danger {
    color: #dc3545 !important;
    animation: pulse 0.5s infinite;
}

/* Question Navigation Legend */
.question-nav-legend {
    font-size: 0.8rem;
    margin-top: 1rem;
}

.question-nav-legend .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.question-nav-legend .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .bg-light {
        background-color: #2c3e50 !important;
        color: white;
    }
    
    .card {
        background-color: #34495e;
        color: white;
    }
    
    .form-control {
        background-color: #34495e;
        border-color: #495057;
        color: white;
    }
}

/* Enhanced Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

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

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .modal {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* Live Class Styles */
.live-class-interface {
    background: #000;
    color: white;
}

.video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 1rem;
    color: white;
}

.control-bar {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.participant-video {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* Calendar Styles */
.fc-event {
    border-radius: 4px;
    border: none;
    padding: 2px 4px;
}

.fc-event-title {
    font-weight: 500;
}

.fc-daygrid-event {
    margin: 1px 0;
}

/* Language Selector Styles */
.language-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.language-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.language-card.selected {
    border-color: var(--primary-color);
    background-color: #f8f9fa;
}

/* RTL Support */
.rtl {
    direction: rtl;
}

.rtl .navbar-nav {
    margin-left: auto;
    margin-right: 0;
}

.rtl .text-end {
    text-align: right !important;
}

.rtl .text-start {
    text-align: left !important;
}

/* Teacher Browse Styles */
.teacher-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.demo-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-video-overlay:hover {
    opacity: 1;
}

/* Earnings Dashboard Styles */
.earnings-card {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.payout-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.payout-status.pending {
    background: #fff3cd;
    color: #856404;
}

.payout-status.processing {
    background: #cce5ff;
    color: #004085;
}

.payout-status.completed {
    background: #d4edda;
    color: #155724;
}

/* Event Calendar Styles */
.event-filter-bar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.event-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.event-type-class {
    background: #cce5ff;
    color: #004085;
}

.event-type-test {
    background: #d4edda;
    color: #155724;
}

.event-type-personal {
    background: #fff3cd;
    color: #856404;
}

.event-type-deadline {
    background: #f8d7da;
    color: #721c24;
}

/* Whiteboard Styles */
#whiteboard {
    border: 1px solid #ddd;
    cursor: crosshair;
    background: white;
}

.drawing-tools {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.tool-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-button.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Profile Management Styles */
.approval-status-card {
    border-left: 5px solid;
}

.approval-status-card.pending {
    border-left-color: #ffc107;
}

.approval-status-card.approved {
    border-left-color: #28a745;
}

.approval-status-card.rejected {
    border-left-color: #dc3545;
}

.demo-video-card {
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
}

.demo-video-card:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
}

.video-stats {
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    background: #f8f9fa;
    border-radius: 8px;
}

.video-stat {
    text-align: center;
}

.video-stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.video-stat-label {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .live-class-interface .col-lg-9 {
        order: 1;
    }
    
    .live-class-interface .col-lg-3 {
        order: 2;
        height: 300px;
    }
    
    .teacher-card .card-body {
        padding: 1rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

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