@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
    /* ألوان الشعار - Teal/Blue-Green */
    --primary-color: #2d7a7a;
    --primary-dark: #1a5f5f;
    --primary-light: #3a9a9a;
    --primary-lighter: #4db3b3;
    --secondary-color: #1e4d4d;
    --accent-color: #5cb3b3;
    
    /* خلفيات */
    --bg-dark: #f5f7fa;
    --bg-darker: #e8ecf1;
    --bg-surface: #ffffff;
    --bg-surface-dark: #f8f9fa;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #f5f7fa 100%);
    --bg-gradient-primary: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    
    /* نصوص */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #ffffff;
    --text-muted: #999999;
    
    /* حدود */
    --border-color: #e0e0e0;
    --border-light: rgba(45, 122, 122, 0.2);
    
    /* حالات */
    --success: #28a745;
    --warning: #ffc107;
    --error: #dc3545;
    --info: #17a2b8;
    
    /* ظلال */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.25);
    --shadow-primary: 0 4px 20px rgba(45, 122, 122, 0.3);
    --shadow-primary-lg: 0 8px 30px rgba(45, 122, 122, 0.4);
}

* {
    font-family: 'Tajawal', sans-serif;
    box-sizing: border-box;
}

html {
    font-family: 'Tajawal', sans-serif;
    direction: ltr; /* This moves scrollbar to right side */
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: 'Tajawal', sans-serif;
    direction: rtl; /* Content stays RTL */
    margin: 0;
    padding: 0;
    background: var(--bg-gradient);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Islamic Pattern Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.04;
    background-image: 
        radial-gradient(circle at 20% 30%, #2d7a7a 2px, transparent 2px),
        radial-gradient(circle at 80% 70%, #2d7a7a 2px, transparent 2px),
        radial-gradient(circle at 50% 50%, #2d7a7a 1px, transparent 1px),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(45, 122, 122, 0.1) 10px,
            rgba(45, 122, 122, 0.1) 20px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 10px,
            rgba(45, 122, 122, 0.1) 10px,
            rgba(45, 122, 122, 0.1) 20px
        ),
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 15px,
            rgba(45, 122, 122, 0.05) 15px,
            rgba(45, 122, 122, 0.05) 16px
        );
    background-size: 
        200px 200px,
        200px 200px,
        100px 100px,
        40px 40px,
        40px 40px,
        30px 30px;
    background-position: 
        0 0,
        100px 100px,
        50px 50px,
        0 0,
        0 0,
        0 0;
    animation: patternMove 30s linear infinite;
}

@keyframes patternMove {
    0% {
        background-position: 
            0 0,
            100px 100px,
            50px 50px,
            0 0,
            0 0,
            0 0;
    }
    100% {
        background-position: 
            200px 200px,
            300px 300px,
            150px 150px,
            40px 40px,
            -40px -40px,
            30px 30px;
    }
}

/* Navbar Styles */
.navbar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%) !important;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, transparent, var(--primary-color), var(--primary-light), var(--primary-color), transparent) 1;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 0 30px rgba(45, 122, 122, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 0.75rem 0;
    backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--primary-color) 20%, 
        var(--primary-light) 50%, 
        var(--primary-color) 80%, 
        transparent
    );
    animation: shimmer 3s linear infinite;
}

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

.navbar-brand {
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.navbar-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(45, 122, 122, 0.2), transparent);
    transition: left 0.5s ease;
}

.navbar-brand:hover::before {
    left: 100%;
}

.navbar-brand:hover {
    color: var(--primary-dark) !important;
    transform: scale(1.05);
    background: rgba(45, 122, 122, 0.08);
}

.navbar-brand .logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.navbar-brand .logo-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 15px rgba(45, 122, 122, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.navbar-brand .logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
    50% { transform: translate(25%, 25%) scale(1.2); opacity: 1; }
}

.navbar-brand .logo-icon img,
.navbar-brand .logo-icon svg {
    width: 100%;
    height: 100%;
    padding: 8px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.navbar-brand .logo-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(45, 122, 122, 0.2);
    letter-spacing: 0.5px;
}

.nav-link {
    color: rgba(26, 26, 26, 0.85) !important;
    font-weight: 600;
    padding: 0.65rem 1.25rem !important;
    border-radius: 10px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0 0.3rem;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: translateX(-50%);
    transition: width 0.4s ease;
    border-radius: 3px 3px 0 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(45, 122, 122, 0.1) 0%, rgba(58, 154, 154, 0.15) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 10px;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-3px);
    box-shadow: 
        0 4px 12px rgba(45, 122, 122, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    background: rgba(45, 122, 122, 0.08);
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link:hover::after {
    opacity: 1;
}

.nav-link.active {
    color: var(--primary-color) !important;
    background: linear-gradient(135deg, rgba(45, 122, 122, 0.15) 0%, rgba(58, 154, 154, 0.2) 100%);
    box-shadow: 
        0 4px 15px rgba(45, 122, 122, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-link.active::before {
    width: 100%;
}

.nav-link i {
    margin-left: 0.5rem;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-link:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* Library filter tabs (Student) – pill style, scoped to avoid navbar */
.library-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border: none;
    background: transparent;
}

.library-filter-tabs .nav-item {
    margin: 0;
}

.library-filter-tabs .nav-link {
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.library-filter-tabs .nav-link::before,
.library-filter-tabs .nav-link::after {
    display: none;
}

.library-filter-tabs .nav-link:hover {
    color: var(--primary-color);
    background: rgba(45, 122, 122, 0.08);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 122, 122, 0.15);
}

.library-filter-tabs .nav-link.active {
    color: var(--text-light) !important;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    border-color: transparent;
    box-shadow: var(--shadow-primary);
}

.library-filter-tabs .nav-link.active::before {
    display: none;
}

.library-filter-tabs .nav-link i {
    font-size: 1rem;
    margin-left: 0.25rem;
}

.dropdown-menu {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(45, 122, 122, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 0.75rem;
    margin-top: 0.75rem;
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.dropdown-item {
    color: rgba(26, 26, 26, 0.9);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 0.25rem;
    position: relative;
    overflow: hidden;
    font-weight: 500;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(45, 122, 122, 0.1) 0%, rgba(58, 154, 154, 0.15) 100%);
    color: var(--primary-color);
    transform: translateX(-8px);
    padding-right: 1.5rem;
    box-shadow: 
        -4px 0 10px rgba(45, 122, 122, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dropdown-item:hover::before {
    transform: scaleY(1);
}

.dropdown-item i {
    margin-left: 0.75rem;
    transition: transform 0.3s ease;
}

.dropdown-item:hover i {
    transform: scale(1.3) rotate(-5deg);
}

/* Main Container */
.main-container {
    flex: 1;
    background: var(--bg-gradient);
    padding: 2rem 0;
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 200px);
}

.main-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(45, 122, 122, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(45, 122, 122, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(58, 154, 154, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundPulse 8s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.main-container > * {
    position: relative;
    z-index: 1;
}

/* Page Header */
.page-header {
    background: var(--bg-gradient-primary);
    color: white;
    padding: 3.5rem 2rem;
    margin: -2rem -15px 2.5rem -15px;
    border-radius: 0 0 40px 40px;
    box-shadow: 
        var(--shadow-primary-lg),
        0 0 60px rgba(45, 122, 122, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.page-header h1 {
    margin: 0;
    font-weight: 800;
    font-size: 2.5rem;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.95;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

/* Cards */
.card-modern {
    background: var(--bg-surface);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--bg-gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.card-modern:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-primary-lg);
}

.card-modern:hover::before {
    transform: scaleX(1);
}

.stat-card {
    background: var(--bg-gradient-primary);
    color: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-primary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.stat-card::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%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: var(--shadow-primary-lg);
    border-color: rgba(255, 255, 255, 0.3);
}

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

.stat-card h3 {
    margin: 0;
    font-size: 3rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-card p {
    margin: 0.5rem 0 0 0;
    opacity: 0.95;
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.stat-card .icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

/* Buttons */
.btn-primary {
    background: var(--bg-gradient-primary);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-primary);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary-lg);
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    padding: 0.5rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

/* Tables */
.table {
    background: var(--bg-surface);
    border-radius: 15px;
    overflow: hidden;
}

.table thead {
    background: var(--bg-gradient-primary);
    color: white;
}

.table thead th {
    border: none;
    padding: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr:hover {
    background: rgba(45, 122, 122, 0.05);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

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

/* Mobile Cards for Tables */
@media (max-width: 768px) {
    .table-responsive {
        display: none;
    }
    
    .table-cards {
        display: block;
    }
    
    .table-card {
        background: var(--bg-surface);
        border-radius: 15px;
        padding: 1.5rem;
        margin-bottom: 1rem;
        box-shadow: var(--shadow-md);
        border: 1px solid var(--border-light);
    }
    
    .table-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--primary-color);
    }
    
    .table-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .table-card-item {
        display: flex;
        flex-direction: column;
    }
    
    .table-card-label {
        font-size: 0.85rem;
        color: var(--text-secondary);
        margin-bottom: 0.25rem;
    }
    
    .table-card-value {
        font-weight: 600;
        color: var(--text-primary);
    }
    
    .table-card-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-light);
    }
}

@media (min-width: 769px) {
    .table-cards {
        display: none;
    }
}

/* Avatar */
.avatar-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.avatar-circle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

.bg-primary {
    background: var(--bg-gradient-primary) !important;
}

/* Search Box */
.search-box {
    border-radius: 25px;
    border: 2px solid var(--border-light);
    padding: 0.75rem 1.5rem;
    width: 100%;
    transition: all 0.3s ease;
    background: var(--bg-surface);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 122, 122, 0.1);
    transform: translateY(-2px);
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid var(--border-light);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: var(--bg-surface);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 122, 122, 0.1);
    outline: none;
}

/* Progress Bars */
.progress {
    height: 10px;
    border-radius: 10px;
    background: rgba(45, 122, 122, 0.1);
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Footer */
.footer {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
    color: rgba(26, 26, 26, 0.7);
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, transparent, var(--primary-color), var(--primary-light), var(--primary-color), transparent) 1;
    padding: 2.5rem 0;
    margin-top: auto;
    position: relative;
    box-shadow: 
        0 -4px 20px rgba(0, 0, 0, 0.08),
        0 0 30px rgba(45, 122, 122, 0.1);
    flex-shrink: 0;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--primary-color) 20%, 
        var(--primary-light) 50%, 
        var(--primary-color) 80%, 
        transparent
    );
    animation: shimmer 3s linear infinite reverse;
}

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

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

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

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

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

/* Navbar Toggler Enhancement */
.navbar-toggler {
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background: rgba(45, 122, 122, 0.2);
    box-shadow: 0 0 15px rgba(45, 122, 122, 0.4);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(45, 122, 122, 0.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2845, 122, 122, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Responsive */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .stat-card h3 {
        font-size: 2rem;
    }
    
    .card-modern {
        padding: 1.5rem;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
    
    .navbar-brand .logo-icon {
        width: 40px;
        height: 40px;
    }
}

/* Modal Styles */
.modal {
    z-index: 1055;
    pointer-events: auto;
}

.modal-backdrop {
    z-index: 1050;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    pointer-events: auto;
}

    .modal-backdrop.show {
        opacity: 0;
        pointer-events: auto;
        position: relative;
    }

.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(45, 122, 122, 0.2);
    overflow: hidden;
}

.modal-header {
    border-bottom: 2px solid rgba(45, 122, 122, 0.2);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    border-top: 2px solid rgba(45, 122, 122, 0.2);
    padding: 1.5rem;
}

.modal-dialog {
    margin: 1.75rem auto;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

/* User Cards on Home Page */
.user-card {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.user-card:hover {
    transform: translateY(-10px);
    box-shadow: 
        0 15px 40px rgba(45, 122, 122, 0.3),
        0 0 30px rgba(45, 122, 122, 0.2);
    border-color: var(--primary-color);
}

.user-icon {
    transition: all 0.3s ease;
}

.user-card:hover .user-icon {
    transform: scale(1.1) rotate(5deg);
}

.user-features {
    min-height: 150px;
}

.user-features ul {
    padding-right: 1rem;
}

/* Modal Form Styles */
.modal .form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal .form-control,
.modal .form-select {
    border: 2px solid var(--border-light);
    border-radius: 10px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

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

.modal .btn-close {
    opacity: 0.8;
    transition: all 0.3s ease;
}

.modal .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.modal .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Fix double scrollbar */
html {
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
}

body {
    overflow-x: hidden;
    overflow-y: hidden;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* إزالة scrollbar من الجداول - الاحتفاظ فقط بscrollbar المتصفح الأساسي */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.table-responsive::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Move scrollbar to right side in RTL */
/* The trick is to set html direction to ltr but body to rtl */
html[dir="rtl"] {
    direction: ltr; /* This moves scrollbar to right */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--primary-color) var(--bg-darker);
}

html[dir="rtl"] body {
    direction: rtl; /* Content stays RTL */
}

/* Style scrollbar on right side for WebKit browsers */
html[dir="rtl"]::-webkit-scrollbar {
    width: 8px;
}

html[dir="rtl"]::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

html[dir="rtl"]::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

html[dir="rtl"]::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    animation: shimmer 2s infinite;
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 1000px 100%;
}

/* Timeline Styles for Activity Feed */
.timeline {
    position: relative;
    padding-right: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-right: 60px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: 11px;
    top: 10px;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(45, 122, 122, 0.2);
    z-index: 2;
}

.timeline-icon {
    position: relative;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(45, 122, 122, 0.3);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(45, 122, 122, 0.4);
}

/* Alert Cards Enhancement */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.alert ul {
    list-style: none;
    padding-right: 0;
}

.alert ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.alert ul li:last-child {
    border-bottom: none;
}

/* Enhanced Stat Cards with Growth Indicators */
.stat-card small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.9;
}

.stat-card .bi-arrow-up {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Chart Container Enhancements */
.card-modern canvas {
    max-height: 400px;
}

/* Quick Actions Grid Enhancement */
.btn-outline-primary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-secondary {
    transition: all 0.3s ease;
    border-width: 2px;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover,
.btn-outline-warning:hover,
.btn-outline-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .timeline {
        padding-right: 15px;
    }
    
    .timeline::before {
        right: 15px;
    }
    
    .timeline-item {
        padding-right: 50px;
    }
    
    .timeline-item::before {
        right: 8px;
        width: 14px;
        height: 14px;
    }
    
    .timeline-icon {
        width: 35px !important;
        height: 35px !important;
    }
}

/* ========== Daily Tracking (Teacher) ========== */
.page-daily-tracking .daily-tracking-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-surface);
    box-shadow: var(--shadow-md);
}

.page-daily-tracking .daily-tracking-date-btn {
    white-space: nowrap;
    font-weight: 600;
}

.page-daily-tracking .card-modern.mb-3 {
    margin-bottom: 1.25rem !important;
}

.page-daily-tracking .daily-tracking-accordion {
    --bs-accordion-border-width: 0;
    --bs-accordion-btn-focus-box-shadow: none;
}

.page-daily-tracking .daily-tracking-accordion .accordion-item {
    background: transparent;
}

.page-daily-tracking .daily-tracking-accordion-btn {
    font-weight: 600;
    padding: 0.75rem 0;
    background: transparent !important;
    color: var(--text-primary);
    box-shadow: none !important;
}

.page-daily-tracking .daily-tracking-accordion-btn:not(.collapsed) {
    color: var(--primary-color);
    background: transparent !important;
}

.page-daily-tracking .daily-tracking-accordion-btn::after {
    margin-right: auto;
    margin-left: 0.5rem;
}

.page-daily-tracking .btn-save-tracking {
    min-width: 180px;
    font-weight: 700;
    box-shadow: var(--shadow-primary);
}

.page-daily-tracking .btn-save-tracking:hover {
    box-shadow: var(--shadow-primary-lg);
    transform: translateY(-2px);
}

@media (max-width: 767.98px) {
    .page-daily-tracking .daily-tracking-save-wrap {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0.75rem 1rem;
        margin: 0 -0.5rem -0.5rem -0.5rem !important;
        background: var(--bg-surface);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        z-index: 9;
    }
    .page-daily-tracking .daily-tracking-save-wrap .btn-save-tracking {
        width: 100%;
        min-width: unset;
    }
}
