/* RedactorApp - Premium Elegant Medical Theme */
/* Based on globals.css design system */

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

/* ============================================
   CSS VARIABLES - Design System
   ============================================ */
:root {
  /* Primary Colors - Deep Blue */
  --color-primary: #1B277A;
  --color-primary-hover: #141d5e;
  --color-primary-light: #e8eaf4;
  --color-primary-fg: #ffffff;

  /* Secondary Colors - Red */
  --color-secondary: #B9131E;
  --color-secondary-hover: #8f0f18;
  --color-secondary-light: #fce8e9;
  --color-secondary-fg: #ffffff;

  /* Accent Colors */
  --color-accent-purple: #8C05DB;
  --color-accent-green: #01FF79;

  /* Neutral Colors */
  --color-bg: linear-gradient(135deg, #e8eaf4 0%, #f0f1f8 100%);
  --color-surface: #ffffff;
  --color-surface-alt: #f8fafc;
  --color-text: #1a202c;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  /* Status */
  --color-success: #059669;
  --color-success-light: #ecfdf5;
  --color-warning: #d97706;
  --color-warning-light: #fffbeb;
  --color-error: #dc2626;
  --color-error-light: #fef2f2;
  --color-info: #0891b2;
  --color-info-light: #ecfeff;

  /* Typography */
  --font-heading: "DM Sans", sans-serif;
  --font-body: "Roboto", sans-serif;
  --font-accent: "Inter", sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(27, 39, 122, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--color-bg) !important;
  color: var(--color-text);
  font-size: 0.9375rem;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 50%, var(--color-accent-purple) 100%);
  color: white;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(27, 39, 122, 0.3);
}

.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.08)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.08)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.5;
  pointer-events: none;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.navbar-brand {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: white !important;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.navbar-brand:hover {
  opacity: 0.9;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-email {
  font-family: var(--font-accent);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

.navbar-logout {
  font-family: var(--font-accent);
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.navbar-logout:hover {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* ============================================
   ALERTS / MESSAGES
   ============================================ */
.alert {
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  border-left: 4px solid;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.alert-success {
  border-color: var(--color-success);
  background: var(--color-success-light);
  color: #065f46;
}

.alert-error {
  border-color: var(--color-error);
  background: var(--color-error-light);
  color: #991b1b;
}

.alert-warning {
  border-color: var(--color-warning);
  background: var(--color-warning-light);
  color: #92400e;
}

.alert-info {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ============================================
   AUTH CARDS (login, register, reset)
   ============================================ */
.auth-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.95) 100%);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.auth-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(27, 39, 122, 0.02) 0%, rgba(140, 5, 219, 0.02) 100%);
  pointer-events: none;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-subtitle {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27, 39, 122, 0.1);
}

.form-input::placeholder {
  color: #94a3b8;
}

.form-select {
  width: 100%;
  padding: 0.625rem 2.5rem 0.625rem 0.875rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  transition: all var(--transition-fast);
}

.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27, 39, 122, 0.1);
}

.form-error {
  font-size: 0.75rem;
  color: var(--color-error);
  margin-top: 0.25rem;
}

.form-checkbox {
  accent-color: var(--color-primary);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  outline: none;
  letter-spacing: 0.015em;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Primary Button - Deep Blue with shimmer */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-fg) !important;
  box-shadow: var(--shadow);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-fg);
  color: var(--color-primary) !important;
  border: 1px solid var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:hover:not(:disabled)::before {
  left: 100%;
}

/* Secondary/Outline Button */
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-secondary) !important;
  border: 1px solid var(--color-secondary);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-primary);
  color: var(--color-primary-fg) !important;
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Danger Button */
.btn-danger {
  background: var(--color-secondary-light);
  color: var(--color-secondary) !important;
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-secondary);
  color: var(--color-secondary-fg) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted) !important;
  border: 1px solid var(--color-border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-primary-light);
  color: var(--color-primary) !important;
  border-color: var(--color-primary);
}

/* Record Button */
.btn-record {
  background: var(--color-secondary);
  color: white !important;
  box-shadow: 0 4px 15px rgba(185, 19, 30, 0.3);
}

.btn-record:hover:not(:disabled) {
  background: var(--color-secondary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(185, 19, 30, 0.4);
}

/* Stop Button */
.btn-stop {
  background: #374151;
  color: white !important;
}

.btn-stop:hover:not(:disabled) {
  background: #1f2937;
}

/* QR Button - Purple accent */
.btn-qr {
  background: linear-gradient(135deg, rgba(140, 5, 219, 0.1) 0%, rgba(27, 39, 122, 0.1) 100%);
  color: var(--color-accent-purple) !important;
  border: 1px solid rgba(140, 5, 219, 0.2);
}

.btn-qr:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-accent-purple) 0%, var(--color-primary) 100%);
  color: white !important;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(140, 5, 219, 0.3);
}

/* Upload Button */
.btn-upload {
  background: var(--color-surface-alt);
  color: var(--color-text) !important;
  border: 1px solid var(--color-border);
  cursor: pointer;
}

.btn-upload:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary) !important;
}

/* Small action buttons (copy, clear) */
.btn-action {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  font-weight: 500;
}

/* Full-width button */
.btn-block {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

/* ============================================
   WORKSPACE - AUDIO CONTROLS PANEL
   ============================================ */
.audio-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.95) 100%);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ============================================
   MODE SELECTOR
   ============================================ */
.mode-selector {
  display: flex;
  background: var(--color-primary-light);
  padding: 3px;
}

.mode-btn {
  padding: 0.4rem 1rem;
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.mode-btn:not(.active):hover {
  color: var(--color-primary);
}

/* ============================================
   SECTION CARDS (medical-card style)
   ============================================ */
.section-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.95) 100%);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: all var(--transition-normal);
  position: relative;
}

.section-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(27, 39, 122, 0.01) 0%, rgba(185, 19, 30, 0.01) 100%);
  pointer-events: none;
}

.section-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-left-color: var(--color-secondary);
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
}

.section-content {
  min-height: 60px;
  padding: 0.75rem;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  white-space: pre-wrap;
  line-height: 1.6;
}

.section-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

/* ============================================
   PROCESSING INDICATORS
   ============================================ */
.processing-bar {
  background: var(--color-primary-light);
  border: 1px solid rgba(27, 39, 122, 0.15);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.processing-bar .spinner {
  border-color: rgba(27, 39, 122, 0.2);
  border-top-color: var(--color-primary);
}

.processing-bar .text {
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
}

.error-bar {
  background: var(--color-error-light);
  border: 1px solid rgba(220, 38, 38, 0.15);
  border-left: 4px solid var(--color-error);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.error-bar .text {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: #991b1b;
}

/* ============================================
   SPINNER
   ============================================ */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(27, 39, 122, 0.2);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.spinner-white {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: white;
}

/* ============================================
   QR MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  max-width: 24rem;
  width: 100%;
  margin: 1rem;
  animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-text);
}

/* ============================================
   BMI WIDGET
   ============================================ */
.bmi-input {
  width: 5.5rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.875rem;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  transition: all var(--transition-fast);
}

.bmi-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(27, 39, 122, 0.08);
  outline: none;
}

.bmi-result {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-primary-light);
  border-left: 3px solid var(--color-primary);
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* ============================================
   STANDARD PARAGRAPHS
   ============================================ */
.paragraph-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.paragraph-label:hover {
  color: var(--color-primary);
}

/* ============================================
   BOTTOM ACTIONS
   ============================================ */
.bottom-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.75rem;
}

/* ============================================
   LINK STYLES
   ============================================ */
.link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* ============================================
   RECORDING INDICATOR
   ============================================ */
.recording-dot {
  width: 0.75rem;
  height: 0.75rem;
  background: white;
  display: inline-block;
}

.recording-pulse {
  color: var(--color-secondary);
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 600;
  animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   MOBILE CAPTURE PAGE
   ============================================ */
.mobile-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: white;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(27, 39, 122, 0.3);
}

.mobile-header h1 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
}

.mobile-header .timer {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.record-circle {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: var(--color-secondary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 25px rgba(185, 19, 30, 0.4);
  transition: all var(--transition-normal);
}

.record-circle:hover {
  background: var(--color-secondary-hover);
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(185, 19, 30, 0.5);
}

.animate-pulse-red {
  animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 19, 30, 0.4); }
  50% { box-shadow: 0 0 0 14px rgba(185, 19, 30, 0); }
}

/* ============================================
   EXPIRED PAGE
   ============================================ */
.expired-container {
  text-align: center;
  padding: 2rem;
}

.expired-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.expired-title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.expired-text {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ============================================
   ANIMATIONS
   ============================================ */
.animate-fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

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

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================
   PAGE WRAPPER
   ============================================ */
.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   WORKSPACE HEADER
   ============================================ */
.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.workspace-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

/* ============================================
   DIVIDER
   ============================================ */
.divider {
  color: var(--color-border-strong);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}

::-webkit-scrollbar-thumb {
  background: rgba(27, 39, 122, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(27, 39, 122, 0.3);
}

/* ============================================
   SELECTION
   ============================================ */
::selection {
  background: rgba(27, 39, 122, 0.15);
  color: var(--color-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .workspace-header {
    flex-direction: column;
    align-items: stretch;
  }

  .bottom-actions {
    flex-direction: column;
  }

  .bottom-actions .btn {
    width: 100%;
  }

  .section-card:hover {
    transform: translateY(-1px);
  }

  .navbar-inner {
    padding: 0.75rem 1rem;
  }

  .auth-card {
    padding: 1.75rem;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: 1rem 0.75rem;
  }

  .audio-panel {
    padding: 1rem;
  }

  .section-card {
    padding: 1rem;
  }
}

/* ============================================
   TAILWIND UTILITY REPLACEMENTS
   ============================================ */

/* Display */
.hidden { display: none !important; }
.flex { display: flex; }

/* Flex Direction & Wrap */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }

/* Alignment */
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Gap */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* Margin */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Padding */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }

/* Sizing */
.w-full { width: 100%; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.min-h-screen { min-height: 100vh; }
.max-w-5xl { max-width: 64rem; }

/* Typography */
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.whitespace-pre-wrap { white-space: pre-wrap; }

/* Colors */
.text-white { color: #ffffff; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }

/* Borders */
.border { border: 1px solid #e5e7eb; }
.border-t { border-top: 1px solid #e5e7eb; }
.border-gray-200 { border-color: #e5e7eb; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-md { border-radius: 0.375rem; }

/* Spacing between children */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* ============================================
   PRINT
   ============================================ */
@media print {
  body {
    background: white !important;
  }

  .navbar, .audio-panel, .bottom-actions, .btn-action {
    display: none !important;
  }

  .section-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}
