/* =============================================
   YTMock — Dashboard Layout & Custom Styles
   ============================================= */

/* ── App Layout Structure ── */
html, body {
  overflow-x: hidden;
}

.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* ── Sidebar Styling ── */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: calc(var(--z-sticky) + 1);
  transition: transform var(--transition-base), background-color var(--transition-theme);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: var(--space-6) var(--space-6) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
}

.sidebar-title-wrapper {
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-extrabold);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.sidebar-subtitle {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Sidebar Menu */
.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.sidebar-link.active {
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: var(--accent-glow);
}

.sidebar-link-icon {
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
}

/* Sidebar Premium Promo */
.sidebar-promo {
  margin: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid var(--border-color);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.sidebar-promo-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.sidebar-promo-text {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.sidebar-promo-btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  width: 100%;
}

.sidebar-profile {
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: background-color var(--transition-base);
}

.sidebar-profile:hover {
  background-color: var(--bg-secondary);
}

.sidebar-avatar-wrapper {
  position: relative;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  border: 2px solid var(--bg-secondary);
}

.sidebar-profile-info {
  flex: 1;
  min-width: 0;
}

.sidebar-profile-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-profile-role {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-badge {
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: var(--fw-bold);
}

/* ── Main Content Shell ── */
.main-shell {
  flex: 1;
  margin-left: 260px;
  width: calc(100% - 260px);
  max-width: calc(100% - 260px);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Telegram Banner ── */
.telegram-banner {
  background: var(--accent-gradient, #10b981);
  color: #fff;
  padding: 8px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
  position: relative;
}
.telegram-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}
.telegram-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
}
.telegram-banner-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.telegram-banner-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.2);
}
.telegram-join-btn {
  background: #fff !important;
  color: var(--accent-primary, #10b981) !important;
  border: none !important;
  font-weight: 800;
  padding: 4px 16px;
  border-radius: 20px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.telegram-join-btn:hover {
  background: #f0f0f0 !important;
}

@media (max-width: 768px) {
  .telegram-banner {
    padding: 12px 16px;
  }
  .telegram-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .telegram-join-btn {
    margin-left: 0 !important;
    width: 100%;
  }
}

/* ── Dashboard Header ── */
.dash-header {
  min-height: 70px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  transition: background-color var(--transition-theme);
}

.dash-header-welcome {
  display: flex;
  flex-direction: column;
}

.dash-header-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.dash-header-subtitle {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Search Bar */
.search-wrapper {
  position: relative;
  width: 320px;
  max-width: 100%;
  flex-shrink: 1;
}

.search-input {
  width: 100%;
  min-width: 140px;
  padding: 8px 14px 8px 36px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
  transition: all var(--transition-fast);
}

/* Theme Toggle Button Sizing Override */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 1rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-elevated);
  border-color: var(--border-color);
  transform: rotate(15deg);
}

.search-input:focus {
  border-color: var(--accent-primary);
  background-color: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--accent-primary-muted);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  pointer-events: none;
}

/* Notification Button */
.notif-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition-fast);
}

.notif-btn:hover {
  background-color: var(--bg-elevated);
  border-color: var(--border-color-hover);
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background-color: var(--color-error);
  color: #fff;
  font-size: 0.65rem;
  font-weight: var(--fw-bold);
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
}

/* Notifications Dropdown */
.notif-dropdown {
  position: absolute;
  top: 55px;
  right: 0;
  width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: var(--z-dropdown);
  overflow: hidden;
}

.notif-dropdown.show {
  display: flex;
  animation: fadeInDown 0.2s ease forwards;
}

.notif-dropdown-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-dropdown-body {
  max-height: 280px;
  overflow-y: auto;
}

.notif-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-3);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.notif-item:hover {
  background-color: var(--bg-tertiary);
}

.notif-item-icon {
  font-size: 1.25rem;
}

.notif-item-content {
  flex: 1;
}

.notif-item-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  margin-bottom: 2px;
}

.notif-item-time {
  font-size: 0.65rem;
  color: var(--text-tertiary);
}

/* ── Content View Area ── */
.view-container {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* ── Stats Grid ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}

.stat-card-new {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: all var(--transition-base);
}

.stat-card-new:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

.stat-card-new-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-card-new-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stat-card-new-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--fw-semibold);
}

.stat-card-new-value {
  font-size: var(--fs-xl);
  font-weight: var(--fw-extrabold);
  line-height: 1.2;
}

.stat-card-new-trend {
  font-size: 0.65rem;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-card-new-trend.up { color: var(--color-success); }
.stat-card-new-trend.down { color: var(--color-error); }
.stat-card-new-trend.neutral { color: var(--text-tertiary); }

/* Color classes for stats icons */
.bg-purple-light { background-color: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.bg-green-light { background-color: rgba(34, 197, 94, 0.12); color: #22c55e; }
.bg-orange-light { background-color: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.bg-blue-light { background-color: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.bg-pink-light { background-color: rgba(236, 72, 153, 0.12); color: #ec4899; }

/* ── Dashboard Grid Layouts ── */
.dash-two-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
}

.dash-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.dash-card-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-card-action {
  font-size: var(--fs-xs);
  color: var(--accent-primary);
  font-weight: var(--fw-semibold);
}

/* Continue Mock Card styling */
.continue-mock-card {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  overflow: hidden;
}

.continue-mock-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.continue-mock-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-extrabold);
  margin-bottom: 2px;
}

.continue-mock-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.continue-mock-progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--space-2);
}

.continue-mock-progress-bar {
  height: 8px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  width: 100%;
}

.continue-mock-progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.continue-mock-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2);
}

/* Upcoming Mocks List */
.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.upcoming-item:hover {
  border-color: var(--border-color);
  background: var(--bg-elevated);
}

.upcoming-item-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.upcoming-item-icon {
  width: 56px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  overflow: hidden;
}

.upcoming-item-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-item-date {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Teachers and Playlists (Horizontal Grid) */
.teachers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.teacher-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.teacher-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

.teacher-thumb-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  background-color: var(--bg-elevated);
  overflow: hidden;
}

.teacher-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.teacher-card:hover .teacher-thumb {
  transform: scale(1.05);
}

.teacher-play-btn {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.teacher-card:hover .teacher-play-btn {
  opacity: 1;
}

.teacher-play-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform var(--transition-base);
}

.teacher-card:hover .teacher-play-icon {
  transform: scale(1);
}

.teacher-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 0.6rem;
  font-weight: var(--fw-bold);
  padding: 2px 6px;
  border-radius: 4px;
}

.teacher-card-body {
  padding: var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.teacher-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.teacher-subject {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.teacher-video-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 34px;
}

.teacher-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-tertiary);
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

/* Recent Activity list */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.activity-item-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.activity-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.activity-item-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.activity-item-time {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.activity-item-score {
  font-size: var(--fs-sm);
  font-weight: var(--fw-extrabold);
}

.activity-item-score.success { color: var(--color-success); }

/* Top Subjects Practiced list */
.subject-practices {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.subject-practice-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subject-practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.subject-practice-progress {
  height: 6px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  width: 100%;
}

.subject-practice-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.bg-accent-fill { background: var(--accent-gradient); }

/* ── Mobile Layout Header & Bottom Nav ── */
.mobile-header {
  display: none;
  height: 60px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 var(--space-4);
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.mobile-menu-toggle {
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  z-index: var(--z-sticky);
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: var(--fw-medium);
  text-decoration: none;
  gap: 3px;
  border: none;
  background: none;
}

.mobile-nav-item.active {
  color: var(--accent-primary);
}

.mobile-nav-item-icon {
  font-size: 1.25rem;
}

/* Sidebar Drawer Backdrop on Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-sticky) - 1);
}

/* ── Tab Views Container ── */
.tab-view {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.tab-view.active {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Subjects View Grid */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.subject-card-modern {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.subject-card-modern:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-lg), 0 10px 30px -10px rgba(99, 102, 241, 0.15);
}

.subject-card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.subject-card-modern:hover::before {
  opacity: 1;
}

.subject-card-icon-modern {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  margin-bottom: var(--space-2);
}

.subject-card-icon-modern.math {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.4);
}
.subject-card-icon-modern.reasoning {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.4);
}
.subject-card-icon-modern.english {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 8px 20px -6px rgba(59, 130, 246, 0.4);
}
.subject-card-icon-modern.general-awareness {
  background: linear-gradient(135deg, #ec4899, #be185d);
  box-shadow: 0 8px 20px -6px rgba(236, 72, 153, 0.4);
}
.subject-card-icon-modern.default {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 8px 20px -6px rgba(245, 158, 11, 0.4);
}

.subject-card-title-modern {
  font-family: 'Outfit', sans-serif;
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.subject-card-mocks-modern {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: var(--fw-semibold);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subject-card-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
}

.subject-card-teachers-modern {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.subject-card-teachers-label-modern {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: var(--fw-bold);
}

.subject-card-teachers-list-modern {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.subject-teacher-chip-modern {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
}

.subject-teacher-chip-modern:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.subject-teacher-avatar-modern {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
}

.subject-teacher-chip-modern:hover .subject-teacher-avatar-modern {
  background: var(--accent-primary);
  color: #fff;
}

.subject-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  transition: all var(--transition-base);
  cursor: pointer;
}

.subject-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

.subject-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background-color: var(--bg-tertiary);
}

.subject-card-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.subject-card-count {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

/* Analytics View Cards */
.analytics-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

/* Downloads View Card */
.download-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.download-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.download-badge {
  display: flex;
  gap: var(--space-2);
}

/* ── Responsive Breakpoints ── */
@media (max-width: 1200px) {
  .teachers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .subjects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .dash-two-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-overlay.open {
    display: block;
  }
  
  .main-shell {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
  
  .dash-header {
    display: none;
  }
  
  .mobile-header {
    display: flex;
  }
  
  .mobile-bottom-nav {
    display: flex;
  }
  
  .view-container {
    padding: var(--space-3);
    padding-bottom: 80px;
  }
  
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  
  /* Make playlist cards a horizontal scrolling row on mobile */
  .teachers-grid {
    display: flex;
    overflow-x: auto;
    gap: var(--space-3);
    padding-bottom: var(--space-2);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  
  .teachers-grid::-webkit-scrollbar {
    display: none;
  }
  
  .teachers-grid .teacher-card {
    min-width: 200px;
    max-width: 220px;
    flex-shrink: 0;
  }
  
  .teachers-grid .teacher-card .teacher-thumb {
    height: 120px;
  }
  
  /* Top teachers row: tighter spacing on mobile */
  .top-teachers-horizontal-row {
    gap: var(--space-4);
  }
  
  .top-teacher-item-horizontal {
    min-width: 70px;
  }
  
  .top-teacher-avatar-wrapper {
    width: 46px;
    height: 46px;
  }
  
  .top-teacher-name-horizontal {
    font-size: 0.65rem;
  }
  
  /* Dashboard cards: tighter padding */
  .dash-card {
    padding: var(--space-4);
  }
  
  .dash-card-title {
    font-size: var(--fs-sm);
  }
  
  .dash-two-columns {
    gap: var(--space-4);
  }
  
  .subjects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .analytics-summary {
    grid-template-columns: 1fr;
  }
  
  .download-card {
    flex-direction: column;
    text-align: center;
  }

  /* Section headers: tighter on mobile */
  .section-header {
    flex-direction: column;
    gap: var(--space-3);
    align-items: flex-start;
  }

  .section-title {
    font-size: var(--fs-md);
  }

  /* Profile dropdown hide name text on mobile (keeps avatar) */
  .profile-dropdown-name {
    display: none;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-card-new {
    padding: var(--space-3) var(--space-3);
    gap: var(--space-3);
  }

  .stat-card-new-icon {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .stat-card-new-value {
    font-size: 1.25rem;
  }

  .stat-card-new-label {
    font-size: 0.65rem;
  }
  
  .subjects-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Search Dropdown Styles ── */
.search-results-dropdown {
  position: absolute;
  top: 45px;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  max-height: 350px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  padding: var(--space-2) 0;
}

.search-results-dropdown.show {
  display: flex;
  animation: fadeInDown 0.2s ease forwards;
}

.search-results-category {
  padding: 6px 14px;
  font-size: 0.65rem;
  font-weight: var(--fw-bold);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-tertiary);
  margin-top: 4px;
  margin-bottom: 2px;
}

.search-results-category:first-of-type {
  margin-top: 0;
}

.search-result-item {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-result-item:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary-hover);
}

.search-result-item-icon {
  font-size: 1.1rem;
}

.search-result-item-title {
  font-weight: var(--fw-medium);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.search-no-results {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
}

/* ── Top Teachers Horizontal Row ── */
.top-teachers-horizontal-row {
  display: flex;
  gap: var(--space-6);
  overflow-x: auto;
  padding: var(--space-2) 0;
  scrollbar-width: none;
}

.top-teachers-horizontal-row::-webkit-scrollbar {
  display: none;
}

.top-teacher-item-horizontal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 90px;
  cursor: pointer;
  transition: transform var(--transition-base);
}

.top-teacher-item-horizontal:hover {
  transform: translateY(-2px);
}

.top-teacher-avatar-wrapper {
  position: relative;
  width: 54px;
  height: 54px;
  margin-bottom: var(--space-2);
}

.top-teacher-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border-color);
  background: var(--bg-elevated);
}

.top-teacher-yt-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

.top-teacher-name-horizontal {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  white-space: nowrap;
}

.top-teacher-sub-horizontal {
  font-size: 0.65rem;
  color: var(--text-secondary);
}



/* Header Profile Dropdown */
.profile-dropdown-wrapper {
  position: relative;
}

.profile-dropdown-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-family: 'Outfit', sans-serif;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  height: 38px;
}

.profile-dropdown-btn:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-tertiary);
}

.profile-dropdown-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
}

.profile-dropdown-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dropdown-arrow {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.profile-dropdown-panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  width: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2) 0;
  z-index: 100;
  display: none;
  animation: fadeIn 0.15s ease forwards;
}

.profile-dropdown-panel.show {
  display: block;
}

.profile-dropdown-header {
  padding: var(--space-2) var(--space-4);
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
  text-align: left;
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
}

.profile-dropdown-item {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  background: none;
  border: none;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: all var(--transition-base);
}

.profile-dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.profile-dropdown-item.logout {
  color: var(--color-danger);
}

.profile-dropdown-item.logout:hover {
  background: var(--color-danger-light);
  color: var(--color-danger);
}
