/* ==========================================================================
   勉強Tube (BenkyouTube) Core Design System & Stylesheet
   Theme: Modern Dark Mode, Neon Cyan/Purple Accents, Glassmorphism
   ========================================================================== */

/* --- Custom Property Design Tokens --- */
:root {
  --font-main: 'Noto Sans JP', 'Outfit', sans-serif;
  --font-numbers: 'Outfit', sans-serif;

  /* Color Palette */
  --color-bg-dark: #0a0b12;
  --color-bg-panel: rgba(20, 22, 38, 0.65);
  --color-border: rgba(255, 255, 255, 0.07);
  --color-border-hover: rgba(0, 242, 254, 0.4);

  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;

  --color-neon-cyan: #00f2fe;
  --color-neon-purple: #9d4edd;
  --color-gradient-primary: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --color-gradient-neon: linear-gradient(135deg, #9d4edd 0%, #00f2fe 100%);
  
  --shadow-neon-cyan: 0 0 15px rgba(0, 242, 254, 0.4);
  --shadow-neon-purple: 0 0 15px rgba(157, 78, 221, 0.4);
  --shadow-panel: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--color-bg-dark);
  color: var(--color-text-primary);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.5;
}

/* --- Utilities --- */
.hidden {
  display: none !important;
}

/* --- Layout Grid --- */
.app-container {
  display: grid;
  grid-template-columns: 260px 1fr 340px;
  height: 100vh;
  width: 100vw;
}

/* --- 1. LEFT SIDEBAR --- */
.sidebar {
  background: rgba(13, 14, 25, 0.85);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 24px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--color-neon-cyan);
  filter: drop-shadow(0 0 6px rgba(0, 242, 254, 0.6));
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-name span {
  color: transparent;
  background: var(--color-gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  font-style: italic;
}

/* User Profile Card */
.profile-card {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(12px);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.avatar-container {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.avatar {
  font-size: 32px;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-neon-purple);
  box-shadow: var(--shadow-neon-purple);
  transition: var(--transition-smooth);
}

.avatar-container:hover .avatar {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(157, 78, 221, 0.7);
}

.level-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--color-gradient-neon);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  font-family: var(--font-numbers);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.profile-info {
  text-align: center;
}

.profile-name {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 6px;
}

.admin-badge {
  background: var(--color-gradient-neon);
  color: var(--color-bg-dark);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.5px;
}

.xp-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.xp-bar-wrapper {
  background: rgba(255, 255, 255, 0.08);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: var(--color-gradient-primary);
  box-shadow: var(--shadow-neon-cyan);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.xp-text {
  font-size: 11px;
  font-family: var(--font-numbers);
  color: var(--color-text-secondary);
}

/* Nav Menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-primary);
}

.nav-item.active {
  background: rgba(0, 242, 254, 0.08);
  color: var(--color-neon-cyan);
  border-left: 3px solid var(--color-neon-cyan);
  box-shadow: inset 5px 0 15px rgba(0, 242, 254, 0.05);
}

.nav-icon {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.admin-logout-link {
  display: block;
  font-size: 9px;
  color: var(--color-text-secondary);
  text-decoration: underline;
  cursor: pointer;
  margin-top: 6px;
  transition: var(--transition-smooth);
}

.admin-logout-link:hover {
  color: #ef4444;
}

/* --- 2. CENTER PANEL (MAIN CONTENT) --- */
.main-content {
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

/* Top header bar styling */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

#page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Search styling */
.search-box {
  display: flex;
  align-items: center;
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 30px;
  padding: 8px 16px;
  width: 320px;
  transition: var(--transition-smooth);
}

.search-box:focus-within {
  border-color: var(--color-neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--color-text-secondary);
  margin-right: 8px;
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  outline: none;
  font-size: 13px;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--color-text-muted);
}

/* Tab Content Visibility */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.tab-content.active {
  display: flex;
}

/* Dashboard banner */
.dashboard-banner {
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.15) 0%, rgba(0, 242, 254, 0.1) 100%), var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.dashboard-banner::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: var(--color-gradient-neon);
  filter: blur(80px);
  opacity: 0.3;
}

.banner-text h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.banner-text p {
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* Video Grid and Cards */
.section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  border-left: 3px solid var(--color-neon-purple);
  padding-left: 8px;
}

.video-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.video-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-hover);
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.05), 0 0 12px rgba(0, 242, 254, 0.1);
}

.video-thumbnail-container {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: var(--transition-smooth);
}

.video-card:hover .video-thumbnail {
  opacity: 1;
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 11, 18, 0.8);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-neon-cyan);
  opacity: 0;
  transition: var(--transition-smooth);
}

.video-card:hover .play-overlay {
  opacity: 1;
  box-shadow: var(--shadow-neon-cyan);
}

.play-overlay svg {
  width: 18px;
  height: 18px;
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  font-size: 11px;
  font-family: var(--font-numbers);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Delete Video Button Overlay (Admin Only) */
.delete-video-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 14px;
  opacity: 0;
  transform: scale(0.9);
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.video-card:hover .delete-video-btn {
  opacity: 0.8;
  transform: scale(1);
}

.delete-video-btn:hover {
  opacity: 1 !important;
  background: #ef4444;
  transform: scale(1.1) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* Edit Video Button Overlay (Admin Only) */
.edit-video-btn {
  position: absolute;
  top: 12px;
  right: 48px;
  left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 13px;
  opacity: 0;
  transform: scale(0.9);
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.video-card:hover .edit-video-btn {
  opacity: 0.8;
  transform: scale(1);
}

.edit-video-btn:hover {
  opacity: 1 !important;
  background: var(--color-neon-cyan);
  transform: scale(1.1) !important;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
}


.video-info {
  padding: 0;
  flex-grow: 1;
  min-width: 0;
}

.video-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.video-channel {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.video-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--color-text-secondary);
}

/* Category Filter Tags (Library Tab) */
.filter-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  align-items: center;
  width: 100%;
}

.filter-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-main);
  transition: var(--transition-smooth);
}

.filter-tag:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--color-text-primary);
}

.filter-tag.active {
  background: var(--color-gradient-primary);
  color: var(--color-bg-dark);
  font-weight: 500;
  border-color: transparent;
  box-shadow: var(--shadow-neon-cyan);
}

/* --- Focus Mode Player --- */
.focus-player-container {
  display: none; /* Controlled via JS */
  flex-direction: column;
  gap: 20px;
}

.focus-player-container.active {
  display: flex;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  width: fit-content;
  transition: var(--transition-smooth);
}

.back-btn:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.player-wrapper {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.iframe-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.iframe-container iframe,
.iframe-container #youtube-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.player-details {
  padding: 20px;
}

#playing-video-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.player-tags {
  display: flex;
  gap: 8px;
}

.player-tag {
  background: rgba(0, 242, 254, 0.1);
  color: var(--color-neon-cyan);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
}

/* Notes Pad */
.notes-card {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notes-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.save-status {
  font-size: 11px;
  color: var(--color-text-muted);
}

.notes-card textarea {
  background: rgba(10, 11, 18, 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-main);
  font-size: 13px;
  padding: 12px;
  resize: vertical;
  min-height: 120px;
  outline: none;
  transition: var(--transition-smooth);
}

.notes-card textarea:focus {
  border-color: var(--color-neon-purple);
  box-shadow: 0 0 10px rgba(157, 78, 221, 0.15);
}

/* Roadmap styles */
.roadmap-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.roadmap-card {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
}

.roadmap-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.roadmap-card p {
  color: var(--color-text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
}

.roadmap-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 20px;
}

.roadmap-steps::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.roadmap-step {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.step-num {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #334155;
  color: var(--color-text-primary);
  font-size: 9px;
  font-family: var(--font-numbers);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: -20px;
  border: 2px solid var(--color-bg-dark);
}

.roadmap-step.completed .step-num {
  background: var(--color-neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
}

.roadmap-step.active .step-num {
  background: var(--color-neon-purple);
  box-shadow: var(--shadow-neon-purple);
}

.step-title {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.roadmap-step.completed .step-title {
  color: var(--color-text-primary);
  text-decoration: line-through;
  opacity: 0.6;
}

.roadmap-step.active .step-title {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* --- 3. RIGHT PANEL --- */
.right-panel {
  background: rgba(13, 14, 25, 0.85);
  border-left: 1px solid var(--color-border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.widget-card {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-panel);
}

.widget-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 16px;
}

/* Pomodoro Timer widget specifics */
.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-modes {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 30px;
  padding: 4px;
  width: 100%;
  margin-bottom: 24px;
}

.timer-mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-main);
  font-size: 11px;
  padding: 6px 4px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.timer-mode-btn:hover {
  color: var(--color-text-primary);
}

.timer-mode-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-neon-purple);
  font-weight: 600;
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.02);
}

.timer-display-container {
  position: relative;
  width: 190px;
  height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 6px;
}

.progress-ring-circle {
  fill: none;
  stroke: var(--color-neon-purple);
  stroke-width: 6px;
  stroke-linecap: round;
  stroke-dasharray: 553;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
  filter: drop-shadow(0 0 4px rgba(157, 78, 221, 0.4));
}

.timer-time {
  font-size: 38px;
  font-family: var(--font-numbers);
  font-weight: 600;
  letter-spacing: -0.5px;
  z-index: 2;
}

.timer-status {
  font-size: 11px;
  color: var(--color-text-secondary);
  z-index: 2;
  margin-top: 4px;
}

.timer-controls {
  display: flex;
  gap: 16px;
  width: 100%;
}

.control-btn {
  flex: 1;
  height: 44px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.play-btn {
  background: var(--color-gradient-neon);
  border-color: transparent;
  color: var(--color-bg-dark);
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon-purple);
}

.reset-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-secondary);
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.btn-icon.hidden {
  display: none;
}

/* Quick stats widget */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.stat-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stat-value {
  font-size: 18px;
  font-family: var(--font-numbers);
  font-weight: 600;
  color: var(--color-neon-cyan);
}

.stat-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* --- 4. ADMIN ADD VIDEO MODAL --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 9, 15, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: rgba(20, 22, 38, 0.9);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 28px;
  width: 460px;
  max-width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--shadow-neon-purple);
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(16px);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-neon-cyan);
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  color: var(--color-text-primary);
  transform: rotate(90deg);
}

#add-video-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.form-group input,
.form-group select {
  background: rgba(10, 11, 18, 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 10px 12px;
  color: var(--color-text-primary);
  font-family: var(--font-main);
  font-size: 13px;
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--color-neon-purple);
  box-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
}

.input-tip {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
}

.form-btn {
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-main);
  transition: var(--transition-smooth);
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--color-text-primary);
}

.submit-btn {
  background: var(--color-gradient-neon);
  color: var(--color-bg-dark);
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-neon-purple);
}

/* --- Scrollbar Customizations --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* --- Responsiveness & Adjustments --- */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 80px 1fr 300px;
  }
  .brand-name, .profile-info, .sidebar-footer {
    display: none;
  }
  .sidebar {
    align-items: center;
    padding: 20px 8px;
  }
  .avatar-container {
    margin: 0;
  }
  .level-badge {
    right: -2px;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .nav-item span, .nav-item::after {
    display: none;
  }
}

/* --- Footer Admin Row & Lock Button --- */
.footer-admin-row {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
}

.admin-login-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  opacity: 0.35;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.admin-login-btn:hover {
  opacity: 1;
  color: var(--color-neon-cyan);
  background: rgba(255, 255, 255, 0.05);
}

.lock-icon {
  width: 14px;
  height: 14px;
}

/* --- Admin Review Box & Custom Descriptions --- */
.admin-review-box {
  margin-top: 15px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--color-neon-purple);
  padding: 12px 16px;
  border-radius: 4px;
}

.admin-review-box h4 {
  font-size: 13px;
  color: var(--color-neon-purple);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.admin-review-box p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Category Badge Colors */
.cat-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-right: 6px;
  display: inline-block;
  border: 1px solid transparent;
}

.cat-badge.cat-math {
  background: rgba(0, 242, 254, 0.15);
  color: var(--color-neon-cyan);
  border-color: rgba(0, 242, 254, 0.3);
}

.cat-badge.cat-english {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.cat-badge.cat-programming {
  background: rgba(157, 78, 221, 0.15);
  color: var(--color-neon-purple);
  border-color: rgba(157, 78, 221, 0.3);
}

.cat-badge.cat-science {
  background: rgba(57, 255, 20, 0.15);
  color: #39FF14;
  border-color: rgba(57, 255, 20, 0.3);
}

.cat-badge.cat-bgm {
  background: rgba(255, 0, 127, 0.15);
  color: #ff007f;
  border-color: rgba(255, 0, 127, 0.3);
}

/* --- Mobile Responsive Styling (max-width: 768px) --- */
@media (max-width: 768px) {
  /* 0. Unlock HTML and Body scrolling */
  html, body {
    overflow-y: auto !important;
    height: auto !important;
  }

  /* 1. App Container: Grid to vertical stack */
  .app-container {
    display: flex;
    flex-direction: column;
    height: auto !important;
    min-height: 100vh;
    overflow-y: visible !important;
    width: 100% !important;
  }

  /* 2. Convert Sidebar to Fixed Bottom Navigation Bar */
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60px;
    z-index: 1000;
    background: rgba(10, 11, 18, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-border);
    flex-direction: row !important;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px !important;
    margin: 0;
    border-right: none;
  }

  .brand, .profile-card, .sidebar-footer {
    display: none !important; /* Hide desktop specific sidebar parts */
  }

  .nav-menu {
    flex-direction: row !important;
    width: 100%;
    margin: 0;
    gap: 0;
    justify-content: space-around;
  }

  .nav-item {
    flex: 1;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 4px 0 !important;
    gap: 2px;
    font-size: 10px !important;
    border-radius: 8px;
    background: transparent !important;
    color: var(--color-text-secondary);
  }

  .nav-item span {
    display: inline-block !important; /* Force text to show on mobile bottom nav */
  }

  .nav-item.active {
    color: var(--color-neon-cyan);
    text-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
  }

  .nav-item::after {
    display: none !important; /* Hide sidebar active bar indicator */
  }

  .nav-icon {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
  }

  /* 3. Main Center Content adjustment */
  .main-content {
    padding: 16px;
    padding-bottom: 80px; /* Leave space for bottom nav */
    overflow-y: visible !important;
    height: auto !important;
  }

  .top-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 20px;
  }

  #page-title {
    font-size: 20px;
  }

  /* 4. Right Panel: Stack at the bottom of the page */
  .right-panel {
    width: 100%;
    padding: 24px 16px;
    padding-bottom: 90px; /* Space for bottom nav + buffer */
    background: rgba(10, 11, 18, 0.5);
    border-left: none;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .widget-card {
    width: 100%;
  }

  /* 5. Mobile Video Card Layout Tuning */
  .video-card {
    gap: 12px;
    padding: 12px;
  }

  .video-thumbnail-container {
    width: 80px;
    height: 80px;
    border-radius: 8px;
  }

  .video-card-title {
    font-size: 14px;
    -webkit-line-clamp: 1;
    height: 1.4em;
  }

  .video-description {
    font-size: 11px;
    height: auto !important;
    line-height: 1.4;
  }

  /* Modal responsive adjustment */
  .modal-card {
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
  }
}

/* --- Glassmorphic Overlay Screen to Block Related Videos --- */
.player-overlay-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 11, 18, 0.9); /* Dark backdrop mask */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: var(--transition-smooth);
}

.player-overlay-screen.active {
  display: flex;
}

.overlay-content {
  text-align: center;
  padding: 30px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  max-width: 90%;
  animation: scaleUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleUp {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.overlay-content h3 {
  font-size: 20px;
  color: var(--color-text-primary);
  margin-bottom: 8px;
  font-weight: 700;
}

.overlay-content p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.resume-btn {
  background: var(--color-gradient-primary);
  color: var(--color-bg-dark);
  border: none;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-neon-cyan);
}

.resume-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.6);
}

/* --- Recent Videos Sidebar Selector --- */
#player-recent-videos-list::-webkit-scrollbar {
  width: 4px;
}
#player-recent-videos-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
#player-recent-videos-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
#player-recent-videos-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-neon-cyan);
}

.recent-video-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.recent-video-item:hover {
  background: rgba(0, 242, 254, 0.05);
  border-color: rgba(0, 242, 254, 0.2);
  transform: translateX(4px);
}

.recent-video-item.active {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.4);
}

.recent-video-thumb {
  width: 50px;
  height: 35px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.recent-video-text {
  flex-grow: 1;
  min-width: 0;
}

.recent-video-title {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-video-channel {
  font-size: 10px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* List Tab Button Styling */
.list-tab-btn.active {
  background: rgba(0, 242, 254, 0.08) !important;
  color: var(--color-neon-cyan) !important;
}

.list-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
}




