/**
 * POISE MUSIC — ENTERPRISE ORCHARD RED / CORAL DESIGN SYSTEM
 * 
 * Strict Brand Guidelines & Color Specification:
 * - Primary Brand / Accent:  Orchard Red / Coral      #FF4641 (rgb: 255, 70, 65)
 * - Dark Background:         Off-Black / Deep Charcoal #121212 (rgb: 18, 18, 18)
 * - Secondary / Cards:       Dark Slate / Card Neutral #1E1E1E (rgb: 30, 30, 30)
 * - Light Background / Text: Pure White                #FFFFFF (rgb: 255, 255, 255)
 * - Muted Text / Borders:    Cool Mid-Gray             #8C8C8C (rgb: 140, 140, 140)
 * - Subtle UI Accent:        Light Silver Gray         #F4F4F4 (rgb: 244, 244, 244)
 */

:root {
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Primary Brand Accents */
  --poise-primary: #FF4641;
  --poise-primary-hover: #e03530;
  --poise-primary-glow: rgba(255, 70, 65, 0.4);
  --poise-gradient: linear-gradient(135deg, #FF4641 0%, #ff6b67 100%);
  
  --poise-emerald: #10b981;
  --poise-amber: #f59e0b;
  --poise-rose: #FF4641;
  --poise-cyan: #38bdf8;

  /* Dark Mode (High-Contrast #121212 Background & #FFFFFF Headings) */
  --bg-app: #121212;
  --bg-surface: #1E1E1E;
  --bg-surface-secondary: #262626;
  --bg-card: #1E1E1E;
  --bg-card-hover: #282828;

  --border-glass: rgba(140, 140, 140, 0.25);
  --border-subtle: rgba(140, 140, 140, 0.15);
  --border-active: #FF4641;

  --text-main: #FFFFFF;             /* Pure White Headings & Core Labels */
  --text-secondary: #F4F4F4;        /* Light Silver Gray for Crisp Body Text */
  --text-muted: #8C8C8C;            /* Cool Mid-Gray for Meta, Dates, Dividers */

  --sidebar-bg: #161616;
  --sidebar-border: rgba(140, 140, 140, 0.2);
  --sidebar-text: #8C8C8C;
  --sidebar-text-active: #FFFFFF;

  --player-bg: rgba(22, 22, 22, 0.98);
  --player-border: rgba(140, 140, 140, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(255, 70, 65, 0.4);
}

[data-theme="light"] {
  --bg-app: #FFFFFF;
  --bg-surface: #F4F4F4;
  --bg-surface-secondary: #EBEBEB;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F9F9F9;

  --border-glass: rgba(140, 140, 140, 0.3);
  --border-subtle: rgba(140, 140, 140, 0.2);
  --border-active: #FF4641;

  --text-main: #121212;
  --text-secondary: #1E1E1E;
  --text-muted: #8C8C8C;

  --sidebar-bg: #161616;
  --sidebar-border: rgba(140, 140, 140, 0.2);
  --sidebar-text: #8C8C8C;
  --sidebar-text-active: #FFFFFF;

  --player-bg: #161616;
  --player-border: rgba(140, 140, 140, 0.3);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 2px 12px rgba(255, 70, 65, 0.25);
}

/* Global Reset & Typography */
body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-secondary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main) !important;
  letter-spacing: -0.025em;
}

p, span, label, div {
  color: inherit;
}

.text-main { color: var(--text-main) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--poise-primary) !important; }

a {
  color: var(--poise-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--poise-primary-hover);
}

/* Layout System */
.poise-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.poise-sidebar {
  width: 255px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 1000;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.poise-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-bottom: 96px;
  background-color: var(--bg-app);
}

.poise-navbar {
  height: 68px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 900;
}

.poise-content {
  padding: 2rem 2rem;
  flex-grow: 1;
}

/* Sidebar Brand & Nav */
.sidebar-brand {
  padding: 1.35rem 1.4rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

.sidebar-menu {
  list-style: none;
  padding: 0.9rem 0.65rem;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--text-muted);
  padding: 0.85rem 0.75rem 0.35rem;
}

.sidebar-item {
  margin-bottom: 0.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
}

.sidebar-link:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  color: #FFFFFF;
  background-color: var(--poise-primary);
  box-shadow: 0 4px 14px rgba(255, 70, 65, 0.35);
  font-weight: 700;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Precision Cards */
.poise-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
  overflow: hidden;
}

.poise-card:hover {
  border-color: rgba(255, 70, 65, 0.4);
}

.poise-card-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.poise-card-body {
  padding: 1.5rem;
}

/* Metric Cards */
.stat-card-pro {
  padding: 1.35rem 1.5rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-card-pro:hover {
  transform: translateY(-2px);
  border-color: var(--poise-primary);
}

.stat-icon-pro {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-val-pro {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0.35rem 0 0.15rem;
  color: var(--text-main);
}

.stat-label-pro {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* Studio Hero Banner */
.studio-hero-banner {
  background: linear-gradient(135deg, rgba(255, 70, 65, 0.18) 0%, rgba(30, 30, 30, 0.95) 100%);
  border: 1px solid rgba(255, 70, 65, 0.35);
  border-radius: 14px;
  padding: 2rem 2.2rem;
  position: relative;
  overflow: hidden;
}

/* Visual Stepper */
.wizard-visual-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 1.2rem 1.5rem;
  background: var(--bg-surface-secondary);
  border-bottom: 1px solid var(--border-glass);
}

.wizard-visual-stepper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 2.5rem;
  right: 2.5rem;
  height: 2px;
  background: var(--border-glass);
  z-index: 1;
}

.wizard-step-node {
  position: relative;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-glass);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wizard-step-node:hover {
  border-color: var(--poise-primary);
  color: #FFFFFF;
}

.wizard-step-node.active {
  background-color: var(--poise-primary);
  border-color: var(--poise-primary);
  color: #FFFFFF;
  box-shadow: 0 0 16px rgba(255, 70, 65, 0.5);
  transform: scale(1.15);
}

.wizard-step-node.completed {
  background: var(--poise-emerald);
  border-color: var(--poise-emerald);
  color: #050810;
}

/* Artwork Thumbnails */
.artwork-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background-color: #262626;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  border: 1px solid var(--border-glass);
}

.artwork-thumb-lg {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  border: 2px solid var(--border-glass);
}

/* Sound Wave Equalizer */
.sound-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 15px;
  vertical-align: middle;
}

.sound-eq .bar {
  width: 2.5px;
  background: var(--poise-primary);
  border-radius: 2px;
  animation: eqBounce 1.1s ease infinite alternate;
}

.sound-eq .bar:nth-child(1) { height: 35%; animation-delay: 0.1s; }
.sound-eq .bar:nth-child(2) { height: 80%; animation-delay: 0.3s; }
.sound-eq .bar:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.sound-eq .bar:nth-child(4) { height: 50%; animation-delay: 0.4s; }

@keyframes eqBounce {
  0% { height: 20%; }
  100% { height: 100%; }
}

/* Precision Tables */
.poise-table-container {
  overflow-x: auto;
}

.poise-table {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-secondary);
  border-collapse: collapse;
}

.poise-table th {
  background: var(--bg-surface-secondary);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}

.poise-table td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.poise-table tbody tr:hover {
  background-color: rgba(255, 70, 65, 0.05);
}

/* Action Buttons */
.btn-poise-primary {
  background-color: var(--poise-primary);
  color: #FFFFFF !important;
  border: none;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.6rem 1.3rem;
  font-size: 0.88rem;
  box-shadow: 0 3px 12px rgba(255, 70, 65, 0.35);
  transition: all 0.15s ease;
}

.btn-poise-primary:hover {
  background-color: var(--poise-primary-hover);
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(255, 70, 65, 0.5);
}

.btn-poise-secondary {
  background: var(--bg-surface-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  font-weight: 600;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 0.88rem;
}

.btn-poise-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Forms & Inputs */
.form-control, .form-select {
  background-color: var(--bg-surface-secondary);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
}

.form-control:focus, .form-select:focus {
  background-color: var(--bg-surface-secondary);
  color: var(--text-main);
  border-color: var(--poise-primary);
  box-shadow: 0 0 0 3px rgba(255, 70, 65, 0.2);
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

/* Floating Audio Player */
.poise-floating-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--player-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--player-border);
  z-index: 1050;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
}

.btn-player-play-pro {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--poise-primary);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255, 70, 65, 0.4);
  transition: transform 0.15s ease;
}

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

.player-progress-fill-pro {
  height: 100%;
  background-color: var(--poise-primary);
  border-radius: 2px;
  width: 0%;
}

.player-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 38px;
}

/* Auth Cards */
.auth-page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #1E1E1E 0%, #121212 100%);
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #1E1E1E;
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 2.6rem 2.2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  color: #FFFFFF;
}

@media (max-width: 991.98px) {
  .poise-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -255px;
  }
  .poise-sidebar.show {
    left: 0;
  }
}
