/* ===== CSS Variables ===== */
:root {
  --bg-primary: #151522;
  --bg-secondary: rgba(255, 255, 255, 0.045);
  --bg-glass: rgba(30, 30, 42, 0.78);
  --glass-border: rgba(255, 255, 255, 0.12);
  /* Bars, sheets, toasts — tracks theme for mobile consistency */
  --bg-elevated: rgba(26, 26, 36, 0.97);
  --player-gradient-start: #252538;
  --player-gradient-end: #151522;

  --accent-color: #00d4aa;
  --accent-glow: rgba(0, 212, 170, 0.5);
  --accent-secondary: #00a8cc;
  --accent-tertiary: #7b61ff;

  --text-primary: #ffffff;
  --text-secondary: #aab2c3;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', monospace;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #f5f7fa;
  --bg-secondary: rgba(0, 0, 0, 0.02);
  --bg-glass: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.06);
  --bg-elevated: rgba(255, 255, 255, 0.96);
  --player-gradient-start: #eef1f8;
  --player-gradient-end: #f5f7fa;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  /* Dynamic viewport height for mobile */
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
  overscroll-behavior: none;
  /* Prevent overscroll bounce */
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: -50px;
  /* Extend beyond viewport to prevent gaps */
  left: -50px;
  right: -50px;
  bottom: -50px;
  background:
    radial-gradient(circle at 20% 80%, rgba(0, 212, 170, 0.18) 0%, transparent 52%),
    radial-gradient(circle at 80% 20%, rgba(0, 168, 204, 0.14) 0%, transparent 52%),
    radial-gradient(circle at 50% 50%, rgba(123, 97, 255, 0.1) 0%, transparent 62%);
  background-attachment: fixed;
  pointer-events: none;
  z-index: -1;
  animation: bgPulse 15s ease-in-out infinite;
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  /* Ensure it is above the background but below content if content has higher z-index */
}

@keyframes bgPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 20% 80%, rgba(0, 212, 170, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 168, 204, 0.06) 0%, transparent 50%);
}

html {
  scroll-behavior: smooth;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
  /* Padding effect */
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* ===== Loading Skeleton ===== */
.skeleton-loading {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.05) 25%,
      rgba(255, 255, 255, 0.1) 50%,
      rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ===== Glass Panel ===== */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  transition: all 0.3s ease;
}

.glass-panel:hover {
  border-color: rgba(0, 212, 170, 0.2);
}

/* ===== Layout ===== */
.app-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  transition: all 0.4s ease;
}

/* Layout Modes */
.main-grid[data-layout="left"] {
  grid-template-columns: 320px 1fr;
}

.main-grid[data-layout="right"] {
  grid-template-columns: 1fr 320px;
}

.main-grid[data-layout="right"] .sidebar {
  order: 2;
}

.main-grid[data-layout="focus"] {
  grid-template-columns: 1fr;
  max-width: 800px;
  margin: 0 auto;
}

.main-grid[data-layout="focus"] .sidebar {
  display: none;
}

/* Hero Section - Only visible in Focus mode */
.hero-section {
  display: none;
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  min-height: 450px;
  /* Removed border-radius for full immersive feel */
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-layout="focus"]~.hero-section,
.container:has(.main-grid[data-layout="focus"]) .hero-section {
  display: block;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.35) saturate(1.2);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(21, 21, 34, 0.95) 0%,
      rgba(21, 21, 34, 0.55) 40%,
      transparent 100%);
}

[data-theme="light"] .hero-overlay {
  background: linear-gradient(to top,
      rgba(245, 247, 250, 0.92) 0%,
      rgba(245, 247, 250, 0.45) 45%,
      transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  padding: 3rem;
  min-height: 450px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-avatar {
  flex-shrink: 0;
}

.hero-avatar img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent-color);
  box-shadow: 0 0 40px var(--accent-glow);
}

.hero-info {
  flex: 1;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff, var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-stat .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-actions .btn {
  padding: 0.75rem 1.5rem;
}

.hero-actions .btn.primary {
  box-shadow: 0 4px 20px var(--accent-glow);
}


/* ===== Navigation ===== */
.top-nav {
  position: sticky;
  top: 0.5rem;
  margin: 0.5rem auto 1.5rem;
  width: calc(100% - 1rem);
  max-width: 1200px;
  padding: 0.875rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  animation: slideDown 0.6s ease-out;
}

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

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

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  background: linear-gradient(90deg,
      var(--text-primary) 0%,
      var(--accent-color) 25%,
      var(--accent-secondary) 50%,
      var(--text-primary) 75%,
      var(--text-primary) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 4s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.nav-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-auth-btn {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-auth-btn:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: rgba(0, 212, 170, 0.12);
}

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.nav-btn:hover {
  color: var(--accent-color);
  background: rgba(0, 212, 170, 0.15);
  border-color: var(--accent-color);
  transform: scale(1.05);
}

.nav-btn .icon {
  width: 20px;
  height: 20px;
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  color: var(--accent-color);
  background: rgba(0, 212, 170, 0.15);
  border-color: var(--accent-color);
  transform: rotate(180deg);
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
}

.nav-left-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-page-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-text-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-text-link:hover {
  color: var(--accent-color);
  background: rgba(0, 212, 170, 0.08);
}

.nav-text-current {
  color: var(--accent-color);
  cursor: default;
}

.nav-socials {
  display: flex;
  gap: 0.5rem;
}

.social-link {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link.spotify:hover {
  color: #1DB954;
  border-color: #1DB954;
  background: rgba(29, 185, 84, 0.1);
}

.social-link.apple:hover {
  color: #fa243c;
  border-color: #fa243c;
  background: rgba(250, 36, 60, 0.1);
}

@media (max-width: 600px) {
  .nav-left-group {
    gap: 0.75rem;
  }

  .logo {
    font-size: 1rem;
  }
}

/* ===== Sidebar ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

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

/* ===== Profile Card ===== */
.profile-card {
  padding: 1.5rem;
  text-align: center;
}

.profile-pic-container {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 1.25rem;
}

.profile-pic {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent-color);
  box-shadow: 0 0 25px var(--accent-glow);
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-indicator {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  background: #00ff88;
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.5);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(0, 255, 136, 0);
  }
}

.profile-info h1 {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}

.mood {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
}

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

.btn.primary:hover {
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.about-section {
  text-align: left;
  padding-top: 1.25rem;
  border-top: 1px solid var(--glass-border);
}

.about-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.about-section p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.skills-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.website-link {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}

.website-link:hover {
  opacity: 0.8;
}

.profile-website-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.profile-platforms-btn {
  text-align: center;
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
}

a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 400px) {
  .profile-website-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .profile-platforms-btn {
    width: auto;
  }
}

/* ===== Platforms page (indie / music links) ===== */
.platforms-intro {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.platforms-section {
  margin-bottom: 1.35rem;
}

.platforms-section:last-child {
  margin-bottom: 0;
}

.platforms-section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-color);
  margin: 0 0 0.6rem;
  font-weight: 700;
}

.platforms-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.platforms-card {
  display: block;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.14);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.platforms-card:hover {
  border-color: var(--accent-color);
  background: rgba(0, 212, 170, 0.07);
}

.platforms-card-name {
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0 0 0.2rem;
}

.platforms-card-desc {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.platforms-card-host {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  color: var(--accent-color);
  font-family: 'Space Mono', monospace;
  word-break: break-all;
  opacity: 0.9;
}

[data-theme="light"] .platforms-card {
  background: rgba(15, 23, 42, 0.04);
}

/* ===== Admin panel ===== */
.admin-meta {
  margin: 0.3rem 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.admin-access-panel,
.admin-panel {
  padding: 1rem 1.25rem 1.25rem;
}

.admin-notice-title {
  margin: 0 0 0.45rem;
  font-weight: 700;
}

.admin-notice-body {
  margin: 0;
  color: var(--text-secondary);
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.admin-post-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.admin-post-card {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.15);
  padding: 0.85rem 0.9rem;
}

.admin-post-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.admin-post-meta,
.admin-post-stats {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.admin-post-content {
  margin: 0.45rem 0 0.5rem;
  line-height: 1.45;
  font-size: 0.86rem;
}

.admin-post-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-danger-btn {
  border-color: rgba(255, 111, 111, 0.55);
  color: #ff9e9e;
}

.admin-danger-btn:hover {
  border-color: #ff6f6f;
  color: #ffd4d4;
  background: rgba(255, 111, 111, 0.12);
}

.admin-comments-wrap {
  margin-top: 0.75rem;
  border-top: 1px solid var(--glass-border);
  padding-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.admin-comment-row {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.6rem;
  align-items: flex-start;
}

.admin-comment-body {
  min-width: 0;
}

.admin-comment-text,
.admin-comment-meta,
.admin-comment-empty {
  margin: 0;
}

.admin-comment-text {
  font-size: 0.82rem;
  line-height: 1.4;
}

.admin-comment-meta,
.admin-comment-empty {
  margin-top: 0.2rem;
  color: var(--text-secondary);
  font-size: 0.74rem;
}

[data-theme="light"] .admin-post-card {
  background: rgba(15, 23, 42, 0.04);
}

/* ===== Gallery Panel ===== */
.gallery-panel {
  padding: 1.25rem;
}

.gallery-panel h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.gallery-panel .gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.gallery-panel .gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
}

.gallery-panel .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-panel .gallery-item:hover img {
  transform: scale(1.1);
}

/* ===== Music Player ===== */
.music-player {
  padding: 1.25rem;
}

.player-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.player-header-row h3 {
  font-size: 1rem;
  margin-bottom: 0;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  color: var(--accent-color);
  background: rgba(255, 255, 255, 0.05);
}

.apple-toggle {
  color: #fa243c;
  position: relative;
  overflow: visible;
  animation: applePulse 3s infinite;
}

@keyframes applePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(250, 36, 60, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(250, 36, 60, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(250, 36, 60, 0);
  }
}

.apple-toggle:hover {
  background: rgba(250, 36, 60, 0.15);
  transform: scale(1.1);
  animation: none;
  /* Stop pulsing on hover */
}

.apple-toggle svg {
  width: 24px;
  height: 24px;
}

.modal-content.large-modal {
  width: 90%;
  max-width: 700px;
}

.apple-embeds {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  max-height: 60vh;
  -webkit-overflow-scrolling: touch;
  padding-right: 5px;
  /* Prevent scrollbar overlapping content */
}

/* Custom scrollbar for the embeds container */
.apple-embeds::-webkit-scrollbar {
  width: 6px;
}

.apple-embeds::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.apple-embeds::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

.player-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.track {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.track:hover {
  background: rgba(0, 212, 170, 0.1);
  border-color: rgba(0, 212, 170, 0.2);
}

.track.active {
  background: rgba(0, 212, 170, 0.15);
  border-color: var(--accent-color);
}

.track.playing .track-play-btn {
  background: var(--accent-color);
  color: white;
}

.track-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.track-play-btn:hover {
  background: var(--accent-color);
  color: white;
  transform: scale(1.1);
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.track-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.player-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
  border-radius: 3px;
  transition: width 0.1s linear;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-icon {
  font-size: 0.9rem;
  cursor: pointer;
}

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

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--accent-color);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* ===== Focus Mode Music Player ===== */
.focus-music-player {
  display: none;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.focus-music-player.visible {
  display: block;
}

.focus-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.focus-player-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.album-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.focus-player-content {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.focus-album-art {
  flex-shrink: 0;
}

.focus-album-art img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.focus-tracks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.focus-track {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.focus-track:hover {
  background: rgba(0, 212, 170, 0.1);
  border-color: rgba(0, 212, 170, 0.2);
}

.focus-track.active {
  background: rgba(0, 212, 170, 0.15);
  border-color: var(--accent-color);
}

.focus-track.playing .focus-track-btn {
  background: var(--accent-color);
  color: white;
}

.focus-track-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.focus-track-btn:hover {
  background: var(--accent-color);
  color: white;
  transform: scale(1.1);
}

.focus-track-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.focus-track-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.focus-track-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.focus-player-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.focus-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}

.focus-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
  border-radius: 3px;
  transition: width 0.1s linear;
}

.focus-time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ===== Friends Panel ===== */
.friends-panel {
  padding: 1.25rem;
}

.friends-panel h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.friend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.friend-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.friend-item:hover .friend-avatar {
  transform: scale(1.05);
}

.friend-item span {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* ===== Content Area ===== */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

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

/* ===== Composer ===== */
.composer {
  padding: 1.25rem;
}

.composer textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.composer textarea::placeholder {
  color: var(--text-secondary);
}

.composer textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.composer-tools {
  display: flex;
  gap: 0.5rem;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-btn:hover {
  background: rgba(0, 212, 170, 0.15);
  border-color: var(--accent-color);
}

/* ===== Posts ===== */
.post {
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.post:hover {
  border-color: rgba(0, 212, 170, 0.3);
  transform: translateY(-2px);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.post-meta h2 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.timestamp {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.tag {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag.video {
  background: #e74c3c;
  color: white;
}

.tag.photo {
  background: var(--accent-secondary);
  color: white;
}

.tag.update {
  background: var(--accent-tertiary);
  color: white;
}

.post-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.media-container {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 550px;
}

.media-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.3s;
}

.media-container:hover img {
  transform: scale(1.02);
}

.video-container {
  max-height: none;
  position: relative;
  cursor: pointer;
}

.video-container video {
  width: 100%;
  border-radius: var(--radius-md);
  display: block;
}

.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  pointer-events: none;
  /* Let clicks pass through to container */
  z-index: 2;
}

.video-container:hover .video-play-overlay {
  background: var(--accent-color);
  border-color: var(--accent-color);
  transform: translate(-50%, -50%) scale(1.1);
}

.video-play-overlay::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 18px solid white;
  margin-left: 4px;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.media-container:hover .image-overlay {
  opacity: 1;
}

.post-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.action-btn:hover {
  color: var(--accent-color);
  background: rgba(0, 212, 170, 0.1);
}

.post-like-btn.is-liked {
  color: #ff6b8a;
  background: rgba(255, 107, 138, 0.12);
}

.post-like-btn.is-liked:hover {
  color: #ff8fa3;
}

.post-action-static {
  opacity: 0.55;
  cursor: default;
}

.post-action-static:hover {
  color: var(--text-secondary);
  background: transparent;
}

.post-comments-panel {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.18);
}

.post-comments-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.post-comments-empty {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.25rem 0;
}

.post-comment-item {
  font-size: 0.82rem;
  line-height: 1.45;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.post-comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}

.post-comment-author {
  font-weight: 600;
  color: var(--accent-color);
}

.post-comment-time {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.post-comment-text {
  margin: 0;
  color: var(--text-primary);
}

.post-comment-form {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.post-comment-input {
  flex: 1 1 140px;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.85rem;
}

.post-comment-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.post-comment-send {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 900px) {

  .container {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .music-page-shell {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  /* Hide layout toggle on tablet/mobile - not useful */
  #layoutToggle {
    display: none;
  }

  /* Force single column layout */
  .main-grid,
  .main-grid[data-layout="left"],
  .main-grid[data-layout="right"],
  .main-grid[data-layout="focus"] {
    grid-template-columns: 1fr !important;
    max-width: none !important;
  }

  /* Show sidebar on mobile (overrides focus mode) */
  .main-grid[data-layout="focus"] .sidebar {
    display: flex !important;
  }

  .sidebar {
    order: -1;
  }
}

@media (max-width: 600px) {
  .container {
    padding-top: 0;
    padding-bottom: 1.5rem;
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  /* Hero mobile styles */
  .hero-section {
    min-height: 350px;
    margin-bottom: 1.5rem;
  }

  .hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    min-height: 350px;
  }

  .hero-avatar img {
    width: 100px;
    height: 100px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-stats {
    justify-content: center;
    gap: 1.5rem;
  }

  /* Fix for Video Play Button centering on mobile */
  .media-container {
    min-height: 250px;
    /* Ensure minimum height for play button centering */
  }

  .video-play-overlay {
    /* Ensure it stays centered regardless of container size quirks */
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  /* Show center-top of images on mobile (35%) */
  .media-container img {
    object-position: center 35% !important;
  }



  .hero-stat .stat-value {
    font-size: 1.4rem;
  }

  .hero-actions {
    justify-content: center;
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1;
    text-align: center;
  }

  .top-nav {
    box-sizing: border-box;
    width: auto;
    margin-left: max(0.5rem, env(safe-area-inset-left, 0px));
    margin-right: max(0.5rem, env(safe-area-inset-right, 0px));
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
  }

  .logo {
    font-size: 1rem;
  }

  .profile-card {
    padding: 1.25rem;
  }

  /* Hide duplicate profile info on mobile since we have the hero */
  .profile-pic-container,
  .profile-info {
    display: none;
  }

  .about-section {
    border-top: none;
    padding-top: 0;
  }

  .stats {
    font-size: 0.75rem;
  }

  .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  .gallery-panel .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }

  .friends-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }

  .friend-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .composer {
    padding: 1rem;
  }

  .composer textarea {
    min-height: 70px;
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .post {
    padding: 1rem;
  }

  .post-meta h2 {
    font-size: 1rem;
  }

  .post-content p {
    font-size: 0.9rem;
  }

  .post-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .post-footer {
    gap: 0.35rem;
  }

  .action-btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

  .media-container {
    max-height: 250px;
  }
}

@media (max-width: 380px) {
  .stats {
    flex-direction: column;
    gap: 0.25rem;
  }

  .actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn {
    width: 100%;
  }

  .composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .composer-tools {
    justify-content: center;
  }

  .btn.primary {
    width: 100%;
  }
}

/* ===== Selection ===== */
::selection {
  background: var(--accent-color);
  color: white;
}

/* ===== Mobile Bottom Player (Spotify-style) ===== */
.mobile-player {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 900px) {
  .mobile-player {
    display: block;
  }

  /* Hide sidebar music player on mobile */
  .music-player {
    display: none;
  }

  /* Add padding to body for mobile player + home indicator */
  body {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }
}

.mobile-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  cursor: pointer;
}

.mobile-player-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.mobile-album-art {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
}

.mobile-track-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mobile-track-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-album-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.mobile-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent-color);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Expanded Player */
.mobile-player-expanded {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background: linear-gradient(180deg,
      var(--player-gradient-start) 0%,
      var(--player-gradient-end) 100%);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

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

.expanded-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0 1.5rem;
}

.expanded-header span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.collapse-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
}

.expanded-artwork {
  flex-shrink: 0;
  margin: 0 auto 2rem;
  width: 100%;
  max-width: 300px;
}

.expanded-artwork img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.expanded-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.expanded-track-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.expanded-album-name {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.expanded-progress {
  margin-bottom: 1.5rem;
}

.mobile-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

[data-theme="light"] .mobile-progress-bar {
  background: rgba(15, 23, 42, 0.12);
}

.mobile-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-color);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.mobile-time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.expanded-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn.play-pause {
  width: 70px;
  height: 70px;
  background: var(--accent-color);
  color: white;
  font-size: 1.75rem;
}

.expanded-tracklist {
  flex: 1;
  overflow-y: auto;
}

.mobile-track-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.mobile-track-item:hover,
.mobile-track-item.active {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .mobile-track-item:hover,
[data-theme="light"] .mobile-track-item.active {
  background: rgba(15, 23, 42, 0.06);
}

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

.track-num {
  width: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.mobile-track-item .track-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-track-item .track-title {
  font-weight: 500;
}

.mobile-track-item .track-duration {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ===== Social Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  width: 90%;
  max-width: 400px;
  padding: 2rem;
  text-align: center;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.social-btn.apple-music {
  background: linear-gradient(135deg, #fa233b, #fc5c7d);
}

.social-btn.spotify {
  background: linear-gradient(135deg, #1db954, #191414);
}

.social-icon {
  font-size: 1.2rem;
}

/* ===== Image Modal (Facebook-style Lightbox) ===== */
.image-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.image-modal {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.image-modal-close svg {
  width: 24px;
  height: 24px;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Navigation Arrows */
.image-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.image-modal-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.image-modal-nav.prev {
  left: 1rem;
}

.image-modal-nav.next {
  right: 400px;
  /* Account for sidebar */
}

.image-modal-nav svg {
  width: 24px;
  height: 24px;
}

.image-modal-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.image-modal-nav:disabled:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-50%);
}

/* Modal Content Layout */
.image-modal-content {
  display: flex;
  width: 100%;
  height: 100%;
  max-width: 1400px;
}

/* Image Section */
.image-modal-image-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-right: 1rem;
}

.modal-main-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  animation: imageZoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes imageZoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Details Section */
.image-modal-details {
  width: 380px;
  height: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

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

/* Post Header */
.modal-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}

.modal-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-color);
}

.modal-author-info {
  display: flex;
  flex-direction: column;
}

.modal-author-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.modal-timestamp {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.modal-tag {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-color);
}

/* Post Title */
.modal-post-title {
  font-size: 1.35rem;
  font-weight: 700;
  padding: 1.25rem 1.25rem 0.5rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Post Quote */
.modal-post-quote {
  padding: 0 1.25rem 1rem;
  flex-shrink: 0;
}

.modal-post-quote p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent-color);
  padding-left: 1rem;
  margin: 0;
  font-style: italic;
}

/* Views */
.modal-views {
  padding: 0 1.25rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Actions */
.modal-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.modal-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.modal-action-btn:hover {
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-color);
  transform: translateY(-2px);
}

.action-icon {
  font-size: 1rem;
}

.action-count,
.action-label {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Comments Section */
.modal-comments-section {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-comment {
  display: flex;
  gap: 0.75rem;
  animation: fadeInUp 0.3s ease-out;
}

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

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

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
}

.comment-author {
  font-weight: 600;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

.comment-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Comment Input */
.modal-comment-input {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

.modal-comment-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 0.6rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

.modal-comment-input input::placeholder {
  color: var(--text-secondary);
}

.modal-comment-input input:focus {
  border-color: var(--accent-color);
  background: rgba(255, 255, 255, 0.1);
}

.send-comment-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent-color);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.send-comment-btn svg {
  width: 18px;
  height: 18px;
}

.send-comment-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px var(--accent-glow);
}

/* Clickable images in posts */
.media-container img {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.media-container img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 212, 170, 0.2);
}

/* Gallery clickable */
.gallery-panel .gallery-item {
  pointer-events: auto;
}

/* ===== Image Modal Mobile Responsive ===== */
@media (max-width: 900px) {
  .image-modal-nav.next {
    right: 1rem;
  }

  .image-modal-content {
    flex-direction: column;
  }

  /* Make image section take all available space */
  .image-modal-image-section {
    flex: 1;
    min-height: 0;
    /* Crucial for flex scrolling */
    max-height: none;
    padding: 3.5rem 0.5rem 0.5rem;
    /* Allow room for top controls */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
  }

  .modal-main-image {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: none;
    /* Reduce visual noise on mobile */
  }

  /* Make details section a compact bottom sheet */
  .image-modal-details {
    width: 100%;
    height: auto;
    max-height: 40vh;
    /* Cap height to 40% of screen */
    flex: 0 0 auto;
    border-left: none;
    border-top: 1px solid var(--glass-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: 0;
    position: relative;
    z-index: 5;
    background: var(--bg-elevated);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .modal-post-header {
    padding: 0.75rem 1rem;
  }

  .modal-post-title {
    font-size: 1.1rem;
    padding: 0.75rem 1rem 0.25rem;
  }

  .modal-post-quote {
    padding: 0 1rem 0.5rem;
  }

  .modal-post-quote p {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  .modal-actions {
    padding: 0.5rem 1rem;
    border-bottom: none;
    /* Remove border since it's at the bottom */
  }

  .modal-action-btn {
    padding: 0.4rem;
  }

  .action-label {
    display: none;
  }

  /* Hide comments and input on mobile to minimize UI */
  .modal-comments-section,
  .modal-comment-input {
    display: none;
  }
}

@media (max-width: 480px) {
  .image-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 38px;
    height: 38px;
  }

  .image-modal-nav {
    width: 40px;
    height: 40px;
  }

  .modal-post-header {
    padding: 1rem;
  }

  .modal-author-avatar {
    width: 38px;
    height: 38px;
  }
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 5000;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 90vw;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}

.toast.hiding {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  font-size: 1.2rem;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent-color);
  width: 100%;
  transform-origin: left;
  animation: toastProgress 3s linear forwards;
}

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

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
}

@keyframes toastProgress {
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 600px) {
  .toast-container {
    bottom: 5rem;
    /* Above mobile nav bar if one existed, or just higher up */
    width: 100%;
    padding: 0 1rem;
  }

  .toast {
    width: 100%;
    min-width: 0;
  }
}

/* ===== Scroll Reveal Animation ===== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Music library page (music.html) ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.music-page-body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
}

.music-page-shell {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem calc(7.5rem + env(safe-area-inset-bottom, 0px));
}

.music-top-nav .nav-left-group {
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.music-logo-link {
  text-decoration: none;
  color: inherit;
}

.music-logo-link:hover {
  color: var(--accent-color);
}

.music-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.music-library-header {
  padding: 1.5rem;
}

.music-library-title {
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
  font-family: 'Space Mono', monospace;
  letter-spacing: -0.02em;
}

.music-library-sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.music-library-sub code {
  font-size: 0.8rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
}

.music-search-wrap {
  display: block;
  margin-top: 1.25rem;
}

.music-search-input {
  width: 100%;
  max-width: 420px;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
}

.music-search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

[data-theme="light"] .music-search-input {
  background: rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .music-library-sub code {
  background: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .music-library-row {
  background: rgba(15, 23, 42, 0.04);
}

.music-library-panel {
  padding: 1rem 1.25rem 1.5rem;
}

.music-library-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.music-lib-heading {
  font-size: 1rem;
  margin: 0;
}

.music-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.music-library-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.music-library-row {
  display: grid;
  grid-template-columns: auto 1fr auto minmax(0, 140px);
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.music-library-row:hover {
  border-color: rgba(0, 212, 170, 0.25);
  background: rgba(0, 212, 170, 0.06);
}

.music-row-playing {
  border-color: var(--accent-color);
  background: rgba(0, 212, 170, 0.12);
}

.music-row-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

.music-row-play:hover {
  background: var(--accent-color);
  color: #fff;
  transform: scale(1.05);
}

.music-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.music-row-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-row-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.music-row-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.music-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.music-badge-ep {
  background: rgba(0, 212, 170, 0.2);
  color: var(--accent-color);
}

.music-row-duration {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.music-row-file {
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Space Mono', monospace;
}

.music-empty-hint {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 1rem 0 0;
}

.music-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.75rem max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-right, 0px));
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.music-dock-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.music-dock-info {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.music-dock-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.music-dock-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.music-dock-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.music-dock-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.music-dock-btn:hover {
  background: var(--accent-color);
  color: #fff;
}

.music-dock-play {
  width: 46px;
  height: 46px;
  font-size: 1rem;
}

.music-dock-download {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0.35rem;
}

.music-dock-download:hover {
  color: var(--accent-color);
}

.music-dock-progress-wrap {
  margin-top: 0.65rem;
}

.music-dock-progress {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  overflow: hidden;
}

.music-dock-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
  border-radius: 3px;
  transition: width 0.1s linear;
}

.music-dock-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .music-library-row {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "play main"
      "badges badges";
  }

  .music-row-play {
    grid-area: play;
  }

  .music-row-main {
    grid-area: main;
  }

  .music-row-badges {
    grid-area: badges;
    justify-content: flex-start;
    padding-left: calc(38px + 0.5rem);
  }

  .music-row-file {
    display: none;
  }

  .music-page-shell {
    padding-bottom: calc(9rem + env(safe-area-inset-bottom, 0px));
  }
}