/* ========================================
   MODERN GLASSMORPHISM DASHBOARD STYLES
   Professional, Minimal, Native Look
======================================== */

.dashboard-body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Glowing Orbs for Glassmorphism Context */
.dashboard-body::before,
.dashboard-body::after {
  content: '';
  position: fixed;
  width: 50vw;
  height: 50vh;
  border-radius: 50%;
  filter: blur(140px);
  -webkit-filter: blur(140px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.15;
}

.dashboard-body::before {
  top: -10%;
  left: -10%;
  background: var(--accent-primary);
}

.dashboard-body::after {
  bottom: -10%;
  right: -10%;
  background: var(--info);
}

.dashboard-container {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  padding-top: var(--header-h);
  position: relative;
  z-index: 1;
  max-width: 1800px;
  margin: 0 auto;
}

/* ========================================
   SIDEBAR (Glass Drawer on Mobile, Fixed on Desktop)
======================================== */
.dashboard-sidebar {
  width: 280px;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

/* Sidebar Scrollbar hidden for neatness */
.dashboard-sidebar::-webkit-scrollbar {
  display: none;
}

.dashboard-sidebar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.user-profile-summary {
  padding: 2.5rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar-container {
  position: relative;
  width: 86px;
  height: 86px;
  margin-bottom: 1.25rem;
}

.avatar-container img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.avatar-container:hover img {
  transform: scale(1.05);
  border-color: var(--accent-primary);
}

.status-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background-color: var(--success);
  border: 3px solid rgba(17, 24, 39, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--success-light);
}

.user-profile-summary h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.2px;
  margin-bottom: 0.5rem;
}

.user-rank {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--accent-primary);
  background: rgba(245, 158, 11, 0.15);
  padding: 0.3rem 0.8rem;
  border-radius: 2rem;
  font-weight: 600;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
  border-radius: 14px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2px;
  opacity: 0.7;
  transition: all 0.25s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

/* Subtle glowing accent line for active tab */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-primary);
}

.nav-item.active svg {
  color: var(--accent-primary);
  opacity: 1;
}

.sidebar-footer {
  padding: 1.5rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.logout-btn {
  width: 100%;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fff;
  border-color: #ef4444;
}

/* ========================================
   MAIN CONTENT AREA
======================================== */
.dashboard-content {
  flex: 1;
  margin-left: 280px;
  padding: 2.5rem 3rem 4rem;
  width: calc(100% - 280px);
}

/* Tabs Animation */
.dashboard-tab {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.dashboard-tab.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Header */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.header-text h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wave {
  display: inline-block;
  animation: wave 2.5s infinite;
  transform-origin: 70% 70%;
  -webkit-text-fill-color: initial;
}

@keyframes wave {
  0% {
    transform: rotate(0deg);
  }

  10% {
    transform: rotate(14deg);
  }

  20% {
    transform: rotate(-8deg);
  }

  30% {
    transform: rotate(14deg);
  }

  40% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(10deg);
  }

  60% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.header-text p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 400;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.header-actions .btn-primary {
  padding: 0.85rem 1.75rem;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* ========================================
   GLASS CARDS & WIDGETS
======================================== */
.dashboard-card {
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  min-width: 0;
  overflow: hidden;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
}

.card-header h3 svg {
  color: var(--accent-primary);
  width: 20px;
  height: 20px;
}

.view-all {
  color: var(--accent-primary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
}

.view-all:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ========================================
   STATS GRID
======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.3), 0 0 20px rgba(245, 158, 11, 0.2);
}

.stat-icon.primary {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.2);
}

.stat-icon.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.3), 0 0 20px rgba(16, 185, 129, 0.2);
}

.stat-icon.info {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.3), 0 0 20px rgba(139, 92, 246, 0.2);
}

.stat-info h3 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.2rem;
}

.stat-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ========================================
   WIDGET GRID
======================================== */
.dashboard-widgets-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.widget-column {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-width: 0;
}

/* Lists and Items */
.list-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.list-item {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
  gap: 1.25rem;
  min-width: 0;
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.item-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-icon.win {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.item-icon.loss {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.item-icon.draw {
  background: rgba(148, 163, 184, 0.15);
  color: #9ca3af;
}

.item-details {
  min-width: 0;
  flex: 1;
}

.item-details h4 {
  font-size: 1rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-details p {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
}

.badge.success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.badge.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.badge.neutral {
  background: rgba(148, 163, 184, 0.2);
  color: #9ca3af;
}

.badge.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Schedule List Specifics */
.schedule-item {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  gap: 1.25rem;
}

.date-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
  min-width: 65px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.date-box .day {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.date-box .month {
  display: block;
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 700;
  text-transform: uppercase;
}

.btn-icon-custom {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s ease;
}

.btn-icon-custom:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Puzzle Card */
.puzzle-preview {
  margin: 1rem 0 1.5rem;
  padding: 2.5rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s;
}

.puzzle-preview:hover {
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.35);
}

/* ========================================
   COURSES GRID
======================================== */
.course-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.course-card.add-course {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.01);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  box-shadow: none;
  cursor: pointer;
}

.course-card.add-course:hover {
  border-color: var(--accent-primary);
  background: rgba(245, 158, 11, 0.05);
}

.course-card .course-image-placeholder {
  height: 150px;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gradient-1 {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.gradient-2 {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.gradient-3 {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.course-card .card-body {
  padding: 1.5rem;
}

/* ========================================
   RESPONSIVE DESIGN (Fixing the Desktop/Mobile layout issue)
======================================== */

.mobile-drawer-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 10px;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 50;
  align-items: center;
  justify-content: center;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 35;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (max-width: 1024px) {
  .dashboard-widgets-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-drawer-toggle {
    display: flex;
    margin-right: 1rem;
  }

  .content-header .header-text {
    display: flex;
    align-items: center;
  }

  /* Make sidebar a drawer */
  .dashboard-sidebar {
    transform: translateX(-100%);
    width: 280px;
    background: rgba(17, 24, 39, 0.85);
    /* Darker on mobile */
  }

  .dashboard-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  /* Reset main content width/margin */
  .dashboard-content {
    margin-left: 0;
    width: 100%;
    padding: 1.5rem;
  }

  .content-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card {
    padding: 1.25rem;
  }
}

.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }
}


/* Simple fade in animations */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}