/* ============================================================
   Proten LMS — Dashboard CSS (Student + Instructor)
   ============================================================ */

/* ── AUTH PAGES ──────────────────────────────────────────── */
.proten-auth-page { background: var(--proten-gray-100); padding: 40px 0; min-height: 60vh; }

/* ── CHECKOUT PAGE ───────────────────────────────────────── */
.proten-checkout-page { background: var(--proten-gray-100); padding: 40px 0; }

/* ── BECOME INSTRUCTOR ───────────────────────────────────── */
.proten-become-instructor { padding: 0 0 60px; }

/* ── COURSE LISTING ──────────────────────────────────────── */
.proten-courses-section { padding: 40px 0 60px; }

/* ── STUDENT DASHBOARD ───────────────────────────────────── */
.proten-dashboard { padding: 32px 0 60px; background: var(--proten-gray-100); min-height: 70vh; }

.proten-dashboard-header {
    background: linear-gradient(135deg, var(--proten-dark) 0%, #2c2a2a 60%, #1a3a1a 100%);
    padding: 36px 40px; border-radius: var(--proten-radius-lg);
    color: #fff; margin-bottom: 28px; position: relative; overflow: hidden;
}
.proten-dashboard-header::before {
    content: ''; position: absolute; top: -60px; right: -60px;
    width: 220px; height: 220px; background: var(--proten-primary);
    border-radius: 50%; opacity: .08;
}
.proten-dashboard-header::after {
    content: ''; position: absolute; bottom: -40px; left: 40%;
    width: 150px; height: 150px; background: var(--proten-secondary);
    border-radius: 50%; opacity: .06;
}
.proten-dashboard-greeting {
    font-size: 12px; text-transform: uppercase; letter-spacing: .8px;
    opacity: .65; margin-bottom: 4px; position: relative;
}
.proten-dashboard-name { font-size: 28px; font-weight: 900; margin-bottom: 22px; position: relative; }
.proten-dashboard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; position: relative; }
.proten-stat-card {
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--proten-radius); padding: 16px 18px;
    backdrop-filter: blur(8px); transition: var(--proten-transition);
}
.proten-stat-card:hover { background: rgba(255,255,255,.13); transform: translateY(-2px); }
.proten-stat-value { font-size: 28px; font-weight: 900; color: var(--proten-primary); line-height: 1; }
.proten-stat-label { font-size: 12px; opacity: .7; margin-top: 4px; font-weight: 500; }
.proten-xp-bar-wrap { margin-top: 22px; position: relative; }
.proten-xp-label { display: flex; justify-content: space-between; font-size: 12px; opacity: .7; margin-bottom: 6px; }
.proten-xp-bar { height: 8px; background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden; }
.proten-xp-fill { height: 100%; background: linear-gradient(90deg, var(--proten-primary), var(--proten-secondary)); border-radius: 999px; transition: width .8s cubic-bezier(.4,0,.2,1); }

/* Dashboard layout */
.proten-dashboard-content { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }

/* Nav pills */
.proten-dashboard-nav {
    display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px;
    background: #fff; padding: 4px; border-radius: var(--proten-radius-sm);
    border: 1px solid var(--proten-gray-200); box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.proten-dashboard-nav-item {
    padding: 9px 18px; border-radius: 6px; font-size: 13px;
    font-weight: 600; cursor: pointer; transition: var(--proten-transition);
    font-family: var(--proten-font); background: none;
    border: none; color: var(--proten-gray-700);
}
.proten-dashboard-nav-item:hover  { background: var(--proten-gray-100); color: var(--proten-dark); }
.proten-dashboard-nav-item.active { background: var(--proten-primary); color: var(--proten-dark); box-shadow: 0 2px 8px rgba(255,213,63,.3); }

.proten-dashboard-panel { display: none; }
.proten-dashboard-panel.active { display: block; animation: fadeIn .2s ease; }

/* My course card */
.proten-my-course {
    display: grid; grid-template-columns: 110px 1fr auto;
    gap: 16px; align-items: center; padding: 16px;
    border-radius: var(--proten-radius); border: 1px solid var(--proten-gray-200);
    background: #fff; margin-bottom: 12px;
    transition: var(--proten-transition); text-decoration: none; color: inherit;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.proten-my-course:hover { border-color: var(--proten-primary); box-shadow: 0 4px 16px rgba(255,213,63,.15); transform: translateY(-1px); }
.proten-my-course-thumb { aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: var(--proten-gray-200); }
.proten-my-course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proten-my-course-title { font-size: 15px; font-weight: 700; margin-bottom: 5px; line-height: 1.4; }
.proten-my-course-instructor { font-size: 12px; color: var(--proten-gray-700); margin-bottom: 10px; }
.proten-my-course-progress-wrap { }

/* Gamification sidebar */
.proten-gamification-panel { display: flex; flex-direction: column; gap: 16px; }

.proten-streak-widget {
    background: linear-gradient(135deg, var(--proten-accent) 0%, #c0392b 100%);
    color: #fff; border-radius: var(--proten-radius); padding: 22px; text-align: center;
    box-shadow: 0 4px 20px rgba(220,38,38,.25);
}
.proten-streak-icon { font-size: 36px; margin-bottom: 4px; display: block; }
.proten-streak-count { font-size: 44px; font-weight: 900; line-height: 1; }
.proten-streak-label { font-size: 12px; opacity: .85; margin-top: 4px; font-weight: 600; letter-spacing: .4px; }

.proten-level-widget {
    background: linear-gradient(135deg, var(--proten-primary) 0%, var(--proten-secondary) 100%);
    color: var(--proten-dark); border-radius: var(--proten-radius); padding: 20px;
    box-shadow: 0 4px 20px rgba(255,213,63,.2);
}
.proten-level-display { display: flex; align-items: center; gap: 16px; }
.proten-level-circle {
    width: 56px; height: 56px; background: var(--proten-dark); color: var(--proten-primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 900; flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.proten-level-info h4 { font-size: 17px; font-weight: 800; margin-bottom: 2px; }
.proten-level-info span { font-size: 12px; opacity: .75; }

.proten-badges-widget, .proten-leaderboard-widget {
    background: #fff; border: 1px solid var(--proten-gray-200);
    border-radius: var(--proten-radius); padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.proten-badges-widget h4, .proten-leaderboard-widget h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }

.proten-badges-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.proten-badge-item { text-align: center; }
.proten-badge-item .badge-icon {
    font-size: 22px; display: block; background: var(--proten-gray-100);
    border-radius: 8px; padding: 8px; margin-bottom: 4px; transition: var(--proten-transition);
}
.proten-badge-item.earned .badge-icon { background: #fef9c3; }
.proten-badge-item.locked .badge-icon { opacity: .3; filter: grayscale(1); }
.proten-badge-item .badge-name { font-size: 9px; font-weight: 600; color: var(--proten-gray-700); line-height: 1.2; }

.proten-leaderboard-row {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 0; border-bottom: 1px solid var(--proten-gray-200); font-size: 13px;
}
.proten-leaderboard-row:last-child { border-bottom: none; }
.proten-leaderboard-rank { width: 26px; font-weight: 800; color: var(--proten-gray-500); font-size: 14px; }
.proten-leaderboard-rank.gold   { color: #FFB800; }
.proten-leaderboard-rank.silver { color: #94A3B8; }
.proten-leaderboard-rank.bronze { color: #CD7F32; }
.proten-leaderboard-avatar img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.proten-leaderboard-name { flex: 1; font-weight: 600; }
.proten-leaderboard-xp { font-weight: 700; color: var(--proten-secondary-dark); font-size: 12px; }

/* ── INSTRUCTOR DASHBOARD ────────────────────────────────── */
.proten-instructor-dash { padding: 32px 0 60px; background: var(--proten-gray-100); min-height: 70vh; }
.proten-instructor-header {
    background: linear-gradient(135deg, var(--proten-secondary-dark) 0%, var(--proten-secondary) 100%);
    padding: 32px 40px; border-radius: var(--proten-radius-lg); margin-bottom: 28px;
    color: var(--proten-dark);
    box-shadow: 0 4px 20px rgba(22,125,192,.3);
}
.proten-analytics-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.proten-analytics-card {
    background: #fff; border: 1px solid var(--proten-gray-200);
    border-radius: var(--proten-radius); padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05); transition: var(--proten-transition);
}
.proten-analytics-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.proten-analytics-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.proten-analytics-value { font-size: 28px; font-weight: 900; line-height: 1; color: var(--proten-dark); }
.proten-analytics-label { font-size: 11px; color: var(--proten-gray-700); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }

/* ── CERTIFICATES ────────────────────────────────────────── */
.proten-cert-page { padding: 40px 0; background: var(--proten-gray-100); min-height: 60vh; }

/* ── FORUM ───────────────────────────────────────────────── */
.proten-forum-thread { margin-bottom: 20px; }
.proten-forum-post {
    display: grid; grid-template-columns: 44px 1fr; gap: 14px;
    padding: 16px; background: #fff; border: 1px solid var(--proten-gray-200);
    border-radius: var(--proten-radius); margin-bottom: 3px;
}
.proten-forum-reply { background: var(--proten-gray-100); margin-left: 56px; }
.proten-forum-avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.proten-forum-author { font-weight: 700; font-size: 14px; }
.proten-forum-date   { font-size: 12px; color: var(--proten-gray-500); }
.proten-forum-content { font-size: 14px; line-height: 1.7; margin-top: 6px; color: var(--proten-gray-700); }
.proten-forum-actions { display: flex; gap: 14px; margin-top: 10px; }
.proten-forum-action-btn {
    display: flex; align-items: center; gap: 5px; font-size: 13px;
    font-weight: 600; cursor: pointer; color: var(--proten-gray-700);
    background: none; border: none; font-family: var(--proten-font); padding: 0;
    transition: color .15s;
}
.proten-forum-action-btn:hover { color: var(--proten-dark); }
.proten-forum-composer {
    background: var(--proten-gray-100); border: 1px solid var(--proten-gray-200);
    border-radius: var(--proten-radius); padding: 20px; margin-top: 24px;
}
.proten-forum-composer h4 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.proten-forum-composer textarea {
    width: 100%; min-height: 100px; padding: 14px;
    border: 1.5px solid var(--proten-gray-300); border-radius: var(--proten-radius-sm);
    font-family: var(--proten-font); font-size: 14px; resize: vertical;
    transition: var(--proten-transition);
}
.proten-forum-composer textarea:focus { outline: none; border-color: var(--proten-primary); box-shadow: 0 0 0 3px rgba(255,213,63,.2); }

/* ── AI ASSISTANT WIDGET ─────────────────────────────────── */
.proten-ai-widget { position: fixed; bottom: 24px; right: 24px; z-index: 9999; }
.proten-ai-toggle {
    width: 56px; height: 56px; background: var(--proten-primary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 4px 20px rgba(255,213,63,.45);
    font-size: 24px; transition: var(--proten-transition); border: none;
}
.proten-ai-toggle:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(255,213,63,.5); }
.proten-ai-panel {
    position: absolute; bottom: 68px; right: 0;
    width: 340px; background: #fff; border-radius: var(--proten-radius-lg);
    box-shadow: 0 8px 48px rgba(0,0,0,.15); border: 1px solid var(--proten-gray-200);
    overflow: hidden; display: none; flex-direction: column;
}
.proten-ai-panel.open { display: flex; animation: proten-slide-up .25s ease; }
@keyframes proten-slide-up { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
.proten-ai-panel-header {
    background: var(--proten-dark); color: #fff;
    padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-size: 14px;
}
.proten-ai-panel-header span { display: flex; align-items: center; gap: 8px; }
.proten-ai-close { cursor: pointer; opacity: .7; font-size: 18px; background: none; border: none; color: #fff; padding: 0; }
.proten-ai-close:hover { opacity: 1; }
.proten-ai-messages { height: 280px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.proten-ai-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.6; }
.proten-ai-msg.user { background: var(--proten-primary); align-self: flex-end; color: var(--proten-dark); font-weight: 500; border-radius: 14px 14px 2px 14px; }
.proten-ai-msg.bot  { background: var(--proten-gray-100); align-self: flex-start; color: var(--proten-dark); border-radius: 2px 14px 14px 14px; }
.proten-ai-typing { align-self: flex-start; padding: 10px 16px; background: var(--proten-gray-100); border-radius: 14px; }
.proten-ai-typing span { width: 7px; height: 7px; background: var(--proten-gray-500); border-radius: 50%; display: inline-block; margin: 0 2px; animation: typing-dot .8s infinite; }
.proten-ai-typing span:nth-child(2) { animation-delay: .2s; }
.proten-ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing-dot { 0%,80%,100%{transform:scale(1);opacity:.5;} 40%{transform:scale(1.3);opacity:1;} }
.proten-ai-input-row { display: flex; padding: 10px 12px; border-top: 1px solid var(--proten-gray-200); gap: 8px; }
.proten-ai-input-row input {
    flex: 1; padding: 9px 14px; border: 1.5px solid var(--proten-gray-300);
    border-radius: 999px; font-family: var(--proten-font); font-size: 13px;
    transition: var(--proten-transition);
}
.proten-ai-input-row input:focus { outline: none; border-color: var(--proten-primary); }
.proten-ai-send-btn {
    width: 38px; height: 38px; border-radius: 50%; background: var(--proten-primary);
    border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 16px; transition: var(--proten-transition); flex-shrink: 0;
}
.proten-ai-send-btn:hover { transform: scale(1.1); }
