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

:root {
    --color-primary: #4f46e5;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #f43f5e;
}

* {
    font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
}

body {
    direction: rtl;
    background-color: #f8fafc;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Sidebar */
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #c7d2fe;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.sidebar-nav-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav-item.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.8), rgba(79,70,229,0.6));
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

/* Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

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

/* Timer animation */
@keyframes pulse-urgent {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.timer-urgent {
    animation: pulse-urgent 0.8s ease-in-out infinite;
}

/* Exam question card */
.question-card {
    background: white;
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* Answer options */
.answer-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.answer-option:hover:not(.disabled) {
    border-color: #818cf8;
    background: #eef2ff;
}

.answer-option.selected {
    border-color: #4f46e5;
    background: #eef2ff;
}

.answer-option.correct {
    border-color: #22c55e;
    background: #f0fdf4;
}

.answer-option.wrong {
    border-color: #f43f5e;
    background: #fff1f2;
}

.answer-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Gradient button */
.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 0.625rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,70,229,0.4);
}

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

/* Table styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background: #f8fafc;
    padding: 0.875rem 1rem;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.data-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Progress bar */
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 1.25rem;
    padding: 2rem;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    animation: modal-enter 0.3s ease;
}

@keyframes modal-enter {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Sidebar gradient */
.sidebar-gradient {
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 40%, #1e1b4b 100%);
}

/* Axis color dots */
.axis-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Session calendar */
.calendar-cell {
    min-height: 80px;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    transition: background 0.2s;
}

.calendar-cell:hover {
    background: #f8fafc;
}

.session-chip {
    display: block;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Floating animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* RTL form inputs */
input, select, textarea {
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    font-size: 0.9rem;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    text-align: right;
}

.form-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
}

/* Page header */
.page-header {
    padding: 1.5rem 1.5rem 0;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e1b4b;
}

.page-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Responsive sidebar */
@media (max-width: 768px) {
    .sidebar-mobile-hidden {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    .sidebar-mobile-visible {
        transform: translateX(0);
    }
}
