/* ================================================
   PROFILE PAGE — Almarai, RTL, purple-cyan palette
   ================================================ */

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

/* ── Variables ── */
:root {
    --grad-primary:     linear-gradient(90deg, #7b61ff, #3ec5ff);
    --grad-secondary:   linear-gradient(90deg, #4cd964, #28a745);
    --grad-warm:        linear-gradient(90deg, #ff9800, #ff5722);
    --grad-bg:          radial-gradient(circle at 10% 10%, #fff9e6 0%, #ffe6f2 25%, #e6f7ff 60%, #f0f8ff 100%);

    --purple:           #7b61ff;
    --purple-deep:      #4f33d6;
    --purple-light:     #f3f1ff;
    --cyan:             #3ec5ff;
    --green:            #28a745;
    --green-light:      #f0fff4;
    --orange:           #ff9800;
    --orange-light:     #fff8e8;
    --red:              #ff5252;
    --red-light:        #fff3f3;
    --yellow:           #ffd600;

    --text-dark:        #221f32;
    --text-mid:         #4d4d5e;
    --text-light:       #888;

    --border:           #e6e4f2;
    --border-dashed:    rgba(255, 182, 56, 0.55);

    --card-bg:          rgba(255, 255, 255, 0.95);
    --grad-card-bg:     linear-gradient(135deg, rgba(255,255,255,0.92) 0%, rgba(253,250,255,0.88) 100%);
    --shadow-card:      0 1px 2px rgba(40,28,90,0.04), 0 20px 50px -12px rgba(76, 49, 178, 0.18);
    --shadow-header:    0 6px 20px rgba(60, 30, 120, 0.15);
    --shadow-btn:       0 10px 24px rgba(65, 53, 118, 0.18);
    --shadow-modal:     0 32px 80px rgba(30, 20, 80, 0.22);

    --radius-card:      26px;
    --radius-btn:       30px;
    --radius-pill:      999px;
    --radius-inner:     18px;
}

/* ── DARK MODE ── */
html[data-theme="dark"] {
    --grad-bg:          radial-gradient(circle at 10% 10%, #2a1d55 0%, #1a0d3a 25%, #0d1f3a 60%, #0a0f2e 100%);
    
    --text-dark:        #f3f0ff;
    --text-mid:         #c8c3e0;
    --text-light:       #9690b8;

    --border:           rgba(255,255,255,0.10);
    --border-dashed:    rgba(123, 97, 255, 0.30);

    --card-bg:          rgba(30, 27, 55, 0.82);
    --grad-card-bg:     linear-gradient(135deg, rgba(30,27,55,0.82) 0%, rgba(38,32,70,0.78) 100%);
    --shadow-card:      0 1px 2px rgba(0,0,0,0.4), 0 24px 60px -16px rgba(0,0,0,0.55);
    --shadow-header:    0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-btn:       0 4px 10px rgba(123, 97, 255, 0.25), 0 12px 28px -6px rgba(123, 97, 255, 0.32);
    --shadow-modal:     0 32px 80px rgba(0, 0, 0, 0.65);

    --purple-light:     rgba(243, 241, 255, 0.12);
    --green-light:      rgba(47, 168, 106, 0.12);
    --orange-light:     rgba(255, 152, 0, 0.12);
    --red-light:        rgba(255, 82, 82, 0.12);
}

html[data-theme="dark"] .card { border-color: rgba(255,255,255,0.08); }

@media (prefers-color-scheme: dark) {
    html:not([data-theme]) {
        color-scheme: dark;
    }
}


/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a       { text-decoration: none; color: inherit; }
button  { cursor: pointer; font-family: inherit; border: none; }
img     { display: block; max-width: 100%; }

/* ── Base ── */
html, body {
    min-height: 100%;
    font-family: "Almarai", "Segoe UI", sans-serif;
    background: var(--grad-bg);
    background-attachment: fixed;
    color: var(--text-dark);
    direction: rtl;
    text-align: right;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ── */
::-webkit-scrollbar               { width: 10px; }
::-webkit-scrollbar-track         { background: var(--surface-soft, #f0eeff); }
::-webkit-scrollbar-thumb         { background: var(--border, #a297d6); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover   { background: var(--purple-deep, #3476d8); }

/* ================================================
   HEADER
   ================================================ */
.header {
    background: var(--grad-primary);
    color: white;
    padding: 22px 18px;
    text-align: center;
    box-shadow: var(--shadow-header);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-card);
    max-width: 98%;
    margin: 15px auto 0;
    align-self: center;
}
.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 20% 30%, rgba(255,255,255,0.18), transparent 40%),
      radial-gradient(circle at 80% 70%, rgba(255,255,255,0.10), transparent 40%);
    pointer-events: none;
}
.header::after {
    content: '';
    position: absolute;
    top: 0; left: -30%;
    width: 20%; height: 90%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transform: skewX(-20deg);
    animation: shine 4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes shine {
    0%, 100% { left: -30%; }
    50%      { left: 110%; }
}

.header-title {
    font-size: 45px;
    font-weight: 900;
    position: relative;
    z-index: 1;
    letter-spacing: -0.1px;
}
.header-subtitle {
    font-size: 20px;
    margin-top: 8px;
    font-weight: 800;
    position: relative;
    z-index: 1;
    text-align: center;
}

/* Brand */
.header-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    text-decoration: none;
    color: white;
}
.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    backdrop-filter: blur(6px);
    flex-shrink: 0;
}
.brand-text   { display: flex; flex-direction: column; gap: 1px; }
.brand-name   { font-size: 19px; font-weight: 800; line-height: 1; letter-spacing: -0.3px; }
.brand-tag    { font-size: 10.5px; font-weight: 400; opacity: 0.75; letter-spacing: 0.2px; }


.header-nav {
    gap: 10px;
    position: absolute;
    z-index: 1;
    left: 70px;              
    top: 50%;
    transform: translateY(-50%);
    align-items: center;
    justify-content: center;
    display: flex;           
}

.header-nav a {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    transition: background 0.2s;
    display: inline-flex;
    gap: 5px;
}
.header-nav a:hover       { background: rgba(255,255,255,0.15); color: white; }
.header-nav a.active      { background: rgba(255,255,255,0.22); color: white; }


/* زر الوضع الليلي */
.theme-toggle {
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    color: white;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    padding: 0;
    backdrop-filter: blur(6px);
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}
.theme-toggle:hover { background: rgba(255,255,255,0.30); transform: translateY(-50%) scale(1.08); }

/* ================================================
   PAGE CONTAINER
   ================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Shared card ── */
.card {
    background: var(--grad-card-bg);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 28px;
    position: relative;
    overflow: hidden;
    animation: card-rise 0.65s cubic-bezier(0.34,1.56,0.64,1) both;
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }
.card:nth-child(4) { animation-delay: 0.26s; }
.card:nth-child(5) { animation-delay: 0.33s; }
.card:nth-child(6) { animation-delay: 0.40s; }

.card::before {
    content: '';
    position: absolute;
    top: -80px; left: -80px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(123, 97, 255, 0.12), transparent 70%);
    pointer-events: none;
}
.card::after {
    content: '';
    position: absolute;
    bottom: -60px; right: -60px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(62, 197, 255, 0.12), transparent 70%);
    pointer-events: none;
}

@keyframes card-rise {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Shared section heading ── */
.section-heading {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Badge (matches app) ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    color: white;
}
.badge.orange { background: #ff9800; box-shadow: 0 4px 10px rgba(255,152,0,0.22); }
.badge.purple { background: var(--grad-primary); box-shadow: 0 4px 10px rgba(123,97,255,0.22); }
.badge.green  { background: var(--grad-secondary); box-shadow: 0 4px 10px rgba(40,167,69,0.22); }
.badge.red    { background: linear-gradient(90deg,#ff5252,#ff1744); box-shadow: 0 4px 10px rgba(255,82,82,0.22); }

/* ── Shared dashed box ── */
.dashed-box {
    border-radius: 20px;
    padding: 16px 20px;
    background: linear-gradient(90deg, #fff8e8, #fff3f3);
    border: 2px dashed var(--border-dashed);
}

/* ── Buttons ── */
.btn {
    cursor: pointer;
    border: none;
    border-radius: var(--radius-btn);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    font-family: "Almarai", sans-serif;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: var(--shadow-btn);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn.primary   { background: var(--grad-primary); color: white; }
.btn.secondary { background: var(--grad-secondary); color: white; }
.btn.warm      { background: var(--grad-warm); color: white; }
.btn.alt       { background: white; color: var(--text-mid); border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }

/* ================================================
   HERO — profile banner
   ================================================ */
.profile-hero {
    background: var(--grad-primary);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
    color: white;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    animation: card-rise 0.65s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* Shimmer overlay */
.profile-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -6%;
    width: 45%;
    height: 260%;
    background: rgba(255,255,255,0.07);
    transform: rotate(18deg);
    pointer-events: none;
}
.profile-hero::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}

.avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.5);
    object-fit: cover;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    overflow: hidden;
}

.avatar-emoji {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}

.avatar-level {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--orange);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}

.hero-info {
    flex: 1;
    min-width: 200px;
    position: relative;
    z-index: 1;
}

.hero-name {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1.1;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 14px;
    opacity: 0.92;
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.15);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    backdrop-filter: blur(4px);
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
    min-width: 180px;
}

.hero-stat-item {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-inner);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-stat-icon { font-size: 24px; }

.hero-stat-val  { font-size: 20px; font-weight: 800; line-height: 1; }
.hero-stat-lbl  { font-size: 11px; opacity: 0.8; margin-top: 2px; }

/* ================================================
   OVERALL PERFORMANCE CARD
   ================================================ */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.score-ring-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-radius: var(--radius-inner);
    border: 1px solid var(--border);
    background: #fdfcff;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}
.score-ring-wrap:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(123,97,255,0.10);
}

html[data-theme="dark"] .score-ring-wrap {
    background: rgba(30, 27, 55, 0.6);
}

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

.ring-track { fill: none; stroke: #eee; stroke-width: 8; }
.ring-fill  {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4,0,0.2,1);
}
.ring-fill.pronunciation { stroke: url(#grad-purple); }
.ring-fill.grammar       { stroke: url(#grad-green); }
.ring-fill.comprehension { stroke: url(#grad-orange); }
.ring-fill.overall       { stroke: url(#grad-cyan); }

.ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}
.ring-score { font-size: 22px; font-weight: 800; color: var(--text-dark); line-height: 1; }
.ring-unit  { font-size: 11px; color: var(--text-light); }

.ring-container { position: relative; width: 100px; height: 100px; }

.score-label { 
    font-size: 15px; 
    font-weight: 800; 
    color: var(--text-dark); 
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.score-desc  { font-size: 12px; color: var(--text-light); text-align: center; }

.score-grade {
    font-size: 14px;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
}
.score-grade.excellent { background: #e8fff0; color: #1a7a3a; }
.score-grade.good      { background: #e8f4ff; color: #1a5fa0; }
.score-grade.average   { background: #fff8e8; color: #a06a00; }
.score-grade.weak      { background: #ffe8e8; color: #a01a1a; }

html[data-theme="dark"] .score-grade.excellent {
    background: rgba(47, 168, 106, 0.20);
    color: #5ae894;
}
html[data-theme="dark"] .score-grade.good {
    background: rgba(62, 197, 255, 0.20);
    color: #68d7ff;
}
html[data-theme="dark"] .score-grade.average {
    background: rgba(255, 152, 0, 0.20);
    color: #ffb84d;
}
html[data-theme="dark"] .score-grade.weak {
    background: rgba(255, 82, 82, 0.20);
    color: #ff9999;
}

/* Overall summary dashed box */
.overall-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--grad-card-bg);
}
.summary-text { font-size: 16px; font-weight: 700; color: var(--text-light); line-height: 1.7; flex: 1; min-width: 200px; }
.summary-text strong { color: var(--purple); }

/* ================================================
   PROGRESS TIMELINE
   ================================================ */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 24px;
    position: relative;
}

/* Vertical line */
.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 19px;
    top: 42px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(123,97,255,0.25);
    position: relative;
    z-index: 1;
}

.timeline-content {
    flex: 1;
    background: #fdfcff;
    border: 1px solid var(--border);
    border-radius: var(--radius-inner);
    padding: 14px 18px;
    transition: box-shadow 0.2s;
}
.timeline-content:hover { box-shadow: 0 8px 22px rgba(123,97,255,0.09); }

html[data-theme="dark"] .timeline-content {
    background: rgba(30, 27, 55, 0.6);
}

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.timeline-title { font-size: 15px; font-weight: 800; color: var(--text-dark); }
.timeline-date  { font-size: 12px; color: var(--text-light); }

.mini-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: #f3f1ff;
    color: var(--purple);
}
.mini-score.green  { background: #e8fff0; color: #1a7a3a; }
.mini-score.orange { background: #fff8e8; color: #a06a00; }

html[data-theme="dark"] .mini-score {
    background: rgba(123, 97, 255, 0.15);
    color: #b9a7ff;
}
html[data-theme="dark"] .mini-score.green {
    background: rgba(47, 168, 106, 0.15);
    color: #5ae894;
}
html[data-theme="dark"] .mini-score.orange {
    background: rgba(255, 152, 0, 0.15);
    color: #ffb84d;
}

.mini-score-bar {
    width: 60px;
    height: 5px;
    background: #e6e4f2;
    border-radius: var(--radius-pill);
    overflow: hidden;
}

html[data-theme="dark"] .mini-score-bar {
    background: rgba(255, 255, 255, 0.10);
}
.mini-score-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--grad-primary);
}
.mini-score-fill.green  { background: var(--grad-secondary); }
.mini-score-fill.orange { background: var(--grad-warm); }

/* ================================================
   ACHIEVEMENTS
   ================================================ */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 12px;
    border-radius: var(--radius-inner);
    border: 1px solid var(--border);
    background: #fdfcff;
    text-align: center;
    cursor: default;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.achievement-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(123,97,255,0.10);
}

html[data-theme="dark"] .achievement-item {
    background: rgba(30, 27, 55, 0.6);
}
.achievement-item.locked { opacity: 0.45; filter: grayscale(0.6); }

.achievement-icon {
    font-size: 36px;
    line-height: 1;
    animation: badge-pop 0.5s cubic-bezier(0.34,1.5,0.64,1) both;
}
.achievement-item:nth-child(1) .achievement-icon { animation-delay: 0.3s; }
.achievement-item:nth-child(2) .achievement-icon { animation-delay: 0.4s; }
.achievement-item:nth-child(3) .achievement-icon { animation-delay: 0.5s; }
.achievement-item:nth-child(4) .achievement-icon { animation-delay: 0.6s; }
.achievement-item:nth-child(5) .achievement-icon { animation-delay: 0.7s; }
.achievement-item:nth-child(6) .achievement-icon { animation-delay: 0.8s; }

@keyframes badge-pop {
    from { opacity: 0; transform: scale(0.4) rotate(-15deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.achievement-name  { font-size: 12px; font-weight: 800; color: var(--text-dark); }
.achievement-desc  { font-size: 11px; color: var(--text-light); line-height: 1.4; }

.achievement-new {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--red);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}

/* ================================================
   NEXT LESSON RECOMMENDATION
   ================================================ */
.recommendation-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--grad-card-bg);
}

.rec-icon {
    font-size: 52px;
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

.rec-content { flex: 1; min-width: 180px; }
.rec-label   { font-size: 12px; font-weight: 700; color: var(--text-light); margin-bottom: 4px; }
.rec-title   { font-size: 20px; font-weight: 800; color: var(--text-dark); margin-bottom: 6px; }
.rec-desc    { font-size: 14px; color: var(--text-mid); line-height: 1.6; margin-bottom: 14px; }

.rec-meta {
    display: flex;
    flex-wrap:nowrap;
    gap: 15px;
    margin-bottom: 16px;
}

.rec-tag {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--purple-light);
    color: var(--purple);
    border: 1px solid #ddd8ff;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.rec-tag.orange { background: var(--orange-light); color: #a06a00; border-color: #ffdda0; }

html[data-theme="dark"] .rec-tag {
    border-color: rgba(123, 97, 255, 0.30);
}
html[data-theme="dark"] .rec-tag.orange {
    color: #ffb84d;
    border-color: rgba(255, 152, 0, 0.30);
}

/* ================================================
   TEACHER NOTE
   ================================================ */
.teacher-note {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.teacher-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(123,97,255,0.20);
}

.note-content { flex: 1; min-width: 180px; }
.note-who     { font-size: 13px; font-weight: 700; color: var(--purple); margin-bottom: 2px; }
.note-date    { font-size: 11px; color: var(--text-light); margin-bottom: 10px; }
.note-text    { font-size: 15px; color: var(--text-mid); line-height: 1.8; font-weight: 400; }

/* ================================================
   MODAL OVERLAY
   ================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 80, 0.45);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: white;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 680px;
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(30px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.34,1.3,0.64,1), opacity 0.3s ease;
    opacity: 0;
    direction: rtl;
    text-align: right;
}
.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

html[data-theme="dark"] .modal {
    background: rgba(30, 27, 55, 0.92);
    color: var(--text-dark);
}

.modal-header {
    background: var(--grad-primary);
    padding: 22px 26px;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    position: sticky;
    top: 0;
    z-index: 2;
}
.modal-title { font-size: 20px; font-weight: 800; }
.modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-family: "Almarai", sans-serif;
}
.modal-close:hover { background: rgba(255,255,255,0.35); }

.modal-body { padding: 26px; display: flex; flex-direction: column; gap: 22px; }

/* Skill detail block inside modal */
.skill-detail {
    border-radius: var(--radius-inner);
    border: 1px solid var(--border);
    overflow: hidden;
}

.skill-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    font-weight: 800;
    font-size: 16px;
}
.skill-detail-header.purple { background: #f0eeff; color: var(--purple); }
.skill-detail-header.green  { background: #e8fff0; color: #1a7a3a; }
.skill-detail-header.orange { background: #fff8e8; color: #a06a00; }

html[data-theme="dark"] .skill-detail-header.purple { background: rgba(123, 97, 255, 0.15); color: #b9a7ff; }
html[data-theme="dark"] .skill-detail-header.green  { background: rgba(47, 168, 106, 0.15); color: #5ae894; }
html[data-theme="dark"] .skill-detail-header.orange { background: rgba(255, 152, 0, 0.15); color: #ffb84d; }

.skill-detail-body { padding: 16px 18px; background: #fdfcff; }

html[data-theme="dark"] .skill-detail-body {
    background: rgba(30, 27, 55, 0.5);
}

.skill-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-mid);
}
.skill-bar-label { width: 130px; flex-shrink: 0; text-align: right; }
.skill-bar-track {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: var(--radius-pill);
    overflow: hidden;
}

html[data-theme="dark"] .skill-bar-track {
    background: rgba(255, 255, 255, 0.10);
}
.skill-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--grad-primary);
    transition: width 1s ease;
}
.skill-bar-fill.green  { background: var(--grad-secondary); }
.skill-bar-fill.orange { background: var(--grad-warm); }
.skill-bar-score { width: 36px; text-align: left; font-weight: 800; color: var(--text-dark); }

.skill-feedback {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-mid);
    line-height: 1.8;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.skill-feedback strong { color: var(--text-dark); }

/* strengths / improve lists */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 500px) { .two-col { grid-template-columns: 1fr; } }

.mini-list-card {
    border-radius: var(--radius-inner);
    padding: 14px 16px;
}
.mini-list-card.strengths { background: var(--green-light); border: 1px solid #c6f6d5; }
.mini-list-card.improve   { background: #fff8e8; border: 1px solid #fde68a; }

html[data-theme="dark"] .mini-list-card.strengths {
    background: rgba(47, 168, 106, 0.15);
    border-color: rgba(47, 168, 106, 0.30);
}
html[data-theme="dark"] .mini-list-card.improve {
    background: rgba(255, 152, 0, 0.15);
    border-color: rgba(255, 152, 0, 0.30);
}

.mini-list-title {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
}
.mini-list-title.green  { color: #1a7a3a; }
.mini-list-title.orange { color: #a06a00; }

.mini-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.mini-list li {
    font-size: 13px;
    color: var(--text-mid);
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.5;
}
.mini-list li::before { content: attr(data-icon); flex-shrink: 0; }

/* ================================================
   FLOATING BG SHAPES
   ================================================ */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: drift 9s ease-in-out infinite;
}
.bg-shape.s1 {
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(123,97,255,0.08), transparent 70%);
    top: -80px; right: -80px; animation-delay: 0s;
}
.bg-shape.s2 {
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(62,197,255,0.08), transparent 70%);
    bottom: 80px; left: -60px; animation-delay: 2.5s;
}
.bg-shape.s3 {
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(255,152,0,0.08), transparent 70%);
    top: 40%; left: 20%; animation-delay: 5s;
}
@keyframes drift {
    0%,100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-22px) scale(1.04); }
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 860px) {
    .profile-hero { flex-direction: column; align-items: flex-start; }
    .hero-stats   { flex-direction: row; flex-wrap: wrap; width: 100%; }
    .hero-stat-item { flex: 1; min-width: 120px; }
}

@media (max-width: 620px) {
    .container        { padding: 20px 16px 50px; }
    .card             { padding: 20px 16px; }
    .profile-hero     { padding: 24px 20px; }
    .hero-name        { font-size: 24px; }
    .section-heading  { font-size: 17px; }
    .performance-grid { grid-template-columns: repeat(2, 1fr); }
    .achievements-grid{ grid-template-columns: repeat(3, 1fr); }
    .header-nav       { display: none; }
    .modal-body       { padding: 18px; }
}
