/* ========================================
   Spaced Repetition System (SRS) Styles
   ======================================== */

/* ===== SRS Toggle Button ===== */
.srs-mode-toggle {
    margin-top: 16px;
}

.srs-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 100px;
    color: #a78bfa;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.srs-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}

.srs-toggle-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border-color: transparent;
}

.srs-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    background: #ef4444;
    color: white;
    border-radius: 11px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

/* ===== SRS Dashboard ===== */
.srs-dashboard {
    margin: 20px 0;
    padding: 24px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.srs-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.srs-dash-header h3 {
    color: var(--white, #f1f5f9);
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.srs-dash-header h3 i {
    color: #8b5cf6;
}

.srs-dash-info {
    color: var(--gray, #64748b);
    cursor: help;
    font-size: 0.9rem;
}

/* Cards Grid */
.srs-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.srs-card-stat {
    padding: 16px 14px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    cursor: default;
    transition: all 0.2s ease;
}

.srs-card-stat:first-child,
.srs-card-stat:nth-child(2) {
    cursor: pointer;
}

.srs-card-stat:first-child:hover,
.srs-card-stat:nth-child(2):hover {
    transform: translateY(-3px);
}

.srs-card-stat i {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.7rem;
    opacity: 0.5;
}

.srs-due { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.15); }
.srs-new { background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.15); }
.srs-learning { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.15); }
.srs-mastered { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.15); }

.srs-due i { color: #ef4444; }
.srs-new i { color: #3b82f6; }
.srs-learning i { color: #f59e0b; }
.srs-mastered i { color: #10b981; }

.srs-card-num {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 4px;
}

.srs-due .srs-card-num { color: #ef4444; }
.srs-new .srs-card-num { color: #3b82f6; }
.srs-learning .srs-card-num { color: #f59e0b; }
.srs-mastered .srs-card-num { color: #10b981; }

.srs-card-label {
    color: var(--gray, #64748b);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Progress */
.srs-progress-section { margin-bottom: 18px; }

.srs-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--gray-light, #94a3b8);
}

.srs-progress-pct {
    font-weight: 800;
    color: #8b5cf6;
}

.srs-progress-bar {
    height: 8px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.srs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #10b981);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.srs-mini-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--gray, #64748b);
}

.srs-mini-stats i {
    margin-left: 4px;
}

.srs-mini-stats .fa-fire { color: #ef4444; }
.srs-mini-stats .fa-bolt { color: #f59e0b; }

/* Start Button */
.srs-start-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.srs-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

.srs-complete-msg {
    text-align: center;
    padding: 18px;
    color: #10b981;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.06);
    border-radius: 12px;
}

/* ===== SRS Rating Buttons ===== */
.srs-rating-prompt {
    padding: 20px 0;
}

.srs-rating-label {
    text-align: center;
    color: var(--gray-light, #94a3b8);
    font-size: 0.9rem;
    margin-bottom: 14px;
}

.srs-rating-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.srs-rate-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(30, 41, 59, 0.5);
}

.srs-rate-btn:hover { transform: translateY(-3px); }

.srs-rate-btn i { font-size: 1.1rem; }

.srs-rate-again {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.15);
}
.srs-rate-again:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.srs-rate-hard {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.15);
}
.srs-rate-hard:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.srs-rate-good {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.15);
}
.srs-rate-good:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.srs-rate-easy {
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.15);
}
.srs-rate-easy:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.srs-next-review {
    text-align: center;
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--gray, #64748b);
}

.srs-scheduled {
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 8px;
    color: #a5b4fc;
    display: inline-block;
}

/* ===== SRS Session Progress ===== */
.srs-session-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    color: var(--gray-light, #94a3b8);
    font-size: 0.85rem;
}

.srs-session-bar {
    flex: 1;
    height: 6px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.srs-session-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #6366f1);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.srs-exit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.srs-exit-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ===== Session Complete ===== */
.srs-session-complete {
    text-align: center;
    padding: 40px 20px;
}

.srs-complete-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.srs-session-complete h3 {
    color: var(--white, #f1f5f9);
    font-size: 1.2rem;
    margin-bottom: 24px;
}

.srs-complete-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.srs-cs-item { text-align: center; }

.srs-cs-num {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white, #f1f5f9);
    line-height: 1.1;
}

.srs-cs-label {
    font-size: 0.82rem;
    color: var(--gray, #64748b);
    margin-top: 4px;
}

/* ========================================
   LIGHT THEME
   ======================================== */
[data-theme="light"] .srs-toggle-btn {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(99, 102, 241, 0.05));
    color: #7c3aed;
}

[data-theme="light"] .srs-toggle-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
}

[data-theme="light"] .srs-dashboard {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(139, 92, 246, 0.1);
}

[data-theme="light"] .srs-card-stat {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .srs-due { border-color: rgba(239, 68, 68, 0.2); }
[data-theme="light"] .srs-new { border-color: rgba(59, 130, 246, 0.2); }
[data-theme="light"] .srs-learning { border-color: rgba(245, 158, 11, 0.2); }
[data-theme="light"] .srs-mastered { border-color: rgba(16, 185, 129, 0.2); }

[data-theme="light"] .srs-progress-bar {
    background: #e2e8f0;
}

[data-theme="light"] .srs-rate-btn {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .srs-session-bar {
    background: #e2e8f0;
}

[data-theme="light"] .srs-session-complete h3 {
    color: #1e293b;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 600px) {
    .srs-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .srs-card-num { font-size: 1.4rem; }

    .srs-rating-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .srs-session-progress {
        flex-wrap: wrap;
        font-size: 0.78rem;
    }

    .srs-complete-stats { gap: 20px; }
    .srs-cs-num { font-size: 1.5rem; }
}

/* ========================================
   PRINT
   ======================================== */
@media print {
    .srs-mode-toggle,
    .srs-dashboard,
    .srs-rating-prompt,
    .srs-session-progress { display: none !important; }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .srs-toggle-btn,
    .srs-rate-btn,
    .srs-start-btn,
    .srs-card-stat,
    .srs-progress-fill,
    .srs-session-fill {
        transition: none !important;
    }
}
