/* GlaceLearn Dashboard CSS — White Premium Theme
   Extends style.css with dashboard-specific components
   ============================================================== */

/* ---- DASHBOARD LAYOUT ---- */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 62px);
    background: #f8fafc;
}

/* ---- SIDEBAR ---- */
.sidebar-nav {
    width: 220px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 20px 12px;
    flex-shrink: 0;
    position: sticky;
    top: 62px;
    height: calc(100vh - 62px);
    overflow-y: auto;
}
.sidebar-section-label {
    font-size: 10px; font-weight: 800;
    color: #94a3b8; text-transform: uppercase;
    letter-spacing: .1em; padding: 8px 10px 6px;
    margin-top: 8px;
}
.sidebar-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px; border-radius: 10px;
    font-size: 13px; font-weight: 600;
    color: #64748b; text-decoration: none;
    transition: all .2s; margin-bottom: 2px;
    cursor: pointer;
}
.sidebar-item:hover { background: #f1f5f9; color: #0f172a; }
.sidebar-item.active { background: rgba(99,102,241,.08); color: #6366f1; font-weight: 700; }
.sidebar-item .icon { font-size: 16px; width: 20px; text-align: center; }

/* ---- DASHBOARD MAIN ---- */
.dashboard-main {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
}

/* ---- WELCOME BANNER ---- */
.welcome-banner {
    background: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
    border-radius: 20px;
    padding: 28px 32px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}
.welcome-banner::before {
    content: '';
    position: absolute; top: -40px; right: -40px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.welcome-banner::after {
    content: '';
    position: absolute; bottom: -60px; right: 100px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
}

/* ---- STAT CARDS ---- */
.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 1px 4px rgba(15,23,42,.06);
    transition: all .25s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity .25s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 6px 24px rgba(15,23,42,.09); }
.stat-card:hover::before { opacity: 1; }

.stat-card.purple::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.stat-card.blue::before   { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.stat-card.green::before  { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.orange::before { background: linear-gradient(90deg, #f97316, #fb923c); }
.stat-card.rose::before   { background: linear-gradient(90deg, #f43f5e, #fb7185); }

.stat-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 14px; flex-shrink: 0;
}
.stat-icon.purple { background: rgba(99,102,241,.1); }
.stat-icon.blue   { background: rgba(14,165,233,.1); }
.stat-icon.green  { background: rgba(16,185,129,.1); }
.stat-icon.orange { background: rgba(249,115,22,.1); }
.stat-icon.rose   { background: rgba(244,63,94,.1); }

.stat-number {
    font-size: 28px; font-weight: 900;
    color: #0f172a; letter-spacing: -0.03em; line-height: 1;
}
.stat-label {
    font-size: 12px; font-weight: 600; color: #64748b; margin-top: 4px;
}

/* ---- SECTION CARDS ---- */
.section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(15,23,42,.05);
    margin-bottom: 20px;
}
.section-card-title {
    font-size: 16px; font-weight: 800; color: #0f172a;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 18px;
}
.section-card-title .icon-badge {
    width: 32px; height: 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}

/* ---- XP PROGRESS RING ---- */
.progress-ring-container { position: relative; width: 80px; height: 80px; }
.progress-ring-svg { transform: rotate(-90deg); width: 80px; height: 80px; }
.progress-ring-track { fill: none; stroke: #e2e8f0; stroke-width: 6; }
.progress-ring-fill  {
    fill: none; stroke-width: 6; stroke-linecap: round;
    stroke: url(#xpGradient);
    transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1);
}
.progress-ring-label {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-size: 12px; font-weight: 900; color: #0f172a;
}

/* ---- NODE TIMELINE ---- */
.node-timeline {
    display: flex; align-items: flex-start;
    gap: 0; overflow-x: auto;
    padding: 20px 4px 20px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.node-timeline::-webkit-scrollbar { height: 4px; }
.node-timeline::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }

.timeline-node {
    display: flex; flex-direction: column; align-items: center;
    position: relative; min-width: 155px;
    animation: nodeUnlock .5s cubic-bezier(.4,0,.2,1) forwards; opacity: 0;
}
.timeline-node:not(:last-child)::after {
    content: '';
    position: absolute; top: 21px;
    left: calc(50% + 21px); width: calc(100% - 42px); height: 2px;
    background: linear-gradient(90deg, #6366f1, #0ea5e9); opacity: .3;
}
.timeline-node.locked:not(:last-child)::after { background: #e2e8f0; opacity: 1; }

.node-circle {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 15px;
    border: 2px solid rgba(99,102,241,.4);
    background: rgba(99,102,241,.08); color: #6366f1;
    position: relative; z-index: 1;
    box-shadow: 0 0 0 4px rgba(99,102,241,.07);
    transition: all .25s;
}
.timeline-node:hover .node-circle { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(99,102,241,.12), 0 4px 16px rgba(99,102,241,.2); }
.timeline-node.locked .node-circle { border-color: #e2e8f0; background: #f8fafc; box-shadow: none; color: #94a3b8; }

.node-card {
    margin-top: 12px; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 12px; text-align: center; width: 135px;
    box-shadow: 0 1px 3px rgba(15,23,42,.05); position: relative;
}
.timeline-node.locked .node-card { filter: blur(1.5px); pointer-events: none; }
.lock-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(248,250,252,.9);
    border-radius: 12px; font-size: 18px;
    backdrop-filter: blur(3px);
}

/* ---- FLIP FLASHCARDS ---- */
.flip-card { width: 160px; height: 100px; perspective: 700px; cursor: pointer; }
.flip-card-inner {
    width: 100%; height: 100%;
    position: relative; transform-style: preserve-3d;
    transition: transform .55s cubic-bezier(.4,0,.2,1);
}
.flip-card:hover .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
    position: absolute; inset: 0; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    padding: 10px; text-align: center; font-size: 12px; font-weight: 700;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flip-card-front { background: rgba(99,102,241,.07); border: 1.5px solid rgba(99,102,241,.2); color: #4f46e5; }
.flip-card-back  { background: rgba(14,165,233,.07); border: 1.5px solid rgba(14,165,233,.2); color: #0369a1; transform: rotateY(180deg); }

/* ---- LEADERBOARD ---- */
.leaderboard-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 13px;
    border: 1px solid #e2e8f0; background: #fff;
    transition: all .22s; margin-bottom: 8px;
}
.leaderboard-row:hover { background: #f8fafc; border-color: #cbd5e1; }
.leaderboard-row.current-user {
    background: rgba(99,102,241,.04);
    border-color: rgba(99,102,241,.3);
    box-shadow: 0 0 0 3px rgba(99,102,241,.07);
}
.rank-medal-1 { color: #f59e0b; font-size: 20px; }
.rank-medal-2 { color: #94a3b8; font-size: 20px; }
.rank-medal-3 { color: #b45309; font-size: 20px; }
.rank-number  { color: #94a3b8; font-size: 14px; font-weight: 800; }
.xp-bar-wrap { flex: 1; height: 5px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.xp-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #0ea5e9); transition: width 1s ease; }

/* ---- DATA TABLE ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead tr { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.data-table thead th {
    padding: 10px 16px; text-align: left;
    font-size: 11px; font-weight: 800; color: #64748b;
    text-transform: uppercase; letter-spacing: .07em;
}
.data-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .15s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody td { padding: 12px 16px; color: #334155; vertical-align: middle; }

/* ---- MATCH SCORE CIRCLE ---- */
.match-score-circle {
    position: relative; width: 68px; height: 68px;
    display: flex; align-items: center; justify-content: center;
}
.match-score-circle svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.match-score-circle .score-text { font-size: 14px; font-weight: 900; position: relative; z-index: 1; color: #6366f1; }

/* ---- ATTENDANCE BADGE ---- */
.attendance-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 800;
    background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.3); color: #047857;
}
.attendance-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #10b981;
    animation: attendance-ping 1.5s ease-in-out infinite;
}
@keyframes attendance-ping { 0%,100%{transform:scale(1);opacity:1;} 50%{transform:scale(1.4);opacity:.6;} }

/* ---- WHITEBOARD ---- */
.whiteboard-toolbar {
    display: flex; align-items: center; gap: 8px; padding: 8px 14px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-bottom: none; border-radius: 12px 12px 0 0;
}
.wb-btn {
    padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 700;
    cursor: pointer; border: 1.5px solid #e2e8f0; background: #fff;
    color: #64748b; transition: all .2s;
}
.wb-btn:hover, .wb-btn.active {
    background: rgba(99,102,241,.08); border-color: rgba(99,102,241,.3); color: #6366f1;
}

/* ---- ANIMATIONS ---- */
@keyframes nodeUnlock {
    from { opacity:0; transform:translateY(16px) scale(.94); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}
@keyframes countUp {
    from { opacity:0; transform:translateY(10px); }
    to   { opacity:1; transform:translateY(0); }
}
@keyframes confettiFall {
    0%   { transform:translateY(-20px) rotate(0deg); opacity:1; }
    100% { transform:translateY(100vh) rotate(720deg); opacity:0; }
}
@keyframes spin { to { transform:rotate(360deg); } }

.animate-count   { animation: countUp .6s cubic-bezier(.4,0,.2,1) forwards; }
.confetti-piece  { animation: confettiFall 2s linear forwards; }

/* ---- INPUT FIELD ---- */
.glass-input, .glass-select {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 11px;
    color: #0f172a;
    padding: 10px 14px;
    font-size: 13px;
    font-family: 'Plus Jakarta Sans', Inter, sans-serif;
    outline: none;
    transition: all .22s;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.glass-input::placeholder, .glass-select::placeholder { color: #94a3b8; }
.glass-input:hover, .glass-select:hover { border-color: #cbd5e1; }
.glass-input:focus, .glass-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

/* Legacy dark-theme class overrides (for compat) */
.glass-panel {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(15,23,42,.07) !important;
    border-radius: 16px;
}
.glass-panel-hover:hover {
    border-color: rgba(99,102,241,.3) !important;
    box-shadow: 0 6px 24px rgba(99,102,241,.1) !important;
    transform: translateY(-3px) !important;
}
