/* ============================================================
   BF-OS // BLUEBERRY FRUITSY AUDIO ARCHIVE
   styles.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Syncopate:wght@400;700&family=Rajdhani:wght@300;400;600;700&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:           #05050d;
  --bg-panel:     #07071a;
  --bg-sidebar:   #060612;
  --cyan:         #00f5ff;
  --purple:       #9b30ff;
  --purple-dim:   #5a189a;
  --pink:         #ff2d9b;
  --text:         #c8d6f0;
  --text-dim:     #5a6a8a;
  --text-ghost:   #2a3050;
  --border:       rgba(0, 245, 255, 0.12);
  --border-active:rgba(0, 245, 255, 0.45);
  --glow-cyan:    0 0 20px rgba(0, 245, 255, 0.4), 0 0 60px rgba(0, 245, 255, 0.1);
  --glow-purple:  0 0 20px rgba(155, 48, 255, 0.4), 0 0 60px rgba(155, 48, 255, 0.1);
  --font-mono:    'Share Tech Mono', monospace;
  --font-display: 'Syncopate', sans-serif;
  --font-body:    'Rajdhani', sans-serif;
  --titlebar-h:   42px;
  --statusbar-h:  32px;
  --sidebar-w:    280px;
  --transition:   0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: default;
}

/* ── OVERLAYS ────────────────────────────────────────────── */
.scanlines {
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.07) 2px,
    rgba(0,0,0,0.07) 4px
  );
}

.noise {
  position: fixed; inset: 0; z-index: 998; pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── BOOT SCREEN ─────────────────────────────────────────── */
#boot-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: #000;
  display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  padding: 10vh 12vw;
  font-family: var(--font-mono);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#boot-screen.fade-out { opacity: 0; visibility: hidden; }

#boot-header {
  display: flex; align-items: baseline; gap: 20px;
  margin-bottom: 48px;
}

.boot-logo {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  letter-spacing: 0.15em;
}

.logo-accent { color: var(--purple); }

.boot-version {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
}

#boot-lines {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 220px;
  width: 100%;
  max-width: 600px;
}

.boot-line {
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  color: #4af;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(4px);
  animation: lineIn 0.25s ease forwards;
}

.boot-line.ok::after {
  content: ' [OK]';
  color: #0f8;
}

.boot-line.warn::after {
  content: ' [WARN]';
  color: #ff0;
}

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

#boot-progress {
  margin-top: 40px;
  width: 100%;
  max-width: 600px;
  height: 2px;
  background: rgba(0, 245, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

#boot-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  box-shadow: 0 0 12px var(--cyan);
  transition: width 0.2s linear;
}

#boot-status {
  margin-top: 12px;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
}

/* ── GLITCH ON BOOT ──────────────────────────────────────── */
@keyframes glitch {
  0%,100%  { clip-path: inset(50% 0 30% 0); transform: translate(-4px,0); }
  20%      { clip-path: inset(10% 0 60% 0); transform: translate(4px,0); }
  40%      { clip-path: inset(70% 0 5% 0);  transform: translate(-2px,0); }
  60%      { clip-path: inset(30% 0 40% 0); transform: translate(3px,0); }
  80%      { clip-path: inset(80% 0 2% 0);  transform: translate(-3px,0); }
}

.glitch-flash {
  animation: glitch 0.2s steps(2) infinite;
  color: var(--pink) !important;
}

/* ── HIDDEN ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── OS SHELL ────────────────────────────────────────────── */
#os-shell {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.8s ease;
}

#os-shell.visible { opacity: 1; }

/* ── TITLEBAR ────────────────────────────────────────────── */
#titlebar {
  height: var(--titlebar-h);
  min-height: var(--titlebar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: rgba(5, 5, 20, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.titlebar-left {
  display: flex; align-items: center; gap: 10px;
}

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.titlebar-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-left: 10px;
}

.titlebar-right {
  display: flex; gap: 16px; align-items: center;
}

.sys-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  border: 1px solid var(--text-ghost);
  padding: 2px 8px;
  border-radius: 2px;
}

.pulse-tag {
  color: #0f8;
  border-color: rgba(0, 255, 136, 0.3);
  animation: pulse-opacity 2s ease-in-out infinite;
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

#sys-time {
  color: var(--cyan);
  opacity: 0.6;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
#layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--cyan);
  letter-spacing: 0.2em;
  opacity: 0.8;
}

.sidebar-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-top: 4px;
}

#module-list {
  flex: 1;
  list-style: none;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--purple-dim) transparent;
}

#module-list::-webkit-scrollbar { width: 3px; }
#module-list::-webkit-scrollbar-thumb { background: var(--purple-dim); border-radius: 3px; }

.module-item {
  position: relative;
  padding: 14px 20px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  margin: 2px 0;
}

.module-item::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,245,255,0.04), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.module-item:hover {
  transform: translateX(4px);
  border-left-color: rgba(0, 245, 255, 0.4);
}

.module-item:hover::before { opacity: 1; }

.module-item.active {
  border-left-color: var(--cyan);
  background: linear-gradient(90deg, rgba(0,245,255,0.08), transparent);
}

.module-item.active::before { opacity: 1; }

.mi-index {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.module-item.active .mi-index { color: var(--cyan); opacity: 0.7; }

.mi-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.module-item.active .mi-title {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0,245,255,0.5);
}

.mi-mood {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.3;
  font-weight: 300;
}

.mi-indicator {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  opacity: 0;
  transition: opacity var(--transition);
}

.module-item.active .mi-indicator { opacity: 1; animation: pulse-opacity 1.5s ease-in-out infinite; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}

.sf-row {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.sf-val { color: var(--text); }

.pulse-text {
  color: #0f8;
  animation: pulse-opacity 2s ease-in-out infinite;
}

/* ── MAIN PANEL ──────────────────────────────────────────── */
#main-panel {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: var(--bg-panel);
}

/* Ambient orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.orb-1 {
  width: 500px; height: 500px;
  background: rgba(155, 48, 255, 0.12);
  top: -150px; right: -150px;
  animation: orbFloat1 8s ease-in-out infinite;
}

.orb-2 {
  width: 400px; height: 400px;
  background: rgba(0, 245, 255, 0.08);
  bottom: -100px; left: -100px;
  animation: orbFloat2 10s ease-in-out infinite;
}

.orb-3 {
  width: 250px; height: 250px;
  background: rgba(255, 45, 155, 0.06);
  top: 40%; left: 40%;
  animation: orbFloat3 12s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(-30px, 30px) scale(1.1); }
}
@keyframes orbFloat2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(20px, -20px) scale(0.95); }
}
@keyframes orbFloat3 {
  0%,100% { transform: translate(-50%,-50%) scale(1); }
  33%      { transform: translate(-50%,-50%) scale(1.2) translateX(20px); }
  66%      { transform: translate(-50%,-50%) scale(0.9) translateY(10px); }
}

/* ── NODE DISPLAY ────────────────────────────────────────── */
#node-display {
  position: relative; z-index: 2;
  width: 100%; max-width: 680px;
  padding: 48px;
  animation: panelBreathe 6s ease-in-out infinite;
}

@keyframes panelBreathe {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

#node-display.switching {
  animation: switchOut 0.2s ease forwards;
}

#node-display.switching-in {
  animation: switchIn 0.35s ease forwards;
}

@keyframes switchOut {
  to { opacity: 0; transform: translateY(12px); }
}

@keyframes switchIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.node-index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--purple);
  letter-spacing: 0.3em;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(155,48,255,0.6);
}

.node-mood {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--cyan);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  opacity: 0.8;
  font-style: italic;
  min-height: 1.4em;
}

.node-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-shadow:
    0 0 30px rgba(0,245,255,0.4),
    0 0 80px rgba(0,245,255,0.1);
  margin-bottom: 28px;
}

.node-divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
}

.node-divider span:first-child,
.node-divider span:last-child {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-active));
}

.node-divider span:last-child {
  background: linear-gradient(90deg, var(--border-active), transparent);
}

.div-icon {
  flex: none;
  color: var(--cyan);
  font-size: 0.9rem;
  text-shadow: var(--glow-cyan);
}

.node-desc {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 500px;
}

.node-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 32px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--purple);
  border: 1px solid rgba(155,48,255,0.3);
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 0.12em;
  background: rgba(155,48,255,0.05);
}

/* ── SPOTIFY BUTTON ──────────────────────────────────────── */
.spotify-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 14px 28px;
  background: transparent;
  border: 1px solid rgba(0,245,255,0.3);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.spotify-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,245,255,0.08), rgba(155,48,255,0.08));
  opacity: 0;
  transition: opacity var(--transition);
}

.spotify-btn:hover {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan), inset 0 0 20px rgba(0,245,255,0.05);
  transform: translateY(-2px);
}

.spotify-btn:hover::before { opacity: 1; }

.spotify-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

.btn-arrow {
  margin-left: 4px;
  transition: transform var(--transition);
}

.spotify-btn:hover .btn-arrow { transform: translateX(4px); }

/* ── WAVEFORM ────────────────────────────────────────────── */
#waveform {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 1;
}

#wave-svg {
  width: 100%; height: 100%;
}

/* ── CORNER DECORATIONS ──────────────────────────────────── */
.corner {
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--border-active);
  border-style: solid;
  pointer-events: none;
}

.corner-tl { top: 16px; left: 16px; border-width: 2px 0 0 2px; }
.corner-tr { top: 16px; right: 16px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: 44px; left: 16px; border-width: 0 0 2px 2px; }
.corner-br { bottom: 44px; right: 16px; border-width: 0 2px 2px 0; }

/* ── STATUSBAR ───────────────────────────────────────────── */
#statusbar {
  height: var(--statusbar-h);
  min-height: var(--statusbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: rgba(3, 3, 12, 0.95);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#status-msg {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
  opacity: 0.7;
}

.status-right {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ── GLITCH TEXT EFFECT ──────────────────────────────────── */
@keyframes glitchClip1 {
  0%,100%  { clip-path: inset(40% 0 50% 0); transform: translate(-2px,0); }
  50%      { clip-path: inset(10% 0 80% 0); transform: translate(2px,0); }
}

@keyframes glitchClip2 {
  0%,100%  { clip-path: inset(60% 0 20% 0); transform: translate(2px,0); }
  50%      { clip-path: inset(80% 0 5% 0);  transform: translate(-2px,0); }
}

/* ── SCROLLBAR RESET ─────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(0,245,255,0.2) transparent; }