/* ════════════════════════════════════════════════════════
   QURAN ACADEMY – COMPONENTS
   Reusable UI component styles
════════════════════════════════════════════════════════ */

/* ─── BUTTONS ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0 var(--sp-5);
    height: 42px;
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    outline: none;
    letter-spacing: 0.01em;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Ripple effect */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after { opacity: 1; }

/* Primary */
.btn-primary {
    background: var(--color-primary);
    color: var(--color-text-on-primary);
    box-shadow: var(--shadow-primary);
}

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

/* Accent / Gold */
.btn-accent {
    background: var(--color-accent);
    color: var(--color-text-on-accent);
    box-shadow: 0 4px 14px rgba(201, 162, 39, 0.3);
}

.btn-accent:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

/* Secondary */
.btn-secondary {
    background: var(--color-card);
    color: var(--color-text);
    border: 1.5px solid var(--color-border);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--color-card-hover);
    border-color: var(--color-text-muted);
}

/* Ghost */
.btn-ghost {
    background: none;
    color: var(--color-text-secondary);
    border: none;
}

.btn-ghost:hover {
    background: var(--color-border-light);
    color: var(--color-text);
}

/* Ghost Primary */
.btn-ghost-primary {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border: none;
}

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

/* Danger */
.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background: var(--color-error-dark);
}

/* Success */
.btn-success {
    background: var(--color-success);
    color: white;
}

/* Size variants */
.btn-xs { height: 28px; padding: 0 var(--sp-3); font-size: var(--text-xs); border-radius: var(--radius-lg); }
.btn-sm { height: 34px; padding: 0 var(--sp-4); font-size: var(--text-xs); border-radius: var(--radius-lg); }
.btn-lg { height: 52px; padding: 0 var(--sp-8); font-size: var(--text-base); border-radius: var(--radius-2xl); }
.btn-xl { height: 60px; padding: 0 var(--sp-10); font-size: var(--text-lg); border-radius: var(--radius-2xl); }
.btn-full { width: 100%; }

/* Icon-only */
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-lg);
}

.btn-icon-sm { width: 30px; height: 30px; border-radius: var(--radius-md); }
.btn-icon-lg { width: 48px; height: 48px; border-radius: var(--radius-xl); }

/* ─── CARDS ──────────────────────────────────────── */
.card {
    background: var(--color-card);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal),
                background var(--transition-slow);
    overflow: hidden;
}

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

.card-body {
    padding: var(--sp-5);
}

.card-header {
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
}

.card-footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--color-border);
    background: var(--color-border-light);
}

.card-title {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--color-text);
}

/* Gradient cards */
.card-gradient-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1a9b7a 100%);
    color: white;
    border: none;
}

.card-gradient-primary .card-title,
.card-gradient-primary p,
.card-gradient-primary span { color: rgba(255,255,255,0.9); }

.card-gradient-accent {
    background: linear-gradient(135deg, #c9a227 0%, #e8b84b 100%);
    color: #1a1200;
    border: none;
}

.card-gradient-dark {
    background: linear-gradient(135deg, #0a1628 0%, #0d3b2e 100%);
    color: white;
    border: none;
}

/* Stat card */
.stat-card {
    background: var(--color-card);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border);
    padding: var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-2);
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    color: var(--color-text);
    line-height: 1;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-medium);
}

.stat-change {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    display: flex;
    align-items: center;
    gap: var(--sp-1);
}

.stat-change.up { color: var(--color-success); }
.stat-change.down { color: var(--color-error); }

/* ─── FORM ELEMENTS ──────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.form-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text);
}

.form-label.required::after {
    content: ' *';
    color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: var(--text-base);
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    line-height: 1.5;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

.form-input.error { border-color: var(--color-error); }
.form-input.error:focus { box-shadow: 0 0 0 3px var(--color-error-light); }

.form-textarea { resize: vertical; min-height: 100px; }
.form-select { appearance: none; cursor: pointer; }

.form-hint {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--color-error);
    display: flex;
    align-items: center;
    gap: var(--sp-1);
}

/* Input with icon */
.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    inset-inline-start: var(--sp-4);
}

.input-wrapper .form-input {
    padding-inline-start: calc(var(--sp-4) + 24px + var(--sp-2));
}

.input-icon-end {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    inset-inline-end: var(--sp-4);
    color: var(--color-text-muted);
    cursor: pointer;
}

/* Checkbox / Radio */
.check-group {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    cursor: pointer;
}

.check-group input[type="checkbox"],
.check-group input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* ─── BADGES ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 2px var(--sp-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    white-space: nowrap;
}

.badge-primary    { background: var(--color-primary-light); color: var(--color-primary); }
.badge-accent     { background: var(--color-accent-light); color: var(--color-accent-hover); }
.badge-success    { background: var(--color-success-light); color: var(--color-success-dark); }
.badge-warning    { background: var(--color-warning-light); color: var(--color-warning-dark); }
.badge-error      { background: var(--color-error-light); color: var(--color-error-dark); }
.badge-info       { background: var(--color-info-light); color: var(--color-info-dark); }
.badge-neutral    { background: var(--color-border); color: var(--color-text-secondary); }

/* ─── PROGRESS BARS ──────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--color-primary), #1a9b7a);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.accent  { background: linear-gradient(90deg, var(--color-accent), #e8b84b); }
.progress-fill.success { background: var(--color-success); }
.progress-fill.warning { background: var(--color-warning); }
.progress-fill.info    { background: var(--color-info); }

.progress-bar-sm { height: 4px; }
.progress-bar-lg { height: 12px; }

/* ─── CIRCULAR PROGRESS ──────────────────────────── */
.progress-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-ring svg { transform: rotate(-90deg); }

.progress-ring-text {
    position: absolute;
    font-weight: var(--font-bold);
    color: var(--color-text);
}

/* ─── TABS ───────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--color-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    white-space: nowrap;
}

.tab-item:hover { color: var(--color-text-secondary); }

.tab-item.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Pill tabs (alternative style) */
.tabs-pill {
    display: flex;
    gap: var(--sp-2);
    padding: var(--sp-1);
    background: var(--color-border-light);
    border-radius: var(--radius-xl);
    flex-wrap: wrap;
    border: none;
}

.tabs-pill .tab-item {
    border-radius: var(--radius-lg);
    border-bottom: none;
    margin: 0;
    padding: var(--sp-2) var(--sp-4);
}

.tabs-pill .tab-item.active {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    border-bottom: none;
}

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── AVATAR ─────────────────────────────────────── */
.avatar {
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
}

.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-md { width: 40px; height: 40px; font-size: var(--text-sm); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-base); }
.avatar-xl { width: 72px; height: 72px; font-size: var(--text-xl); }
.avatar-2xl { width: 96px; height: 96px; font-size: var(--text-2xl); }

/* Avatar group */
.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    border: 2px solid var(--color-surface);
    margin-inline-start: -8px;
}

.avatar-group .avatar:first-child { margin-inline-start: 0; }

/* ─── TOAST NOTIFICATIONS ────────────────────────── */
.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
    animation: toastIn 0.3s var(--transition-spring);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 4px;
    height: 100%;
    border-radius: var(--radius-full);
}

.toast-success::before { background: var(--color-success); }
.toast-error::before   { background: var(--color-error); }
.toast-warning::before { background: var(--color-warning); }
.toast-info::before    { background: var(--color-info); }

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon   { color: var(--color-error); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info .toast-icon    { color: var(--color-info); }

.toast-content { flex: 1; }

.toast-title {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--color-text);
}

.toast-msg {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    margin-top: 2px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.toast-close:hover { color: var(--color-text); }

.toast.removing {
    animation: toastOut 0.25s ease forwards;
}

/* ─── NOTIFICATION ITEMS ─────────────────────────── */
.notif-item {
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-2);
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.notif-item:hover { background: var(--color-border-light); }

.notif-item.unread { position: relative; }

.notif-item.unread::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-text { flex: 1; }
.notif-title { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--color-text); }
.notif-desc  { font-size: var(--text-xs); color: var(--color-text-secondary); margin-top: 2px; }
.notif-time  { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 4px; }

/* ─── LISTS ──────────────────────────────────────── */
.list {
    display: flex;
    flex-direction: column;
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4) 0;
    border-bottom: 1px solid var(--color-border);
}

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

/* ─── EMPTY STATE ────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-16) var(--sp-8);
    text-align: center;
    gap: var(--sp-4);
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-2xl);
    background: var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}

.empty-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-text);
}

.empty-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    max-width: 320px;
}

/* ─── SKELETON LOADERS ───────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
        var(--color-border) 25%,
        var(--color-border-light) 50%,
        var(--color-border) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text-sm  { height: 14px; }
.skeleton-text     { height: 18px; }
.skeleton-text-lg  { height: 24px; }
.skeleton-card     { height: 120px; border-radius: var(--radius-2xl); }

/* ─── DIVIDERS ───────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--sp-4) 0;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    margin: var(--sp-4) 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* ─── AUDIO PLAYER ───────────────────────────────── */
.audio-player {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--color-card);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border);
}

.audio-play-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast), transform var(--transition-fast);
    box-shadow: var(--shadow-primary);
}

.audio-play-btn:hover {
    background: var(--color-primary-hover);
    transform: scale(1.05);
}

.audio-progress-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audio-track-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text);
}

.audio-time {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.audio-time-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    min-width: 36px;
}

.audio-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    outline: none;
}

.audio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* ─── COURSE CARDS ───────────────────────────────── */
.course-card {
    background: var(--color-card);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
}

.course-card-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.course-card-body {
    padding: var(--sp-4);
}

.course-card-title {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--color-text);
    margin-bottom: var(--sp-1);
}

.course-card-desc {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    line-height: 1.4;
    margin-bottom: var(--sp-3);
}

.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── LESSON ITEMS ───────────────────────────────── */
.lesson-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: background var(--transition-fast);
    border: 1px solid transparent;
}

.lesson-item:hover { background: var(--color-border-light); }
.lesson-item.active { background: var(--color-primary-light); border-color: var(--color-primary); }

.lesson-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lesson-item-content { flex: 1; min-width: 0; }

.lesson-item-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text);
    truncate: ellipsis;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lesson-item-meta {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* ─── QURAN VERSE CARD ───────────────────────────── */
.verse-card {
    background: linear-gradient(135deg, #0a1628 0%, #0d3b2e 100%);
    border-radius: var(--radius-2xl);
    padding: var(--sp-6);
    position: relative;
    overflow: hidden;
}

.verse-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a227' fill-opacity='0.05'%3E%3Cpath d='M30 0l8.66 15H21.34L30 0zm0 60l-8.66-15h17.32L30 60zM0 30l15-8.66v17.32L0 30zm60 0l-15 8.66V21.34L60 30z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.verse-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--sp-4);
}

.verse-arabic {
    font-family: var(--font-quran);
    font-size: 1.5rem;
    color: rgba(255,255,255,0.95);
    direction: rtl;
    text-align: center;
    line-height: 2.2;
    margin-bottom: var(--sp-4);
}

.verse-translation {
    font-size: var(--text-sm);
    color: rgba(255,255,255,0.65);
    text-align: center;
    font-style: italic;
    line-height: 1.6;
}

.verse-reference {
    font-size: var(--text-xs);
    color: var(--color-accent);
    text-align: center;
    margin-top: var(--sp-3);
    font-weight: var(--font-semibold);
}

/* ─── STREAK / MILESTONE CARD ────────────────────── */
.streak-badge {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: linear-gradient(135deg, #ff6b35, #ff8c55);
    border-radius: var(--radius-2xl);
    color: white;
}

.streak-flame { font-size: 2rem; }
.streak-number { font-size: var(--text-2xl); font-weight: var(--font-extrabold); }
.streak-label  { font-size: var(--text-xs); opacity: 0.85; }

/* ─── RESPONSIVE TABLE ───────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

thead { background: var(--color-border-light); }

th {
    padding: var(--sp-3) var(--sp-4);
    text-align: start;
    font-weight: var(--font-semibold);
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

td {
    padding: var(--sp-3) var(--sp-4);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-border-light); }

/* ─── CALENDAR ───────────────────────────────────── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-header {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    text-align: center;
    padding: var(--sp-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cal-day {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    font-weight: var(--font-medium);
}

.cal-day:hover { background: var(--color-border-light); }
.cal-day.today { background: var(--color-primary-light); color: var(--color-primary); font-weight: var(--font-bold); }
.cal-day.selected { background: var(--color-primary); color: white; }
.cal-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-accent);
}
.cal-day.other-month { color: var(--color-text-muted); opacity: 0.4; }
.cal-day.completed { background: var(--color-success-light); color: var(--color-success-dark); }

/* ─── LEVEL INDICATOR ────────────────────────────── */
.level-bar {
    display: flex;
    gap: 3px;
}

.level-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    transition: background var(--transition-fast);
}

.level-dot.filled { background: var(--color-primary); }
.level-dot.filled.accent { background: var(--color-accent); }

/* ─── SWITCH TOGGLE ──────────────────────────────── */
.switch {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    cursor: pointer;
}

.switch-track {
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.switch input { display: none; }

.switch input:checked + .switch-track {
    background: var(--color-primary);
}

.switch-track::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: var(--radius-full);
    top: 3px;
    inset-inline-start: 3px;
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-track::after {
    transform: translateX(20px);
}

[dir="rtl"] .switch input:checked + .switch-track::after {
    transform: translateX(-20px);
}

/* ─── QUIZ ELEMENTS ──────────────────────────────── */
.quiz-option {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-radius: var(--radius-xl);
    border: 2px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--text-base);
    background: var(--color-card);
}

.quiz-option:hover { border-color: var(--color-primary); background: var(--color-primary-lighter); }
.quiz-option.selected { border-color: var(--color-primary); background: var(--color-primary-light); }
.quiz-option.correct  { border-color: var(--color-success); background: var(--color-success-light); }
.quiz-option.incorrect { border-color: var(--color-error); background: var(--color-error-light); }

.quiz-option-letter {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    background: var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    flex-shrink: 0;
}

/* ─── ACHIEVEMENT BADGE ──────────────────────────── */
.achievement {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4);
    border-radius: var(--radius-2xl);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    text-align: center;
    transition: all var(--transition-normal);
}

.achievement:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }

.achievement-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.achievement-icon.locked {
    filter: grayscale(100%);
    opacity: 0.4;
}

.achievement-name {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--color-text);
}

.achievement-desc {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* ─── SECTION HEADERS ────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-4);
}

.section-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-text);
}

.section-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-top: 2px;
}

.see-all-btn {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.see-all-btn:hover { background: var(--color-primary-light); }

/* ─── PAGE HERO ──────────────────────────────────── */
.page-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1a9b7a 100%);
    padding: var(--sp-8) var(--page-padding);
    position: relative;
    overflow: hidden;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M30 0l8.66 15H21.34L30 0zm0 60l-8.66-15h17.32L30 60zM0 30l15-8.66v17.32L0 30zm60 0l-15 8.66V21.34L60 30z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.page-hero-content { position: relative; z-index: 1; }

.page-hero-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    color: white;
    margin-bottom: var(--sp-2);
}

.page-hero-subtitle {
    font-size: var(--text-base);
    color: rgba(255,255,255,0.75);
}
