/* ===================================================
   GeniusTestBoost — Dashboard & Auth Styles
   Shared across all dashboard pages
   =================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  background: #0c0c18;
  min-height: 100vh;
  color: #e0e0e8;
}

a { color: #C9A84C; text-decoration: none; }
a:hover { color: #E8D48B; }

.hidden { display: none !important; }

/* ========== AUTH PAGES ========== */
.auth-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #14141f;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 48px 40px;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.auth-container .logo { text-align: center; margin-bottom: 32px; }
.auth-container .logo h1 { font-size: 26px; color: #fff; font-weight: 700; }
.auth-container .logo h1 span { color: #C9A84C; }
.auth-container .logo p { color: #666; font-size: 14px; margin-top: 4px; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600; color: #888;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}

.input, .form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; font-size: 14px; font-family: inherit;
  background: rgba(255,255,255,0.04); color: #e0e0e8;
  transition: border-color 0.3s, box-shadow 0.3s; outline: none;
}

.input:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: rgba(201,168,76,0.4);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.08);
}

.textarea { resize: vertical; min-height: 80px; }
.input-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.role-note { display: block; color: #C9A84C; font-size: 12px; margin-top: 6px; }

.error-message {
  background: rgba(231,76,60,0.1); color: #e74c3c;
  padding: 12px 16px; border-radius: 10px; font-size: 13px;
  margin-bottom: 18px; display: none; border-left: 3px solid #e74c3c;
}
.error-message.visible { display: block; animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: #666; }
.auth-footer a { color: #C9A84C; font-weight: 600; }

/* ========== BUTTONS ========== */
.btn { width: 100%; padding: 14px; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn:active { transform: scale(0.98); }
.btn-primary, .btn.btn-primary {
  background: linear-gradient(135deg, #C9A84C, #dfc06a); color: #0c0c18;
  border: none; border-radius: 50px; padding: 13px 28px; font-size: 14px;
  font-weight: 700; cursor: pointer; transition: all 0.3s; width: auto;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(201,168,76,0.25); }
.btn-primary:disabled, .btn-disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.btn-ghost { padding: 12px 24px; background: transparent; color: #888; border: 1px solid rgba(255,255,255,0.08); border-radius: 50px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.btn-ghost:hover { color: #C9A84C; border-color: rgba(201,168,76,0.3); }

.btn-ghost-sm { padding: 7px 16px; font-size: 12px; background: transparent; color: #888; border: 1px solid rgba(255,255,255,0.08); border-radius: 50px; cursor: pointer; transition: all 0.3s; font-family: inherit; }
.btn-ghost-sm:hover { color: #C9A84C; border-color: rgba(201,168,76,0.3); }

.btn-primary-sm { padding: 7px 18px; font-size: 12px; background: linear-gradient(135deg, #C9A84C, #dfc06a); color: #0c0c18; border: none; border-radius: 50px; font-weight: 700; cursor: pointer; transition: all 0.3s; font-family: inherit; }
.btn-primary-sm:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,168,76,0.2); }

.btn-success-sm { padding: 7px 18px; font-size: 12px; background: #27ae60; color: #fff; border: none; border-radius: 50px; font-weight: 600; cursor: pointer; transition: all 0.3s; font-family: inherit; }
.btn-success-sm:hover { background: #2ecc71; }

.btn-danger-sm { padding: 7px 18px; font-size: 12px; background: transparent; color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); border-radius: 50px; font-weight: 600; cursor: pointer; transition: all 0.3s; font-family: inherit; }
.btn-danger-sm:hover { background: rgba(231,76,60,0.1); }

/* ========== DASHBOARD NAV ========== */
.dash-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12,12,24,0.9); backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dash-nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.dash-logo { font-size: 16px; font-weight: 700; color: #fff; text-decoration: none; }
.dash-logo span { color: #C9A84C; }
.dash-nav-right { display: flex; align-items: center; gap: 24px; }
.dash-nav-link { font-size: 13px; color: #888; text-decoration: none; transition: color 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.dash-nav-link:hover { color: #C9A84C; }
.dash-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #888; }

/* ========== BADGES ========== */
.badge { background: #C9A84C; color: #0c0c18; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 50px; min-width: 20px; text-align: center; }
.role-badge { padding: 3px 10px; border-radius: 50px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.role-badge.student { background: rgba(52,152,219,0.15); color: #3498db; }
.role-badge.teacher { background: rgba(39,174,96,0.15); color: #27ae60; }
.role-badge.admin, .role-badge.master_teacher { background: rgba(201,168,76,0.15); color: #C9A84C; }

/* ========== DASHBOARD MAIN ========== */
.dash-main { max-width: 1200px; margin: 0 auto; padding: 32px 28px; }

.dash-section { margin-bottom: 40px; }
.dash-section h2 { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 20px; }

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

/* ========== STATS ========== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 8px; }
.stat-card {
  background: rgba(20,20,31,0.6); border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px; padding: 24px; text-align: center;
  backdrop-filter: blur(10px);
}
.stat-card.accent { border-color: rgba(201,168,76,0.15); }
.stat-num { font-size: 36px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 1px; }

/* ========== ALERT BANNER ========== */
.alert-warning {
  background: rgba(243,156,18,0.08); border: 1px solid rgba(243,156,18,0.2);
  border-radius: 14px; padding: 20px 24px; margin-bottom: 28px;
}
.alert-warning strong { color: #f39c12; display: block; margin-bottom: 4px; }
.alert-warning p { color: #999; font-size: 14px; }

/* ========== CARDS ========== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.course-card {
  background: rgba(20,20,31,0.6); border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px; padding: 24px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.course-card:hover { border-color: rgba(201,168,76,0.12); box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
.course-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.course-card-header h3 { font-size: 17px; font-weight: 700; }
.course-card-header h3 a { color: #fff; }
.course-card-header h3 a:hover { color: #C9A84C; }
.tag-pill { font-size: 10px; background: rgba(201,168,76,0.1); color: #C9A84C; padding: 3px 10px; border-radius: 50px; font-weight: 600; }
.course-desc { font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 12px; }
.course-meta { display: flex; gap: 16px; font-size: 12px; color: #555; margin-bottom: 16px; flex-wrap: wrap; }
.course-actions { display: flex; gap: 8px; }

/* ========== LIST ITEMS ========== */
.card-list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(20,20,31,0.4); border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px; padding: 16px 20px; gap: 16px;
}
.list-item-info { flex: 1; min-width: 0; }
.list-item-info strong { display: block; font-size: 14px; color: #fff; margin-bottom: 2px; }
.list-item-info span { display: block; font-size: 13px; color: #666; }
.list-item-info small { display: block; font-size: 11px; color: #555; margin-top: 4px; }
.list-item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.empty-msg { text-align: center; color: #555; font-size: 14px; padding: 32px; }

/* ========== TABLE ========== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: #666;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.data-table td {
  padding: 14px 16px; font-size: 13px; color: #bbb;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.data-table td a { color: #C9A84C; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.action-cell { white-space: nowrap; display: flex; gap: 6px; }

/* Status dots */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.active { background: #27ae60; }
.status-dot.pending { background: #f39c12; }
.status-dot.inactive { background: #e74c3c; }

/* Status pills */
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 50px; font-size: 11px; font-weight: 600; }
.status-pill.submitted { background: rgba(52,152,219,0.12); color: #3498db; }
.status-pill.graded { background: rgba(39,174,96,0.12); color: #27ae60; }
.status-pill.pending { background: rgba(243,156,18,0.12); color: #f39c12; }

.meta-text { font-size: 12px; color: #666; }

/* ========== GRADES ========== */
.grade-display { font-size: 14px; font-weight: 700; padding: 6px 14px; border-radius: 50px; }
.grade-display.success { background: rgba(39,174,96,0.12); color: #27ae60; }
.grade-display.warning { background: rgba(243,156,18,0.12); color: #f39c12; }
.grade-display.danger { background: rgba(231,76,60,0.12); color: #e74c3c; }

.grade-card { background: rgba(20,20,31,0.6); border-radius: 16px; padding: 24px; text-align: center; }
.grade-card.success { border: 1px solid rgba(39,174,96,0.2); }
.grade-card.warning { border: 1px solid rgba(243,156,18,0.2); }
.grade-card.danger { border: 1px solid rgba(231,76,60,0.2); }
.grade-big { font-size: 36px; font-weight: 800; color: #fff; }
.grade-pct { font-size: 14px; color: #888; margin-bottom: 8px; }
.grade-feedback { font-size: 13px; color: #aaa; margin-top: 12px; text-align: left; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); }

.submission-preview { background: rgba(255,255,255,0.03); border-radius: 10px; padding: 16px; font-size: 13px; color: #aaa; margin-bottom: 16px; max-height: 200px; overflow-y: auto; white-space: pre-wrap; }

/* ========== COURSE HEADER ========== */
.course-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.course-header h1 { font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.breadcrumb { font-size: 13px; color: #555; margin-bottom: 24px; }
.breadcrumb a { color: #888; }
.breadcrumb a:hover { color: #C9A84C; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: #14141f; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px; padding: 32px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-lg { max-width: 600px; }
.modal h3 { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ========== MESSAGES ========== */
.msg-layout { display: flex; height: calc(100vh - 64px); }

.msg-sidebar {
  width: 320px; border-right: 1px solid rgba(255,255,255,0.04);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.msg-sidebar-header {
  padding: 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.msg-sidebar-header h3 { font-size: 18px; color: #fff; }

.conversations-list { flex: 1; overflow-y: auto; }
.conv-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  cursor: pointer; transition: background 0.2s; border-bottom: 1px solid rgba(255,255,255,0.02);
}
.conv-item:hover { background: rgba(255,255,255,0.03); }
.conv-item.active { background: rgba(201,168,76,0.06); border-right: 2px solid #C9A84C; }
.conv-item.unread .conv-name { color: #fff; font-weight: 700; }

.conv-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #C9A84C, #E8D48B);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #0c0c18; flex-shrink: 0;
}
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-size: 14px; color: #ccc; display: flex; align-items: center; gap: 8px; }
.conv-role { font-size: 10px; color: #666; }
.conv-preview { font-size: 12px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.msg-chat { flex: 1; display: flex; flex-direction: column; }
.msg-chat-header {
  padding: 16px 24px; border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex; align-items: center; gap: 10px;
}
.msg-chat-header strong { color: #fff; font-size: 15px; }

.msg-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 8px; }

.msg-bubble { max-width: 70%; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.msg-bubble.sent { background: rgba(201,168,76,0.12); color: #e0e0e8; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-bubble.received { background: rgba(255,255,255,0.05); color: #ccc; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-time { font-size: 10px; color: #555; margin-top: 4px; }

.msg-input { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.04); }
.msg-input form { display: flex; gap: 10px; }
.msg-input .input { flex: 1; border-radius: 50px; padding: 12px 20px; }

/* ========== FILTER BAR ========== */
.filter-bar { display: flex; gap: 10px; }
.filter-bar select { background: rgba(255,255,255,0.04); color: #ccc; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 8px 14px; font-size: 13px; font-family: inherit; }

/* ========== SPINNER ========== */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2); border-radius: 50%;
  border-top-color: #fff; animation: spin 0.7s linear infinite;
  margin-right: 6px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .auth-container { margin: 16px; padding: 32px 24px; position: static; transform: none; }
  .form-row { flex-direction: column; gap: 0; }
  .dash-nav-inner { padding: 0 16px; }
  .dash-main { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .course-header { flex-direction: column; }
  .section-header { flex-direction: column; gap: 12px; align-items: flex-start; }

  /* Messages: stack layout on mobile */
  .msg-layout { flex-direction: column; }
  .msg-sidebar { width: 100%; height: 40vh; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.04); }
  .msg-chat { height: 60vh; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .list-item { flex-direction: column; align-items: flex-start; }
  .list-item-actions { margin-top: 10px; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 10px 8px; }
}
