/* StandBy Mode Pro - Core Stylesheet */
:root {
  --bg-primary: #0a0a0c;
  --bg-surface: rgba(22, 22, 26, 0.7);
  --bg-surface-hover: rgba(32, 32, 38, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.25);
  --text-primary: #f4f4f6;
  --text-secondary: #94949e;
  --text-muted: #5c5c66;
  --accent-color: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --danger-color: #ef4444;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --card-radius: 1.5rem;
  --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-display: 'Syne', sans-serif;
  --font-digital: 'VT323', monospace;
  --night-tint: #ff3b30;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  user-select: none;
  touch-action: manipulation;
}

/* Glassmorphism Surface */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-pill {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.glass-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.glass-pill.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

/* Ambient Canvas Layer */
#ambient-canvas-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
  transition: opacity 0.5s ease;
}

/* App Container */
#app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: filter 0.4s ease, transform 0.3s ease;
}

/* Top Quick Control Bar */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  z-index: 50;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.autohide-bar {
  opacity: 1;
  transition: opacity 0.4s ease;
}

body.idle-dim .autohide-bar {
  opacity: 0;
  pointer-events: none;
}

/* Modal and Drawers */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 680px;
  max-height: 88vh;
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.94) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-card {
  transform: scale(1) translateY(0);
}

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

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

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

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

/* Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: rgba(20, 20, 24, 0.95);
  color: #e5e5e9;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.15s ease;
  z-index: 100;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Button & Control Micro-interactions */






.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
}



/* Universal SVG Visibility & Rendering */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  overflow: visible;
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: #ffffff !important;
  stroke-width: 2px;
  display: block;
  pointer-events: none;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.btn-icon:active {
  transform: scale(0.95);
}

.btn-icon.active {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ff3b30 !important;
}

.btn-icon.active svg {
  stroke: #ff3b30 !important;
}

/* Ambient Custom Wallpaper Layer */
#ambient-wallpaper-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

#ambient-canvas-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/*
 * Duplicate of the #app-shell rule at the top of this file, merged in.
 *
 * Two rules for one id in one stylesheet: the second silently wins, so the first
 * was dead code that still had to be read and understood. They differed only in
 * `width` - 100% versus 100vw - and 100vw includes the scrollbar gutter, which
 * on a narrow screen produces a horizontal scrollbar for no reason.
 */
#app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

/* OLED Floating Screensaver Layer */
#screensaver-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

#screensaver-layer.active {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.screensaver-float-content {
  animation: screensaverFloat 30s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes screensaverFloat {
  0% { transform: translate(-12vw, -10vh); }
  25% { transform: translate(10vw, -6vh); }
  50% { transform: translate(12vw, 10vh); }
  75% { transform: translate(-8vw, 8vh); }
  100% { transform: translate(-12vw, -10vh); }
}
