/* ===== Left icon sidebar (Home / Profile / Friends / Music / Settings) ===== */
.side-nav {
  position: fixed;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 10px;
  border-radius: 999px;
}
.nav-btn {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-dim);
  transition: color 0.2s, background 0.2s, transform 0.2s;
}
.nav-btn svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.nav-btn[data-view="settings"] svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-btn[data-view="settings"] svg circle[fill] {
  fill: currentColor;
  stroke: none;
}
.nav-btn:hover { color: var(--gold-bright); transform: translateY(-1px); }
.nav-btn.active { color: var(--bg-deep); background: linear-gradient(160deg, var(--gold-bright), var(--gold)); box-shadow: 0 0 16px rgba(240,207,122,0.45); }

/* ===== Corner clock (small, unobtrusive — click opens the full calendar) ===== */
.corner-clock {
  position: fixed;
  top: 16px;
  left: 16px; /* opposite of lang-toggle which is inset-inline-end */
  bottom: auto;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--gold-bright);
  font-size: 0.78rem;
  transition: transform 0.2s, box-shadow 0.2s;
  max-width: min(280px, 55vw);
}
body.ltr .corner-clock { left: auto; right: 16px; }
body.ltr .lang-toggle { right: auto; left: 16px; }
/* when RTL: lang is right, clock left; when LTR: swap already handled */

.corner-clock:hover { transform: translateY(-2px); }
.corner-clock .icon-badge svg { width: 13px; height: 13px; }
.corner-clock-date { color: var(--text-dim); font-size: 0.68rem; }

/* ===== View containers ===== */
.view {
  position: relative;
  min-height: calc(100vh - 80px);
  padding-left: 84px;
}
#view-home {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 20px;
  align-items: start;
}
#view-profile, #view-friends, #view-music, #view-settings {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 40px;
}
.profile-bio-box, .friends-full-box, .music-full-box, .settings-box {
  width: min(720px, 92vw);
  animation: viewIn 0.35s ease both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Profile shrink-and-dock animation (home profile card -> sidebar-adjacent, on entering Profile view) */
.profile-card-docked {
  transform: scale(0.72);
  transform-origin: top center;
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
}

.friends-full-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.friends-full-grid .friend-row { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; transition: border-color 0.2s, transform 0.2s; }
.friends-full-grid .friend-row:hover { border-color: var(--gold); transform: translateY(-2px); }

/* ===== Calendar / occasions overlay ===== */
.calendar-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4,3,2,0.55);
  backdrop-filter: blur(4px);
}
.calendar-modal {
  width: min(560px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
}
.calendar-modal-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--gold-bright);
}
.calendar-modal-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

.occasion-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,0.08); font-size: 0.82rem; }
.occasion-row:last-child { border-bottom: none; }
.occasion-row .date { color: var(--gold-bright); white-space: nowrap; }
.occasion-row .name { color: var(--text-dim); }

.calendar-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(255,255,255,0.08); }
.calendar-col h3 { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--gold); text-transform: uppercase; margin-bottom: 8px; }
.calendar-col-row { display: flex; flex-direction: column; gap: 1px; padding: 5px 0; font-size: 0.74rem; border-bottom: 1px dashed rgba(255,255,255,0.06); }
.calendar-col-row span:first-child { color: var(--text-dim); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; }
.calendar-col-row span:last-child { color: var(--gold-bright); }
@media (max-width: 480px) { .calendar-split { grid-template-columns: 1fr; } }

.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed rgba(255,255,255,0.08); gap: 12px; flex-wrap: wrap; }
.settings-row:last-child { border-bottom: none; }
.settings-row .label { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 0.85rem; flex-shrink: 0; }
.settings-row .label svg { width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 1.8; }
/* Background row: label on top, swatches full width in a grid (no horizontal scroll) */
.settings-row:has(.bg-swatches) {
  flex-direction: column;
  align-items: stretch;
}
.settings-row:has(.bg-swatches) .bg-swatches {
  justify-content: start;
  margin-top: 4px;
}

.bg-swatches {
  display: grid;
  grid-template-columns: repeat(4, 44px);
  gap: 8px;
  max-width: none;
  overflow: visible;
  padding-bottom: 2px;
  justify-content: end;
}
@media (max-width: 760px) {
  .bg-swatches {
    grid-template-columns: repeat(4, 40px);
    gap: 7px;
  }
  .bg-swatch { width: 40px; height: 40px; }
}
.settings-box { max-height: min(80vh, 640px); overflow-y: auto; -webkit-overflow-scrolling: touch; }

.bg-swatch {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.bg-swatch.active { border-color: var(--gold); }

.theme-toggle-btn, .lang-toggle-inline {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--gold-bright);
  font-size: 0.72rem;
  transition: border-color 0.2s;
}
.theme-toggle-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.theme-toggle-btn:hover, .lang-toggle-inline:hover { border-color: var(--gold); }

.hidden { display: none !important; }

/* Bottom mini-player — Apple Music style (cover + title + prev/play/next) */
.mobile-now-playing {
  display: none;
  align-items: center;
  gap: 10px;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  bottom: 18px;
  z-index: 90;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  text-align: start;
  background: rgba(28, 28, 30, 0.82);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mobile-now-playing:not(.hidden) { display: flex; }
.mobile-now-playing:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
.mobile-now-playing.on-music-view { display: none !important; }
.mobile-now-playing img {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
}
.mnp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  pointer-events: none;
}
.mnp-title {
  font-size: 0.78rem;
  color: #f5f5f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.mnp-artist {
  font-size: 0.62rem;
  color: rgba(235,235,245,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mnp-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.mnp-btn {
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  color: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  opacity: 0.9;
  transition: opacity 0.15s, background 0.15s;
}
.mnp-btn:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.mnp-btn svg { width: 18px; height: 18px; fill: currentColor; }
.mnp-btn.mnp-play svg { width: 22px; height: 22px; }
@media (max-width: 760px) {
  .mobile-now-playing {
    bottom: 14px;
    width: calc(100% - 20px);
    max-width: none;
  }
  .side-nav { z-index: 95; }
}

@media (max-width: 760px) {
  /* Keep nav on the LEFT (vertical), smaller — do not move to bottom */
  .side-nav {
    top: 50%;
    bottom: auto;
    left: 8px;
    transform: translateY(-50%);
    flex-direction: column;
    padding: 10px 8px;
    gap: 8px;
  }
  .nav-btn { width: 36px; height: 36px; }
  .nav-btn svg { width: 16px; height: 16px; }
  .view { padding-left: 56px; padding-top: 10px; padding-right: 12px; }
  .corner-clock { top: 12px; left: 12px; bottom: auto; }
}
