/* ==========================================================================
   BURRO ROJO PRODUCER - DESIGN SYSTEM & STYLESHEET
   Mobile-First, Dark Mode, High Contrast, Cusqueño Pride
   ========================================================================== */

:root {
  --primary-red: #E11B23;
  --dark-red: #A90A12;
  --bg-color: #060709;
  --surface-color: #111316;
  --surface-raised: #17191D;
  --surface-hover: #22262D;
  --text-white: #F7F7F7;
  --text-muted: #A6ABB3;
  --border-color: #373B41;
  --border-focus: #E11B23;
  
  --status-queued: #6B7280;
  --status-generating: #3B82F6;
  --status-captioning: #8B5CF6;
  --status-ready: #10B981;
  --status-scheduling: #F59E0B;
  --status-scheduled: #059669;
  --status-failed: #EF4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-red-glow: 0 0 25px rgba(225, 27, 35, 0.28);
}

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

html, body {
  background-color: var(--bg-color);
  color: var(--text-white);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.02em;
}

p {
  color: var(--text-white);
}

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

.text-red {
  color: var(--primary-red);
}

/* App Container */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 84px; /* Space for mobile bottom bar */
}

@media (min-width: 992px) {
  .app-wrapper {
    padding-bottom: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* Top Header Bar */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(6, 7, 9, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-title .burro {
  color: var(--text-white);
}

.brand-title .rojo {
  color: var(--primary-red);
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-link-btn {
  background-color: var(--surface-raised);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.admin-link-btn:hover {
  color: var(--text-white);
  border-color: var(--primary-red);
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.logout-btn:hover {
  color: var(--primary-red);
}

/* Bottom Navigation (Mobile First) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background-color: rgba(17, 19, 22, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

@media (min-width: 992px) {
  .bottom-nav {
    display: none;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
  width: 25%;
  height: 100%;
  position: relative;
  transition: color 0.2s ease;
}

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

.nav-item svg {
  width: 22px;
  height: 22px;
}

/* Desktop Header Navigation */
.desktop-nav {
  display: none;
}

@media (min-width: 992px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .desktop-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
  }

  .desktop-nav-link:hover, .desktop-nav-link.active {
    color: var(--text-white);
    background-color: var(--surface-raised);
  }

  .desktop-nav-link.active {
    border-bottom: 2px solid var(--primary-red);
    color: var(--primary-red);
  }
}

/* Main Content Layout */
.main-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}

/* Cards & Surfaces */
.card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary {
  background-color: var(--primary-red);
  color: var(--text-white);
  box-shadow: 0 4px 16px rgba(225, 27, 35, 0.35);
}

.btn-primary:hover {
  background-color: var(--dark-red);
}

.btn-secondary {
  background-color: var(--surface-raised);
  border: 1px solid var(--border-color);
  color: var(--text-white);
}

.btn-secondary:hover {
  background-color: var(--surface-hover);
  border-color: var(--text-muted);
}

.btn-outline-danger {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: #EF4444;
}

.btn-outline-danger:hover {
  border-color: #EF4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  width: auto;
}

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background-color: var(--surface-raised);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 2px rgba(225, 27, 35, 0.2);
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-left {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon-right {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
}

.input-with-left-icon {
  padding-left: 42px;
}

.input-with-right-icon {
  padding-right: 42px;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-badge.queued {
  background-color: rgba(107, 114, 128, 0.2);
  color: var(--status-queued);
  border: 1px solid var(--status-queued);
}

.status-badge.generating {
  background-color: rgba(59, 130, 246, 0.2);
  color: var(--status-generating);
  border: 1px solid var(--status-generating);
}

.status-badge.captioning {
  background-color: rgba(139, 92, 246, 0.2);
  color: var(--status-captioning);
  border: 1px solid var(--status-captioning);
}

.status-badge.ready {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--status-ready);
  border: 1px solid var(--status-ready);
}

.status-badge.scheduling {
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--status-scheduling);
  border: 1px solid var(--status-scheduling);
}

.status-badge.scheduled {
  background-color: rgba(5, 150, 105, 0.2);
  color: var(--status-scheduled);
  border: 1px solid var(--status-scheduled);
}

.status-badge.failed {
  background-color: rgba(239, 68, 68, 0.2);
  color: var(--status-failed);
  border: 1px solid var(--status-failed);
}

/* Pulse Animation for In-Progress States */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  display: inline-block;
  animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Alert Banners */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid #10B981;
  color: #34D399;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #F87171;
}

/* Voice Recording Giant Button */
.voice-hero-card {
  text-align: center;
  padding: 30px 20px;
  background: radial-gradient(circle at 50% 30%, rgba(225, 27, 35, 0.12) 0%, rgba(17, 19, 22, 1) 70%);
}

.voice-record-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
  border: 4px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 35px rgba(225, 27, 35, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.voice-record-btn:active, .voice-record-btn.recording {
  transform: scale(1.08);
  box-shadow: 0 0 50px rgba(225, 27, 35, 0.8);
  animation: recording-glow 1s infinite alternate;
}

.voice-record-btn.transcribing {
  opacity: 0.9;
  cursor: wait;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.5);
  animation: transcribing-pulse 1.2s infinite ease-in-out;
}

.voice-record-btn.error {
  border-color: #EF4444;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
}

@keyframes recording-glow {
  from { box-shadow: 0 0 20px rgba(225, 27, 35, 0.5); }
  to { box-shadow: 0 0 45px rgba(225, 27, 35, 0.9); }
}

@keyframes transcribing-pulse {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.04); filter: brightness(1.2); }
  100% { transform: scale(1); filter: brightness(1); }
}

.spin-icon {
  animation: spin-kf 1s linear infinite;
}

@keyframes spin-kf {
  100% { transform: rotate(360deg); }
}

/* Inline state indicator inside existing composer */
.inline-transcribing-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #F59E0B;
}

.inline-transcribing-state.success {
  color: #10B981;
}

.inline-transcribing-state.error {
  color: #EF4444;
}

/* Tabs */
.tabs-header {
  display: flex;
  background-color: var(--surface-raised);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.tab-link {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.tab-link.active {
  background-color: var(--surface-color);
  color: var(--text-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab-badge {
  background-color: var(--surface-hover);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: 4px;
}

.tab-link.active .tab-badge {
  background-color: var(--primary-red);
  color: var(--text-white);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(6, 7, 9, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
