:root {
  --sidebar-width: 280px; 
  --header-height: 80px;
  
  /* Creation Studio Design System - Black/Blue Theme */
  --cs-primary: #000000;
  --cs-secondary: #1d1d1f;
  --accent: #2997ff; /* Blue accent replacing purple */
  --accent-glow: rgba(41, 151, 255, 0.5);
  --accent-soft: rgba(41, 151, 255, 0.1);
  
  --bg-darker: #000000;
  --bg-panel: rgba(29, 29, 31, 0.7);
  --bg-card: rgba(255, 255, 255, 0.04);
  --border-color: rgba(255, 255, 255, 0.08);
  --card-hover-bg: rgba(255, 255, 255, 0.07);
  --card-hover-border: rgba(41, 151, 255, 0.3);
  
  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --glass-blur: 20px;
  
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 24px;
}

body {
  background-color: var(--bg-darker);
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
}

/* App Shell Layout */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: 10;
}

/* Glassy Sidebar - Apple-inspired */
.sidebar {
  grid-row: 1 / -1;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  z-index: 20;
  box-shadow: 5px 0 30px rgba(0,0,0,0.4);
}

.brand-logo {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-shadow: 0 0 20px rgba(41, 151, 255, 0.3);
}

.brand-logo i {
  background: linear-gradient(135deg, #2997ff, #0066cc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  font-weight: 500;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--card-hover-bg);
  color: #fff;
  transform: translateX(4px);
  border-color: var(--border-color);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(41, 151, 255, 0.15) 0%, rgba(41, 151, 255, 0.05) 100%);
  color: #fff;
  border: 1px solid var(--card-hover-border);
  box-shadow: 0 4px 20px rgba(41, 151, 255, 0.2),
              0 0 0 1px rgba(41, 151, 255, 0.1),
              0 0 20px 2px rgba(41, 151, 255, 0.15);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.nav-icon {
  width: 24px;
  text-align: center;
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.nav-item:hover .nav-icon {
  transform: scale(1.1);
  color: var(--accent);
}

.user-mini-profile {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.user-mini-profile:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1d1d1f, #2997ff);
  border: 1px solid rgba(41, 151, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4), 0 0 20px rgba(41, 151, 255, 0.2);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info-mini h4 {
  font-size: 0.95rem;
  margin: 0;
  color: white;
  font-weight: 600;
}

.user-info-mini p {
  font-size: 0.8rem;
  margin: 0;
  color: var(--text-secondary);
}

/* Top Header */
.top-header {
  grid-column: 2;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  z-index: 15;
}

.page-title h2 {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #2997ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main Content */
.main-content {
  grid-column: 2;
  padding: 1rem 3rem 3rem 3rem;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Scrollbar */
.main-content::-webkit-scrollbar {
  width: 8px;
}
.main-content::-webkit-scrollbar-track {
  background: transparent;
}
.main-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 2rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(41, 151, 255, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(41, 151, 255, 0.2),
              0 0 20px 2px rgba(41, 151, 255, 0.15);
  border-color: var(--card-hover-border);
  background: var(--card-hover-bg);
}

.card:hover::before {
  opacity: 1;
}

.welcome-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(41, 151, 255, 0.15) 0%, rgba(0, 0, 0, 0.4) 100%);
  border: 1px solid rgba(41, 151, 255, 0.25);
  position: relative;
}

.welcome-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(41, 151, 255, 0.3) 0%, transparent 70%);
  filter: blur(50px);
  z-index: -1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: #fff;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

/* Stats */
.stat-value {
  font-size: 3rem;
  font-weight: 700;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: linear-gradient(135deg, #fff 30%, #2997ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.stat-card {
  background: rgba(0,0,0,0.2);
  padding: 1.5rem; 
  border-radius: 16px; 
  text-align: center;
  border: 1px solid transparent;
  transition: border-color 0.3s;
}

.stat-card:hover {
  border-color: rgba(255,255,255,0.1);
}

/* Purchase List */
.purchase-item {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.purchase-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(41, 151, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.purchase-info h4 { 
  margin: 0 0 0.35rem 0; 
  color: white; 
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
}

.purchase-meta { 
  font-size: 0.875rem; 
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-access {
  background: linear-gradient(135deg, #2997ff, #0077ed);
  color: white;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(41, 151, 255, 0.25);
}

/* Full width only for purchase item buttons */
.purchase-item .btn-access {
  width: 100%;
}

.btn-access:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(41, 151, 255, 0.4);
  background: linear-gradient(135deg, #3aa3ff, #0088ff);
}

.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-darker);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Tab Animations */
.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

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

/* Persistent Player Styles */
.persistent-player {
  position: fixed;
  bottom: 0;
  left: calc(var(--sidebar-width) + 3rem);
  right: 3rem;
  background: rgba(15, 15, 25, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 2rem;
  display: grid;
  margin-right: .5rem;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  z-index: 1000;
  transform: translateY(100%);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.persistent-player.active {
  transform: translateY(0);
}

/* Mini/Floating Player State */
.persistent-player.mini {
  left: auto;
  right: 2rem;
  bottom: 2rem;
  width: 300px; /* Slightly narrower but more controlled */
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  background: rgba(15, 15, 25, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  gap: 0.5rem;
  overflow: visible; /* To allow the close button to pop out */
}

.persistent-player.mini .player-info {
  grid-column: 1 / 2;
  overflow: hidden;
  gap: 0.6rem;
}

.persistent-player.mini .player-album-art {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.persistent-player.mini .player-text h4 {
  max-width: 110px;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.persistent-player.mini .player-text p {
  display: none;
}

.persistent-player.mini .player-controls-container {
  grid-column: 2 / 3;
  flex-direction: row;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: center;
}

.persistent-player.mini .player-buttons {
  gap: 0.5rem;
}

.persistent-player.mini .btn-player {
  font-size: 0.75rem;
}

.persistent-player.mini .btn-play-pause {
  width: 30px;
  height: 30px;
  font-size: 0.8rem;
}

.persistent-player.mini .progress-container {
  width: auto;
  margin-top: 0;
  gap: 0;
}

.persistent-player.mini .progress-bar {
  display: none;
}

.persistent-player.mini #durTime {
  display: none;
}

.persistent-player.mini #currTime {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: monospace;
}

.persistent-player.mini .player-extra {
  position: absolute;
  top: -10px;
  right: -10px;
  display: flex !important;
}

.persistent-player.mini .volume-container {
  display: none;
}

.player-close-btn {
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: none; /* Only show in mini or if we want it everywhere */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 10;
}

.persistent-player.mini .player-close-btn {
  display: flex;
}

.player-close-btn:hover {
  transform: scale(1.1);
  background: #ef4444;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.player-album-art {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #2a2a35;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.player-album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-text h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.player-text p {
  margin: 0.25rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.player-controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.player-buttons {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.btn-player {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.btn-player:hover {
  color: #fff;
}

.btn-play-pause {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  padding-left: 2px; /* Visual balance for play icon */
}

.btn-play-pause:hover {
  transform: scale(1.1);
  color: black;
}

.progress-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
}

.progress-bar:hover .progress-fill {
  background: var(--accent);
}

.player-extra {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100px;
  margin-right: 3rem;
}

.volume-slider {
  flex: 1;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

/* Footer with Gradient (matching creation-studio.html) */
.user-hub-footer {
  grid-column: 2;
  background: radial-gradient(circle at 50% 0%, rgba(41, 151, 255, 0.1), transparent 70%), #050814;
  padding: 4rem 0;
  border-top: 1px solid rgba(41, 151, 255, 0.2);
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.social-link:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-heading {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 2rem;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
  color: var(--text-primary);
}
/* Tab System for Sovereign Intelligence */
.content-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.tab-btn i {
  font-size: 1rem;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

/* YouTube Videos Grid */
.youtube-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.youtube-video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.youtube-video-card:hover {
  background: var(--card-hover-bg);
  border-color: var(--card-hover-border);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(41, 151, 255, 0.2);
}

.video-embed-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  background: #000;
}

.video-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-details {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.video-details h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
}

.video-details p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.video-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.25rem;
}

.video-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--accent-soft);
  border: 1px solid rgba(41, 151, 255, 0.3);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
}

.btn-cinema {
  background: rgba(41, 151, 255, 0.1);
  border: 1px solid rgba(41, 151, 255, 0.4);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-cinema:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(41, 151, 255, 0.3);
}

.btn-cinema i {
  font-size: 0.8rem;
}

.video-badge i {
  font-size: 0.75rem;
}

/* Responsive Tab System */
@media (max-width: 768px) {
  .content-tabs {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .tab-btn {
    width: 100%;
    justify-content: center;
  }
  
  .youtube-videos-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Responsive purchase items */
  .purchase-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .purchase-item > div:first-child {
    width: 100%;
  }
  
  .btn-access {
    width: 100%;
    justify-content: center;
  }
}

/* ===========================
   Mobile Menu Styles
   =========================== */

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 19;
  opacity: 0;
  /* Never intercept taps when invisible/transitioning */
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Only allow taps when fully open */
.mobile-menu-overlay.is-open {
  pointer-events: auto;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 1.2rem;
}

.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(41, 151, 255, 0.3);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Adjust app shell for mobile */
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-height) 1fr;
  }
  
  /* Header spans full width on mobile - elevated so it stays tappable */
  .top-header {
    grid-column: 1;
    grid-row: 1;
    padding: 0 1.5rem;
    position: relative;
    z-index: 25;
  }
  
  /* Main content spans full width */
  .main-content {
    grid-column: 1;
    grid-row: 2;
  }

  /* Remove padding when book reader is inside main-content so it fills correctly */
  .main-content:has(.book-reader-container) {
    padding: 0 !important;
    overflow: hidden;
  }
  
  /* Hide sidebar by default on mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    bottom: 0;
    width: 80%;
    max-width: 300px;
    grid-row: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    box-shadow: none;
  }
  
  /* Show sidebar when mobile-open class is added */
  .sidebar.mobile-open {
    left: 0;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.8);
  }
  
  /* Adjust brand logo size on mobile */
  .brand-logo {
    font-size: 1.4rem;
    margin-bottom: 2rem;
  }
  
  /* Make page title more compact on mobile */
  .page-title h2 {
    font-size: 1.4rem;
  }
  
  /* Adjust main content padding on mobile */
  .main-content {
    padding: 1.5rem 1rem;
    /* Extra bottom padding when player is active so content isn't hidden behind it */
    padding-bottom: 100px;
  }

  /* Fix persistent player - sidebar is hidden on mobile, so reset left offset */
  .persistent-player {
    left: 0;
    right: 0;
    margin-right: 0;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    grid-template-columns: auto 1fr auto;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* Shrink album art on mobile */
  .player-album-art {
    width: 42px;
    height: 42px;
  }

  .player-text h4 {
    max-width: 130px;
    font-size: 0.85rem;
  }

  /* Hide volume control on mobile to save space */
  .volume-container {
    display: none;
  }

  /* Compact player button spacing */
  .player-buttons {
    gap: 1rem;
  }

  /* Mini player on mobile should stay visible in corner */
  .persistent-player.mini {
    width: calc(100% - 2rem);
    max-width: 320px;
    right: 1rem;
    left: auto;
    bottom: 1rem;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .sidebar {
    width: 85%;
    max-width: 260px;
  }
  
  .brand-logo {
    font-size: 1.2rem;
  }
  
  .page-title h2 {
    font-size: 1.2rem;
  }
  
  .top-header {
    padding: 0 1rem;
  }
  
  .main-content {
    padding: 1rem 0.75rem;
    padding-bottom: 110px;
  }
  
  /* Stack header actions vertically if needed */
  .header-actions {
    gap: 0.5rem;
  }

  /* On very small screens, player info text truncates more aggressively */
  .player-text h4 {
    max-width: 90px;
    font-size: 0.78rem;
  }

  /* Bigger tap targets for player buttons */
  .btn-player {
    font-size: 1.1rem;
    padding: 0.4rem;
  }

  .btn-play-pause {
    width: 36px;
    height: 36px;
  }
}

/* Cinema Mode Button */
.btn-cinema {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-cinema:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 151, 255, 0.3);
}

.btn-cinema i {
    font-size: 0.9rem;
}