/* ==========================================================================
   PNDSLab Design System - Main CSS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-dark: hsl(222, 47%, 9%);
  --bg-card: hsl(222, 40%, 13%);
  --bg-card-hover: hsl(222, 38%, 16%);
  --bg-glass: rgba(18, 25, 41, 0.75);
  --bg-glass-border: rgba(255, 255, 255, 0.08);

  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 70%);
  --text-muted: hsl(215, 16%, 50%);

  --primary-500: hsl(238, 83%, 66%);
  --primary-600: hsl(238, 75%, 58%);
  --primary-glow: rgba(99, 102, 241, 0.25);

  --emerald-500: hsl(160, 84%, 39%);
  --emerald-glow: rgba(16, 185, 129, 0.2);

  --amber-500: hsl(38, 92%, 50%);
  --amber-glow: rgba(245, 158, 11, 0.2);

  --rose-500: hsl(346, 84%, 61%);
  --rose-glow: rgba(244, 63, 94, 0.2);

  --cyan-500: hsl(189, 94%, 43%);

  /* Specific Component Variables */
  --pipeline-bg: rgba(18, 25, 41, 0.5);
  --input-bg: hsl(222, 47%, 9%);
  --input-border: rgba(255, 255, 255, 0.08);
  --badge-draft-color: #cbd5e1;
  --audio-bg: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  --progress-track: hsl(222, 47%, 9%);

  /* Layout & Spacing */
  --sidebar-width: 260px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Transitions & Shadows */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-dark: hsl(215, 28%, 95%);
  --bg-card: hsl(0, 0%, 100%);
  --bg-card-hover: hsl(215, 25%, 92%);
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-glass-border: rgba(203, 213, 225, 0.7);

  --text-primary: hsl(222, 47%, 12%);
  --text-secondary: hsl(215, 25%, 32%);
  --text-muted: hsl(215, 16%, 45%);

  --primary-500: hsl(238, 75%, 55%);
  --primary-600: hsl(238, 70%, 48%);
  --primary-glow: rgba(99, 102, 241, 0.15);

  --shadow-card: 0 4px 20px -2px rgba(148, 163, 184, 0.25);

  --pipeline-bg: rgba(241, 245, 249, 0.85);
  --input-bg: hsl(0, 0%, 100%);
  --input-border: hsl(215, 20%, 82%);
  --badge-draft-color: #475569;
  --audio-bg: linear-gradient(135deg, hsl(215, 25%, 97%), hsl(220, 20%, 92%));
  --progress-track: hsl(215, 20%, 90%);
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-card-hover);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-600);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
h4 { font-size: 1.1rem; }

a {
  color: var(--primary-500);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: hsl(238, 90%, 75%);
}

/* Main Layout Structure */
#app {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--bg-glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
}

.sidebar-logo {
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--bg-glass-border);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-500), var(--cyan-500));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.sidebar-logo-subtitle {
  font-size: 0.7rem;
  color: var(--emerald-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--bg-glass-border);
}

.nav-item.active {
  color: var(--primary-600);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
  font-weight: 700;
}

.nav-item.active i {
  color: var(--primary-500);
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--bg-glass-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--primary-500);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.top-header {
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-search {
  position: relative;
  width: 320px;
}

.header-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.header-search input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: all var(--transition-fast);
}

.header-search input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-btn {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.header-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  background: var(--rose-500);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* Main Content Container */
.content-body {
  padding: 2rem;
  flex: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s ease-in-out forwards;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glass Card Component Base */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
