/* ============================================
   EDUSLAVA - Online Education Platform
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #9978a3;
  --primary-hover: #c994c0;
  --primary-dark: #6c5d85;
  --dark: #1a1a2e;
  --dark-nav: #16213e;
  --dark-card: #1e2a45;
  --dark-card-hover: #263352;
  --bg: #0f0f23;
  --bg-light: #1a1a2e;
  --text: #e0e0e0;
  --text-muted: #8892a4;
  --text-bright: #ffffff;
  --border: #2a2a4a;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
  --success: #9978a3;
  --xp-color: #9b59b6;
  --coin-color: #f1c40f;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --transition: all 0.3s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-bright);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* ---------- Container ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   NAVBAR - Primary with Dropdowns
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--dark-nav);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar-brand {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--primary) !important;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.navbar-brand .brand-logo,
.footer .company-name .brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
  background: var(--dark-card);
}

/* Navbar Nav with Dropdowns */
.navbar-nav {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
}

.navbar-nav > li {
  position: relative;
}

.navbar-nav > li > a {
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  transition: var(--transition);
  display: block;
}

.navbar-nav > li > a:hover,
.navbar-nav > li > a.active {
  color: var(--text-bright);
  background: rgba(125, 173, 101, 0.15);
}

/* Dropdown menus */
.nav-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--dark-nav);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  min-width: 180px;
  list-style: none;
  z-index: 1001;
  box-shadow: var(--shadow);
  padding: 4px 0;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li a {
  display: block;
  padding: 8px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.dropdown-menu li a:hover {
  background: rgba(125, 173, 101, 0.1);
  color: var(--text-bright);
}

/* Navbar right side */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-messages-btn {
  color: var(--text-muted) !important;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-messages-btn:hover {
  background: rgba(125, 173, 101, 0.1);
  color: var(--text-bright) !important;
}

.msg-badge {
  background: var(--danger);
  color: white;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 4px;
}

/* Mobile toggle */
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.navbar-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ============================================
   SECONDARY NAV - Account Stats Bar
   ============================================ */
.secondary-nav {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  height: 50px;
}

.secondary-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* User Identity (left side) */
.user-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-link {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: var(--transition);
  object-fit: cover;
  background: var(--dark-card);
}

.account-avatar:hover {
  border-color: var(--primary-hover);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(125, 173, 101, 0.4);
}

.avatar-emoji-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--dark-card);
  transition: var(--transition);
}

.avatar-emoji-btn:hover {
  border-color: var(--primary-hover);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(125, 173, 101, 0.4);
}

.user-nickname-display {
  font-weight: 600;
  color: var(--text-bright);
  font-size: 0.9rem;
}

.course-context {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctx-sep { color: var(--text-muted); }

.course-context-name {
  color: var(--primary) !important;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Account Stats (right side) */
.account-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-stats .stat {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--bg-light);
  border-radius: 20px;
  font-size: 0.8rem;
}

.account-stats .stat-label-text {
  color: var(--text-muted);
  font-weight: 500;
}

.account-stats .stat-val {
  font-weight: 700;
  color: var(--text-bright);
}

.stat-rank { border: 1px solid rgba(243, 156, 18, 0.3); }
.stat-level { border: 1px solid rgba(52, 152, 219, 0.3); }
.stat-xp { border: 1px solid rgba(155, 89, 182, 0.3); }
.stat-coins { border: 1px solid rgba(241, 196, 15, 0.3); }

/* Coin display */
.coin-display {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.gold-coin {
  color: var(--gold);
  font-weight: 700;
}

.gold-coin::before { content: '🪙 '; }

.silver-coin {
  color: var(--silver);
  font-weight: 600;
}

.silver-coin:not(:empty)::before { content: '· '; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  margin-top: 70px;
  padding: 30px 0;
  min-height: calc(100vh - 130px);
}

.main-content.with-secondary {
  margin-top: 120px;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

/* ============================================
   HERO SECTION (Landing page)
   ============================================ */
.hero {
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary), #a8d97f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
}

/* ============================================
   PANELS (Reference-style)
   ============================================ */
.panel {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  margin-bottom: 16px;
}

.panel > .panel-heading:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.panel > .panel-body:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

.panel > .panel-body:first-child:last-child {
  border-radius: var(--radius);
}

.panel-heading {
  padding: 12px 16px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-heading .pull-right {
  margin-left: auto;
}

.panel-heading .badge-counter {
  background: var(--primary);
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.panel-body {
  padding: 16px;
}

/* ============================================
   BADGES DISPLAY
   ============================================ */
.badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.single-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border: 3px solid var(--border);
  background: var(--bg);
  transition: var(--transition);
  cursor: default;
  position: relative;
}

.single-badge.owned {
  border-color: var(--primary);
  background: rgba(125, 173, 101, 0.1);
}

.single-badge.not-owned {
  border-color: var(--border);
  opacity: 0.4;
  filter: grayscale(80%);
}

.single-badge .badge-icon-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.single-badge .badge-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark-nav);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  color: var(--text);
  white-space: nowrap;
  text-align: center;
  z-index: 10;
  box-shadow: var(--shadow);
  pointer-events: none;
}

/* Prevent tooltip from going off-screen on edges */
.single-badge:first-child .badge-tooltip {
  left: 0;
  transform: translateX(0);
}

.single-badge:last-child .badge-tooltip {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.single-badge:hover .badge-tooltip {
  display: block;
}

/* ============================================
   SKILLS PROGRESS BARS (Reference-style)
   ============================================ */
.skill-panel {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
  transition: var(--transition);
  cursor: pointer;
}

.skill-panel:hover {
  border-color: var(--primary);
}

.skill-panel-heading {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
}

.skill-panel-heading .skill-level-badge {
  background: var(--primary);
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.skill-panel-body {
  padding: 0 14px 12px;
}

.skill-progress-bar {
  width: 100%;
  height: 16px;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.skill-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a8d97f);
  border-radius: 8px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  min-width: 30px;
}

.skill-xp-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-light);
}

.card-body {
  padding: 20px;
}

.card-body h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.card-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Project Cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.project-card {
  cursor: pointer;
  position: relative;
}

.project-card .card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--dark-card), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
}

.project-card .author {
  color: var(--primary);
  font-weight: 500;
}

.project-card .card-img-placeholder img.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Project Upload Form */
.upload-center-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.upload-header {
  text-align: center;
  margin-bottom: 28px;
}

.upload-header-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.upload-header h2 {
  margin: 0 0 4px;
}

.upload-header .text-muted {
  font-size: 0.95rem;
}

.project-upload-panel {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px 32px;
}

/* Cover drop zone */
.upload-cover-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.upload-cover-zone:hover {
  border-color: var(--primary);
  background: rgba(125, 173, 101, 0.04);
}

.cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.cover-placeholder-icon {
  font-size: 2.2rem;
}

.cover-preview {
  width: 100%;
}

.cover-preview img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.cover-remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cover-remove-btn:hover {
  background: var(--danger);
}

.required-star {
  color: var(--danger);
}

/* Two-column row */
.upload-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .upload-row-2col { grid-template-columns: 1fr; }
}

/* Styled file input */
.file-input-styled {
  position: relative;
  display: block;
}

.file-input-styled input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-input-label {
  display: block;
  padding: 10px 14px;
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-input-styled:hover .file-input-label {
  border-color: var(--primary);
}

.file-input-label.has-file {
  color: var(--primary);
  border-color: var(--primary);
}

.upload-submit-btn {
  margin-top: 12px;
  font-size: 1.05rem;
  padding: 14px;
  letter-spacing: 0.5px;
}

.gallery-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.gallery-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--border);
  transition: border-color 0.2s;
}

.gallery-preview img:hover {
  border-color: var(--primary);
}

/* Project Detail View */
.project-detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: flex-start;
}

.project-detail-sidebar .panel {
  position: sticky;
  top: 140px;
}

.project-author-avatar {
  font-size: 4rem;
  margin-bottom: 12px;
}

.project-detail-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.project-detail-cover {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

.project-detail-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.project-cover-emoji {
  font-size: 6rem;
  text-align: center;
  padding: 40px;
  background: linear-gradient(135deg, var(--dark-card), var(--border));
  border-radius: 10px;
}

.project-detail-embed {
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
}

.project-detail-embed iframe {
  width: 100%;
  min-height: 400px;
  border: none;
  border-radius: 10px;
}

.project-detail-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.project-detail-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 24px;
}

.project-detail-gallery {
  margin-bottom: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.gallery-thumb-img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.gallery-thumb-img:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.project-detail-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.vote-count {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 768px) {
  .project-detail-layout {
    grid-template-columns: 1fr;
  }
  .project-detail-sidebar .panel {
    position: static;
  }
}

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px dashed var(--border);
}

.section-title h2 {
  font-size: 1.5rem;
}

.section-title .badge-count {
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  justify-content: center;
  font-family: inherit;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(125, 173, 101, 0.4);
}

.btn-secondary {
  background: var(--dark-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
  color: white;
}

.btn-warning {
  background: #f39c12;
  color: white;
}

.btn-warning:hover {
  background: #e67e22;
  color: white;
}

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

.btn-success:hover {
  background: #27ae60;
  color: white;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.btn-group {
  display: flex;
  gap: 6px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  transition: var(--transition);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(125, 173, 101, 0.2);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238892a4' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-group-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-group-inline .form-control {
  flex: 1;
}

/* ============================================
   LOGIN CARD
   ============================================ */
.login-card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 420px;
  margin: 60px auto;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 30px;
}

.login-card .brand-logo {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 50px 60px;
  max-width: 800px;
  margin: 30px auto;
}

.about-card .about-logo {
  text-align: center;
  margin-bottom: 30px;
}

.about-card .about-logo span {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 3px;
}

.about-card h2 {
  text-align: center;
  margin-bottom: 20px;
}

.about-card p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.8;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--dark-nav);
  border-top: 1px solid var(--border);
  padding: 30px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer .company-name {
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 2px;
  font-size: 1.1rem;
}

/* ============================================
   BACK LINK
   ============================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted) !important;
  font-size: 0.9rem;
  margin-bottom: 16px;
  padding: 6px 0;
}

.back-link:hover {
  color: var(--primary) !important;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.course-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  max-width: 400px;
}

.course-search-bar .form-control {
  flex: 1;
}

/* ============================================
   CHALLENGES - Courses
   ============================================ */
.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.course-card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.course-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.course-card .course-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.course-card h3 {
  margin-bottom: 8px;
}

.course-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Course Header Row */
.course-header-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.half-panel {
  max-width: 600px;
}

/* ============================================
   TOPICS
   ============================================ */
.topic-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.topic-card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
}

.topic-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.topic-card .topic-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.topic-card h4 { margin-bottom: 6px; }
.topic-card p { color: var(--text-muted); font-size: 0.85rem; }
.topic-card .task-count {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

/* ============================================
   NAV PILLS (Topic sub-tabs)
   ============================================ */
.nav-pills {
  display: flex;
  list-style: none;
  gap: 4px;
  margin-bottom: 24px;
  padding: 0;
}

.nav-pills li a {
  display: block;
  padding: 8px 20px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.nav-pills li.active a,
.nav-pills li a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================
   TASKS - Thumbnail Card Grid (Reference Style)
   ============================================ */
.task-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.task-thumbnail {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.task-thumbnail:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.task-thumbnail .task-thumb-img {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--bg-light), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.task-thumbnail .task-thumb-body {
  padding: 16px;
}

.task-thumbnail .task-thumb-body h4 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.task-thumbnail .task-thumb-body p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  min-height: 32px;
}

.task-rewards-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.reward-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.reward-xp {
  background: rgba(155, 89, 182, 0.2);
  color: var(--xp-color);
}

.reward-coins {
  background: rgba(241, 196, 15, 0.2);
  color: var(--coin-color);
}

.task-thumbnail .task-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.task-completion {
  margin-top: 8px;
}

.task-completion .label-incomplete {
  background: rgba(52, 152, 219, 0.2);
  color: var(--info);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.task-completion .label-completed {
  background: rgba(46, 204, 113, 0.2);
  color: var(--success);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.task-completion .label-locked {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Old task list style (kept for compatibility) */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-item {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 20px;
  align-items: center;
  transition: var(--transition);
}

.task-item:hover {
  border-color: var(--primary);
}

.task-item .task-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
}

.task-item .task-info h4 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.task-item .task-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.task-item .task-info .tutorial-link {
  font-size: 0.8rem;
  color: var(--info);
}

.task-rewards {
  text-align: right;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .sep {
  color: var(--border);
}

/* ============================================
   SHOP / STORE - Product Grid (Reference Style)
   ============================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product-card .product-img {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--bg-light), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.product-card .product-body {
  padding: 16px;
}

.product-card .product-body h4 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.product-card .product-body p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.product-card .product-buy-btn {
  display: flex;
  width: 100%;
}

.product-card .buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.product-card .buy-btn:hover {
  background: #27ae60;
}

.product-card .buy-btn .price-badge {
  background: rgba(0,0,0,0.2);
  padding: 2px 10px;
  border-radius: 15px;
  margin-left: 8px;
}

/* Shop Tabs */
.shop-tabs-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
}

.shop-tab-btn {
  padding: 10px 24px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.shop-tab-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}

.shop-tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Legacy shop grid (compatibility) */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.shop-item {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.shop-item:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.shop-item .shop-img {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--bg-light), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.shop-item .shop-body {
  padding: 16px;
}

.shop-item .shop-body h4 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.shop-item .shop-body p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.shop-item .shop-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shop-item .price-tag {
  font-weight: 700;
  color: var(--coin-color);
  font-size: 1.1rem;
}

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.leaderboard-tabs .tab-btn {
  padding: 10px 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  font-size: 0.9rem;
  font-family: inherit;
}

.leaderboard-tabs .tab-btn:hover {
  color: var(--text);
}

.leaderboard-tabs .tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.leaderboard-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.leaderboard-type-tabs .type-btn {
  padding: 6px 16px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.leaderboard-type-tabs .type-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.leaderboard-table tr:hover td {
  background: rgba(125, 173, 101, 0.05);
}

.leaderboard-table .rank-cell {
  width: 60px;
  font-weight: 700;
}

.rank-1 { color: var(--gold); }
.rank-2 { color: var(--silver); }
.rank-3 { color: #cd7f32; }

.leaderboard-table .user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leaderboard-table .user-cell .lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dark-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ============================================
   MESSAGES
   ============================================ */
.messages-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 24px;
  min-height: 400px;
}

.messages-list {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-y: auto;
  max-height: 600px;
}

.message-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.message-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.message-item .msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.message-item .msg-from {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
}

.message-item .msg-to {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.message-item .msg-date {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.message-item .msg-body {
  color: var(--text);
  font-size: 0.9rem;
}

.message-compose {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.message-compose h4 {
  margin-bottom: 16px;
  font-size: 1rem;
}

/* ============================================
   CHARACTER PREVIEW MODAL (RPG Style)
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-content.char-modal {
  max-width: 900px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

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

/* Character Preview Layout */
.row-layout {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 20px;
}

.char-col-left,
.char-col-mid,
.char-col-right {
  min-width: 0;
}

.char-avatar-big {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 4px solid var(--primary);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.profile-edit-link {
  font-size: 0.8rem;
  color: var(--text-muted) !important;
  display: block;
  margin-bottom: 8px;
}

.profile-edit-link:hover {
  color: var(--primary) !important;
}

.char-name {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.char-role-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.char-edit-form {
  margin-top: 8px;
}

/* Char stats grid (inside modal bottom) */
.char-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  text-align: left;
  margin-top: 20px;
}

.char-stat-item {
  background: var(--bg);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.char-stat-item .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.char-stat-item .stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
}

.xp-progress {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  margin-top: 6px;
  overflow: hidden;
}

.xp-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a8d97f);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Files grid */
.files-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text);
  transition: var(--transition);
}

.file-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.file-item .file-icon {
  font-size: 1.2rem;
}

.empty-state-sm {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 12px;
  text-align: center;
}

/* ============================================
   ADMIN CMS
   ============================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 70px);
}

.admin-sidebar {
  background: var(--dark-nav);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  overflow-y: auto;
}

.admin-sidebar h3 {
  padding: 0 20px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.admin-sidebar .sidebar-nav {
  list-style: none;
}

.admin-sidebar .sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.admin-sidebar .sidebar-nav li a:hover,
.admin-sidebar .sidebar-nav li a.active {
  color: var(--text-bright);
  background: rgba(125, 173, 101, 0.1);
  border-left-color: var(--primary);
}

.admin-sidebar .sidebar-nav li a .nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.admin-main {
  padding: 30px;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h2 {
  font-size: 1.5rem;
}

/* Admin Table */
.admin-table-wrapper {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.admin-table tr:hover td {
  background: rgba(125, 173, 101, 0.05);
}

.admin-table .actions {
  display: flex;
  gap: 6px;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

/* Admin Modal */
.admin-modal {
  max-width: 600px;
}

/* ============================================
   BADGE TAGS
   ============================================ */
.badge-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-admin {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

.badge-user {
  background: rgba(52, 152, 219, 0.2);
  color: var(--info);
}

.badge-yes {
  background: rgba(46, 204, 113, 0.2);
  color: var(--success);
}

.badge-no {
  background: rgba(149, 165, 166, 0.2);
  color: var(--text-muted);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.tabs .tab {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  font-size: 0.9rem;
  font-family: inherit;
}

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

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

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-gold { color: var(--gold); }
.text-xp { color: var(--xp-color); }
.pull-right { float: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.gap-2 { gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .project-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .task-item { grid-template-columns: 1fr; gap: 12px; }
  .task-rewards { text-align: left; }
  .navbar-toggle { display: flex; }
  .navbar-nav { 
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--dark-nav);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
  }
  .navbar-nav.open { display: flex; }
  .nav-dropdown .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 20px;
  }
  .secondary-nav-inner { flex-wrap: wrap; height: auto; padding: 8px 20px; }
  .account-stats { flex-wrap: wrap; gap: 8px; }
  .char-stats-grid { grid-template-columns: 1fr; }
  .about-card { padding: 30px 20px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .task-card-grid { grid-template-columns: 1fr 1fr; }
  .row-layout { grid-template-columns: 1fr; }
  .modal-content.char-modal { max-width: 95%; padding: 20px; }
  .messages-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .login-card { padding: 24px; margin: 20px auto; }
  .container { padding: 0 12px; }
  .leaderboard-tabs { flex-wrap: wrap; }
  .task-card-grid { grid-template-columns: 1fr; }
  .course-list { grid-template-columns: 1fr; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

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

.slide-up {
  animation: slideUp 0.5s ease forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.1rem;
}

/* ============================================
   ADMIN USER SELECTOR (for task completion)
   ============================================ */
.admin-user-selector {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(125, 173, 101, 0.1));
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.admin-selector-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-selector-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffd700;
  white-space: nowrap;
}

.admin-selector-search {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.admin-selector-search .form-control {
  padding-right: 10px;
  font-size: 0.85rem;
}

.admin-user-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow);
}

.admin-user-dropdown .admin-user-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-user-dropdown .admin-user-option:hover {
  background: rgba(125, 173, 101, 0.15);
  color: var(--text-bright);
}

.admin-user-dropdown .admin-user-option .user-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.admin-selected-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-bright);
  white-space: nowrap;
}

.admin-selected-user #adminSelectedUserName {
  padding: 4px 10px;
  background: rgba(125, 173, 101, 0.15);
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary);
}

/* ========================= BONUS REWARDS ========================= */
.bonus-container {
  margin-top: 20px;
}

.bonus-rewards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.bonus-reward-card {
  border: 1px solid var(--primary) !important;
  background: rgba(125, 173, 101, 0.05) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bonus-reward-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(125, 173, 101, 0.2);
}
