/*
 * CONCEPT C: Sound Spectrum
 * Copied directly from web/design/concept-c-sound-spectrum/style.css
 * with minimal adaptations for the app
 */

:root {
  /* Primary Palette */
  --trelis-blue: #0d579b;
  --trelis-blue-50: #e8f2fc;
  --trelis-blue-100: #c5def7;
  --trelis-green: #329239;
  --trelis-green-50: #e8f5e9;
  --trelis-orange: #f7931a;
  --trelis-orange-50: #fff4e5;
  --trelis-orange-bright: #ff9f2e;
  --trelis-brown: #65410d;
  --trelis-gray: #4d4d4d;

  /* Spectrum Colors */
  --spectrum-start: #0d579b;
  --spectrum-mid: #329239;
  --spectrum-end: #f7931a;

  /* Neutral Palette */
  --bg-primary: #ffffff;
  --bg-secondary: #fafbfc;
  --bg-accent: #f0f4f8;
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-colored: 0 4px 20px rgba(13, 87, 155, 0.15);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
  background: var(--bg-primary);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
}

/* ============================================
   NAVBAR - Spectrum Bar
   ============================================ */

.navbar {
  background: var(--bg-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1rem 1.5rem;
  position: relative;
}

/* Spectrum accent line */
.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0d579b 0%, #329239 50%, #f7931a 100%);
  z-index: 100;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-primary) !important;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-brand .word-highlight {
  display: inline-block;
  position: relative;
}

.navbar-brand .word-highlight::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--trelis-orange-50), var(--trelis-orange));
  z-index: -1;
  border-radius: 4px;
  opacity: 0.5;
}

/* Sound wave logo */
.navbar-brand::before {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='spectrum' x1='0%25' y1='0%25' x2='100%25' y2='0%25'%3E%3Cstop offset='0%25' stop-color='%230d579b'/%3E%3Cstop offset='50%25' stop-color='%23329239'/%3E%3Cstop offset='100%25' stop-color='%23f7931a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='10' y='35' width='8' height='30' rx='4' fill='url(%23spectrum)'/%3E%3Crect x='25' y='20' width='8' height='60' rx='4' fill='url(%23spectrum)'/%3E%3Crect x='40' y='30' width='8' height='40' rx='4' fill='url(%23spectrum)'/%3E%3Crect x='55' y='15' width='8' height='70' rx='4' fill='url(%23spectrum)'/%3E%3Crect x='70' y='25' width='8' height='50' rx='4' fill='url(%23spectrum)'/%3E%3Crect x='85' y='40' width='8' height='20' rx='4' fill='url(%23spectrum)'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 600;
  padding: 0.5rem 1.25rem !important;
  border-radius: var(--radius-full);
  transition: var(--transition-smooth);
  position: relative;
}

.nav-link:hover {
  color: var(--trelis-blue) !important;
  background: var(--trelis-blue-50);
}

.nav-link.active {
  color: #fff !important;
  background: linear-gradient(135deg, var(--trelis-blue) 0%, var(--trelis-green) 100%);
}

.navbar-toggler {
  border: 2px solid var(--trelis-blue);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230d579b' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  padding: 6rem 2rem 4rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  position: relative;
  overflow: hidden;
}

/* Animated waveform background */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200' preserveAspectRatio='none'%3E%3Cpath fill='%230d579b' fill-opacity='0.03' d='M0,100 Q360,150 720,100 T1440,100 L1440,200 L0,200 Z'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200' preserveAspectRatio='none'%3E%3Cpath fill='%23329239' fill-opacity='0.02' d='M0,120 Q360,70 720,120 T1440,120 L1440,200 L0,200 Z'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200' preserveAspectRatio='none'%3E%3Cpath fill='%23f7931a' fill-opacity='0.02' d='M0,80 Q360,130 720,80 T1440,80 L1440,200 L0,200 Z'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-position: bottom;
  background-repeat: no-repeat;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 550px;
  margin: 1.5rem auto 0;
  position: relative;
  z-index: 1;
  line-height: 1.7;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-primary);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  overflow: visible !important;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-body {
  padding: 1.5rem;
}

/* Feature Cards with Spectrum Top */
.feature-card {
  position: relative;
  border-radius: var(--radius-lg) !important;
  padding-top: 1rem;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #0d579b, #329239);
  border-radius: 9999px;
  z-index: 10;
}

.feature-card.orange::before {
  background: linear-gradient(90deg, #f7931a, #ff9f2e);
}

.feature-card.green::before {
  background: linear-gradient(90deg, var(--trelis-green), #4ade80);
}

.feature-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 1.5rem auto;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--trelis-blue-50);
  transition: var(--transition-bounce);
}

.feature-card:hover .feature-icon-wrapper {
  transform: scale(1.1) rotate(-5deg);
}

.feature-icon-wrapper.green {
  background: var(--trelis-green-50);
}

.feature-icon-wrapper.orange {
  background: var(--trelis-orange-50);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
  background: var(--trelis-blue);
  border: none;
  border-radius: var(--radius-full);
  padding: 0.75rem 2rem;
  font-weight: 700;
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.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: 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: var(--trelis-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-colored);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--trelis-blue);
  color: var(--trelis-blue);
  border-radius: var(--radius-full);
  padding: 0.625rem 1.75rem;
  font-weight: 700;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: var(--trelis-blue-50);
  border-color: var(--trelis-blue);
  color: var(--trelis-blue);
}

.btn-success {
  background: var(--trelis-green);
  border: none;
  border-radius: var(--radius-full);
  padding: 0.75rem 2rem;
  font-weight: 700;
  color: #fff;
}

.btn-success:hover {
  background: #28802f;
  transform: translateY(-2px);
}

.btn-warning {
  background: var(--trelis-orange);
  border: none;
  border-radius: var(--radius-full);
  padding: 0.75rem 2rem;
  font-weight: 700;
  color: #fff;
}

.btn-warning:hover {
  background: #e08516;
  transform: translateY(-2px);
}

.btn-outline-secondary {
  border: 2px solid var(--text-muted);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  font-weight: 600;
  transition: var(--transition-smooth);
}

.btn-outline-secondary:hover {
  background: var(--bg-accent);
  border-color: var(--trelis-blue);
  color: var(--trelis-blue);
}

.btn-link {
  color: var(--trelis-blue);
  font-weight: 600;
  text-decoration: none;
}

.btn-link:hover {
  color: var(--trelis-green);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* ============================================
   FORMS
   ============================================ */

.form-control,
.form-select {
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-primary);
  border-color: var(--trelis-blue);
  box-shadow: 0 0 0 3px var(--trelis-blue-50);
}

.form-label {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-text {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.form-check-input:checked {
  background-color: var(--trelis-blue);
  border-color: var(--trelis-blue);
}

.form-check-input:focus {
  box-shadow: 0 0 0 4px var(--trelis-blue-50);
  border-color: var(--trelis-blue);
}

.input-group .btn {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.badge {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending,
.bg-secondary {
  background: var(--bg-accent) !important;
  color: var(--text-muted) !important;
}

.status-running,
.bg-primary {
  background: var(--trelis-blue-50) !important;
  color: var(--trelis-blue) !important;
  position: relative;
  padding-left: 1.75rem;
}

.status-running::before,
.bg-primary::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--trelis-blue);
  border-radius: 50%;
  animation: blink 1s infinite;
}

.status-completed,
.bg-success {
  background: var(--trelis-green-50) !important;
  color: var(--trelis-green) !important;
}

.status-failed,
.bg-danger {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

.bg-warning {
  background: var(--trelis-orange-50) !important;
  color: var(--trelis-orange) !important;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================
   TABLES
   ============================================ */

.table {
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--trelis-blue);
  color: var(--trelis-blue);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1px;
  padding: 1rem 1.25rem;
}

.table tbody tr {
  transition: var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--trelis-blue-50);
}

.table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
  background: var(--bg-secondary);
}

.table-striped tbody tr:hover {
  background: var(--trelis-blue-50);
}

/* ============================================
   METRIC DISPLAYS
   ============================================ */

.metric-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--trelis-blue), var(--trelis-green), var(--trelis-orange));
}

.metric-value {
  font-size: 3rem;
  font-weight: 800;
  color: var(--trelis-blue);
  line-height: 1;
}

.metric-value.success {
  color: var(--trelis-green);
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.75rem;
  font-weight: 600;
}

/* ============================================
   CODE BLOCKS
   ============================================ */

code {
  background: var(--bg-accent);
  color: var(--trelis-blue);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  font-weight: 500;
}

pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.alert-success {
  background: var(--trelis-green-50);
  color: var(--trelis-green);
}

.alert-warning {
  background: var(--trelis-orange-50);
  color: var(--trelis-brown);
}

.alert-danger {
  background: #fef2f2;
  color: #dc2626;
}

/* ============================================
   SPECTRUM LOADER
   ============================================ */

.spectrum-loader {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  justify-content: center;
  height: 60px;
  padding: 1rem 0;
}

.spectrum-loader .bar {
  width: 8px;
  border-radius: var(--radius-sm);
  animation: spectrum-bounce 0.8s ease-in-out infinite;
}

.spectrum-loader .bar:nth-child(1) { height: 20px; background: var(--trelis-blue); animation-delay: 0s; }
.spectrum-loader .bar:nth-child(2) { height: 35px; background: #1a6cc4; animation-delay: 0.1s; }
.spectrum-loader .bar:nth-child(3) { height: 25px; background: #2a7f32; animation-delay: 0.2s; }
.spectrum-loader .bar:nth-child(4) { height: 45px; background: var(--trelis-green); animation-delay: 0.3s; }
.spectrum-loader .bar:nth-child(5) { height: 30px; background: #6eb543; animation-delay: 0.4s; }
.spectrum-loader .bar:nth-child(6) { height: 40px; background: #c77a15; animation-delay: 0.5s; }
.spectrum-loader .bar:nth-child(7) { height: 50px; background: var(--trelis-orange); animation-delay: 0.6s; }

@keyframes spectrum-bounce {
  0%, 100% { transform: scaleY(0.6); }
  50% { transform: scaleY(1); }
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  border-top: none;
  padding: 1.5rem 0;
  position: relative;
  margin-top: 3rem;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0d579b 0%, #329239 50%, #f7931a 100%);
  z-index: 10;
}

footer small {
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.cursor-pointer {
  cursor: pointer;
}

.cursor-pointer:hover {
  background-color: var(--trelis-blue-50) !important;
}

.text-success {
  color: var(--trelis-green) !important;
}

.text-danger {
  color: #dc2626 !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.fw-bold {
  font-weight: 700 !important;
}

/* ============================================
   SPINNER
   ============================================ */

.spinner-border {
  color: var(--trelis-blue);
}

.spinner-border-sm {
  margin-left: 0.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero {
    padding: 4rem 1rem 3rem;
  }

  .card-body {
    padding: 1rem;
  }

  .metric-value {
    font-size: 2.25rem;
  }

  .navbar-brand::before {
    width: 32px;
    height: 32px;
  }

  .btn {
    padding: 0.625rem 1.25rem;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}
