/* ============================================
   SCHOOL PORTAL - CUSTOM STYLES
   Organized and optimized CSS file
   ============================================ */

/* ============================================
   1. CSS VARIABLES
   ============================================ */
:root {
    /* Colors */
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --info-color: #4299e1;
    --dark-color: #2d3748;
    --light-color: #f7fafc;

    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 0px;
    --header-height: 65px;

    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 10px 40px rgba(102, 126, 234, 0.3);
}

/* ============================================
   2. BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   3. HEADER STYLES
   ============================================ */
.main-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    height: var(--header-height);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
}

.main-header .navbar {
    height: 100%;
    padding: 0 1rem;
    gap: 0.75rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: white !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin: 0;
}

.navbar-brand img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    white-space: nowrap;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1.1rem;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Header Right Section */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* Notification Button */
.notification-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--primary-color);
}

/* User Avatar */
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

/* User Dropdown Button */
.user-dropdown-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 6px 12px 6px 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.user-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.02);
}

.user-name-text {
    font-weight: 500;
    font-size: 0.9rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chevron-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.user-dropdown-btn[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

/* ============================================
   4. DROPDOWN MENUS
   ============================================ */
.dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: none;
    padding: 0.5rem;
    margin-top: 8px;
    min-width: 280px;
    max-height: 300px;
    overflow-y: auto;
}

/* Custom scrollbar for dropdowns */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Assignment card dropdowns */
.assignment-card .dropdown-menu {
    position: fixed;
    transform: none !important;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 0;
    min-width: 200px;
    z-index: 1021;
}

.dropdown-header {
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.dropdown-item {
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    padding-left: 1.5rem;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Notification Items */
.notification-dropdown {
    max-width: 360px;
    max-height: 500px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: linear-gradient(135deg, #667eea08, #764ba208);
    border-left: 3px solid var(--primary-color);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ============================================
   5. SIDEBAR STYLES
   ============================================ */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e2e8f0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1020;
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.08);
}

.sidebar.collapsed {
    transform: translateX(-100%);
    opacity: 0;
}

/* Mobile Overlay */
.sidebar-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1019;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea05, #764ba205);
}

.user-info .user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.user-details h6 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 1rem;
}

.user-details small {
    color: #64748b;
    text-transform: capitalize;
    font-size: 0.85rem;
}

/* Navigation Styles */
.sidebar-nav {
    padding: 1.5rem 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    padding: 0 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.08em;
}

.nav-item {
    margin: 0 1rem 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #4a5568;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: linear-gradient(135deg, #667eea10, #764ba210);
    color: var(--primary-color);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-link i {
    width: 22px;
    text-align: center;
    font-size: 1.15rem;
}

/* ============================================
   6. MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease;
}

/* Page Headers */
.page-header {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.page-header-modern {
    background: var(--primary-gradient);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.page-header-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
    position: relative;
    z-index: 1;
}

.page-header-modern .page-title {
    color: white;
}

.page-subtitle {
    color: #64748b;
    margin-top: 0.5rem;
}

/* Profile Header */
.profile-header {
    background: var(--primary-gradient);
    border-radius: 20px;
    padding: 2rem;
    color: white;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    border: 4px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.profile-avatar:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ============================================
   7. CARDS
   ============================================ */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem;
    font-weight: 600;
}

/* Modern Cards */
.modern-card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.modern-card .card-header {
    border: none;
    padding: 1.5rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.modern-card .card-body {
    padding: 1.5rem;
}

/* Gradient Card Headers */
.card-header-gradient-primary {
    background: var(--primary-gradient);
    color: white;
}

.card-header-gradient-success {
    background: var(--success-gradient);
    color: white;
}

.card-header-gradient-warning {
    background: var(--warning-gradient);
    color: white;
}

.card-header-gradient-info {
    background: var(--info-gradient);
    color: white;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Statistics Box */
.stat-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-box:hover::before {
    opacity: 1;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Assignment Cards */
.assignment-card {
    border: none;
    border-radius: 12px;
    border-left: 4px solid;
    transition: all 0.3s ease;
    background: white;
    box-shadow: var(--shadow-sm);
}

.assignment-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   8. BUTTONS
   ============================================ */
.btn {
    border-radius: 10px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

/* Modern Buttons */
.btn-modern {
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-gradient-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-gradient-primary:hover {
    color: white;
}

.btn-gradient-success {
    background: var(--success-gradient);
    color: white;
}

.btn-gradient-success:hover {
    color: white;
}

/* Action Button Group */
.action-btn-group .btn {
    border-radius: 10px;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.action-btn-group .btn:hover {
    transform: translateY(-3px);
}

/* Action Buttons in Tables */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-buttons .btn {
    transition: all 0.3s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
}

/* ============================================
   9. FORMS
   ============================================ */
.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid #e0e6ed;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Search Form */
.search-form {
    width: 100%;
}

.search-input-group {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0.25rem;
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input-group .form-control {
    font-size: 0.95rem;
    border: none;
    box-shadow: none;
}

.search-input-group .form-control::placeholder {
    color: #adb5bd;
}

/* ============================================
   10. TABLES
   ============================================ */
.table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: none;
    font-weight: 600;
    color: var(--dark-color);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-color: #e2e8f0;
}

/* Teachers Table */
.teachers-table {
    font-size: 0.9rem;
}

.teachers-table thead {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.teachers-table thead th {
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding: 1rem 0.75rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.teachers-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.teachers-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.03);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.teachers-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

/* Teacher Row Transitions */
.teacher-row {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.teacher-row:hover {
    transform: translateX(5px);
}

/* Teacher Avatar in Table */
.teacher-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

/* ============================================
   11. BADGES
   ============================================ */
.badge-modern {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ============================================
   12. ALERTS
   ============================================ */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, #48bb7815, #38a16915);
    color: #2f855a;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, #f5656515, #e5353515);
    color: #c53030;
    border-left: 4px solid var(--danger-color);
}

/* ============================================
   13. MODALS
   ============================================ */
.modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.modal-header .btn-close,
.btn-close-white {
    filter: brightness(0) invert(1);
}

/* Bulk Action Buttons in Modal */
.modal-body .btn {
    text-align: left;
    padding: 1rem;
    transition: all 0.3s ease;
}

.modal-body .btn:hover {
    transform: translateX(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.modal-body .btn i {
    font-size: 1.5rem;
}

/* Bulk Action Button Styles */
#bulkActionBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   14. SPECIAL COMPONENTS
   ============================================ */

/* Info Rows */
.info-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.info-row:hover {
    background: rgba(102, 126, 234, 0.03);
    padding-left: 0.5rem;
    border-radius: 8px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .col-7,
.info-row .col-5,
.info-row .col-sm-7,
.info-row .col-sm-5 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.info-row a {
    word-break: break-all;
}

/* Timeline Items */
.timeline-item {
    border-left: 3px solid;
    padding-left: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: currentColor;
}

.timeline-item:hover {
    padding-left: 2rem;
}

/* Empty State */
.empty-state {
    padding: 3rem;
    text-align: center;
    opacity: 0.7;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* ============================================
   15. UTILITY CLASSES
   ============================================ */

/* Text Utilities */
.text-gradient-primary {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Background Utilities */
.bg-gradient-primary {
    background: var(--primary-gradient);
}

.bg-gradient-success {
    background: var(--success-gradient);
}

.bg-gradient-warning {
    background: var(--warning-gradient);
}

.bg-gradient-info {
    background: var(--info-gradient);
}

/* ============================================
   16. ANIMATIONS
   ============================================ */

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

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

.stagger-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.stagger-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.stagger-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

.stagger-4 {
    animation-delay: 0.4s;
    opacity: 0;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}


.sidebar::-webkit-scrollbar,
.notification-dropdown::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.notification-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb,
.notification-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.notification-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}


/* Desktop Large Screens */
@media (max-width: 1200px) {
    .sidebar {
        transform: translateX(-100%);
        opacity: 0;
    }

    .sidebar.show {
        transform: translateX(0);
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .page-header-modern {
        padding: 1.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .teachers-table {
        font-size: 0.85rem;
    }

    .teachers-table td,
    .teachers-table th {
        padding: 0.75rem 0.5rem;
    }

    .teacher-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .main-header .navbar {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .sidebar-toggle {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .navbar-brand {
        font-size: 1rem;
        gap: 8px;
    }

    .navbar-brand img {
        height: 32px;
    }

    .brand-text {
        font-size: 0.9rem;
    }

    .notification-btn,
    .user-dropdown-btn {
        height: 38px;
    }

    .notification-btn {
        width: 38px;
    }

    .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .user-name-text {
        display: none;
    }

    .chevron-icon {
        display: none;
    }

    .user-dropdown-btn {
        padding: 6px;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .page-header {
        padding: 1.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .dropdown-menu {
        min-width: 260px;
        max-width: calc(100vw - 2rem);
    }

    .notification-dropdown {
        max-width: calc(100vw - 2rem);
    }

    .profile-header {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
    }

    .stat-box {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .action-btn-group .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state i {
        font-size: 3rem;
    }

    /* Make info rows stack vertically on mobile */
    .info-row .col-5,
    .info-row .col-7,
    .info-row .col-sm-5,
    .info-row .col-sm-7 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .info-row .col-5,
    .info-row .col-sm-5 {
        margin-bottom: 0.25rem;
        font-weight: 600;
    }

    .info-row .col-7,
    .info-row .col-sm-7 {
        padding-left: 1.5rem;
    }

    /* Adjust stat boxes for mobile */
    .stat-box {
        min-height: 120px;
    }

    /* Tables - Mobile Card View */
    .teachers-table thead {
        display: none;
    }

    .teachers-table,
    .teachers-table tbody,
    .teachers-table tr,
    .teachers-table td {
        display: block;
        width: 100%;
    }

    .teachers-table tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 12px;
        padding: 1rem;
        background: white;
    }

    .teachers-table td {
        text-align: left;
        padding: 0.5rem 0;
        border: none;
    }

    .teachers-table td:before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        width: 120px;
        color: #6c757d;
    }

    .action-buttons {
        flex-direction: row;
        justify-content: flex-start;
    }
}

/* Small Mobile Devices */
@media (max-width: 576px) {
    .main-header .navbar {
        padding: 0 0.5rem;
        gap: 0.25rem;
    }

    .sidebar-toggle {
        width: 36px;
        height: 36px;
    }

    .navbar-brand {
        gap: 6px;
    }

    .navbar-brand img {
        height: 28px;
    }

    .brand-text {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .notification-btn {
        width: 36px;
        height: 36px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    .main-content {
        padding: 1rem;
    }

    .dropdown-menu {
        min-width: 240px;
    }

    /* Stack info rows completely on small screens */
    .info-row {
        display: block !important;
    }

    .info-row>div {
        width: 100%;
        padding-left: 0 !important;
    }

    .info-row .col-5,
    .info-row .col-sm-5 {
        margin-bottom: 0.5rem;
    }

    /* Make stats full width on extra small screens */
    .stat-box .stat-number {
        font-size: 1.25rem;
    }

    .stat-box small {
        font-size: 0.75rem;
    }
}

/* Extra Small Devices */
@media (max-width: 400px) {
    .brand-text {
        display: none;
    }

    .header-actions {
        gap: 0.25rem;
    }
}


@media print {

    .main-header,
    .sidebar,
    .sidebar-overlay,
    .sidebar-toggle,
    .btn,
    .dropdown,
    .action-buttons {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        margin-top: 0;
        padding: 0;
    }

    .card,
    .modern-card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    body {
        background: white;
    }
}

@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }

    .card,
    .modern-card {
        border: 2px solid var(--dark-color);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here when needed */
}


hr {
    margin: 0.1rem 0;
}
