:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
}

html, body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
}

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar {
  background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
  width: 260px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  overflow-y: auto;
}

  .sidebar .top-row {
    background-color: rgba(0, 0, 0, .4);
  }

  .sidebar .navbar-brand {
    font-size: 1.1rem;
    font-weight: bold;
    color: white !important;
  }

  .sidebar .nav-item {
    font-size: 0.9rem;
    position: relative;
  }

    .sidebar .nav-item::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 1rem;
      right: 1rem;
      height: 1px;
      background-color: rgba(255, 255, 255, 0.1);
    }

  .sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
  }

    .sidebar .nav-link:hover {
      color: white;
      background-color: rgba(255, 255, 255, 0.1);
    }

    .sidebar .nav-link.active {
      background-color: rgba(255, 255, 255, 0.2);
      color: white;
    }

.main {
  flex: 1;
  margin-left: 260px;
}

.top-row {
  background-color: white;
  border-bottom: 1px solid #e9ecef;
  height: 3.5rem;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.content {
  padding: 1.5rem;
  flex: 1;
}

.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0052cc 100%);
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}

.card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

  .card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

.btn {
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

.form-control {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

  .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  }

.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

  .navbar-toggler:focus {
    box-shadow: none;
  }

.valid.modified:not([type=checkbox]) {
  outline: 1px solid #26b050;
}

.invalid {
  outline: 1px solid #e50000;
}

.validation-message {
  color: #e50000;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

#blazor-error-ui {
  background: lightyellow;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

  #blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
  }

/* ===== AI VOICE ASSISTANT - MINIMAL PANEL ===== */
.ai-voice-panel {
  position: fixed !important;
  bottom: 30px !important;
  right: 30px !important;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 40px rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  min-width: 180px;
  animation: ai-panel-pulse 3s ease-in-out infinite;
}

@keyframes ai-panel-pulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 20px rgba(59, 130, 246, 0.2);
  }
  50% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 40px rgba(59, 130, 246, 0.4);
  }
}

.theme-dark .ai-voice-panel {
  background: rgba(31, 41, 55, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
}

.ai-panel-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.ai-panel-close:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.theme-dark .ai-panel-close {
  color: rgba(255, 255, 255, 0.5);
}

.theme-dark .ai-panel-close:hover {
  background: rgba(220, 53, 69, 0.2);
  color: #ef4444;
}

.ai-panel-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

/* Waveform Visualization */
.ai-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 60px;
  padding: 0 10px;
}

.wave-bar {
  width: 6px;
  height: 20px;
  border-radius: 3px;
  background: #94a3b8;
  transition: all 0.3s ease;
}

/* Ready State - Gray bars */
.ai-waveform.ready .wave-bar {
  background: linear-gradient(to top, #94a3b8, #cbd5e1);
}

.ai-waveform.ready:hover .wave-bar {
  background: linear-gradient(to top, #3b82f6, #60a5fa);
}

/* Connecting State - Pulsing blue */
.ai-waveform.connecting .wave-bar {
  background: linear-gradient(to top, #3b82f6, #60a5fa);
  animation: wave-pulse-connecting 1.2s ease-in-out infinite;
}

.ai-waveform.connecting .wave-bar:nth-child(1) { animation-delay: 0s; }
.ai-waveform.connecting .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.ai-waveform.connecting .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.ai-waveform.connecting .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.ai-waveform.connecting .wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave-pulse-connecting {
  0%, 100% { height: 20px; opacity: 0.6; }
  50% { height: 50px; opacity: 1; }
}

/* Listening State - Green animated bars */
.ai-waveform.listening .wave-bar {
  background: linear-gradient(to top, #10b981, #34d399);
  animation: wave-listening 1s ease-in-out infinite;
}

.ai-waveform.listening .wave-bar:nth-child(1) { animation-delay: 0s; }
.ai-waveform.listening .wave-bar:nth-child(2) { animation-delay: 0.2s; }
.ai-waveform.listening .wave-bar:nth-child(3) { animation-delay: 0.4s; }
.ai-waveform.listening .wave-bar:nth-child(4) { animation-delay: 0.6s; }
.ai-waveform.listening .wave-bar:nth-child(5) { animation-delay: 0.8s; }

@keyframes wave-listening {
  0%, 100% { height: 25px; }
  50% { height: 45px; }
}

/* Speaking State - Blue energetic bars */
.ai-waveform.speaking .wave-bar {
  background: linear-gradient(to top, #3b82f6, #60a5fa);
  animation: wave-speaking 0.4s ease-in-out infinite;
}

.ai-waveform.speaking .wave-bar:nth-child(1) { animation-delay: 0s; }
.ai-waveform.speaking .wave-bar:nth-child(2) { animation-delay: 0.05s; }
.ai-waveform.speaking .wave-bar:nth-child(3) { animation-delay: 0.1s; }
.ai-waveform.speaking .wave-bar:nth-child(4) { animation-delay: 0.15s; }
.ai-waveform.speaking .wave-bar:nth-child(5) { animation-delay: 0.2s; }

@keyframes wave-speaking {
  0%, 100% { height: 15px; }
  25% { height: 55px; }
  50% { height: 30px; }
  75% { height: 50px; }
}

/* Panel Text */
.ai-panel-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  text-align: center;
  margin: 0;
}

.theme-dark .ai-panel-text {
  color: var(--text-primary, #f3f4f6);
}

.ai-panel-hint {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  text-align: center;
  margin: 0;
}

.theme-dark .ai-panel-hint {
  color: var(--text-secondary, #9ca3af);
}

/* Disclaimer and Support Phone */
.ai-disclaimer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-dark .ai-disclaimer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.disclaimer-text {
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.5);
  text-align: center;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.theme-dark .disclaimer-text {
  color: rgba(255, 255, 255, 0.5);
}

.support-phone {
  font-size: 0.7rem;
  text-align: center;
  color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.theme-dark .support-phone {
  color: rgba(255, 255, 255, 0.6);
}

.support-phone a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.support-phone a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.theme-dark .support-phone a {
  color: #60a5fa;
}

.theme-dark .support-phone a:hover {
  color: #93c5fd;
}

/* Error Message */
.ai-error-msg {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 6px;
  color: #dc3545;
  font-size: 0.75rem;
  text-align: center;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.theme-dark .ai-error-msg {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .ai-voice-panel {
    bottom: 20px;
    right: 20px;
    padding: 16px;
    min-width: 160px;
  }
  
  .ai-waveform {
    height: 50px;
  }
}

.blazor-error-boundary {
  background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHZpZXdCb3g9IjAgMCA1NiA0OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjUgNi5MMjEgMTJMMTMuNSAxNy41TDEyLjUgMTYuNUwxOC41OCAxMkwxMi41IDcuNUwxMy41IDYuNVoiIGZpbGw9IiM1MjUyNTIiLz4KPC9zdmc+Cg==) no-repeat 1rem/1.8rem, #b32121;
  padding: 1rem 1rem 1rem 3.7rem;
  color: white;
}

  .blazor-error-boundary::after {
    content: "An error has occurred."
  }

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

    .sidebar.show {
      transform: translateX(0);
    }

  .main {
    margin-left: 0;
  }

  .top-row {
    justify-content: space-between;
  }

  .content {
    padding: 1rem;
  }
}
