@import url('./design-tokens.css');
/**
 * Loading Spinner Component
 * Used for TTS init, KG loading, settings init, etc.
 */

/* Base Spinner */
.expi-spinner {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-sm);
}

.expi-spinner-icon {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(100, 200, 255, 0.8);
    border-radius: 50%;
    animation: expi-spin 0.8s linear infinite;
}

.expi-spinner-icon.large {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

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

/* Inline Spinner (in buttons, inputs) */
.expi-spinner-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.expi-spinner-inline .expi-spinner-icon {
    width: 12px;
    height: 12px;
    border-width: 1.5px;
}

/* Overlay Spinner (covers container) */
.expi-spinner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    background: rgba(15, 20, 30, 0.85);
    backdrop-filter: blur(var(--glass-blur-md));
    border-radius: inherit;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.expi-spinner-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.expi-spinner-overlay .expi-spinner-icon {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.expi-spinner-overlay .expi-spinner-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-md);
    text-align: center;
    max-width: 200px;
}

/* TTS-specific spinner (shows in voice button area) */
.expi-tts-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(100, 200, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    color: rgba(100, 200, 255, 0.9);
}

.expi-tts-loading.visible {
    display: flex;
}

.expi-tts-loading .expi-spinner-icon {
    border-top-color: rgba(100, 200, 255, 0.9);
}

/* Thinking Animation (dots) */
.expi-thinking {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.expi-thinking-dot {
    width: 6px;
    height: 6px;
    background: rgba(100, 200, 255, 0.6);
    border-radius: 50%;
    animation: expi-thinking-pulse 1.2s ease-in-out infinite;
}

.expi-thinking-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.expi-thinking-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes expi-thinking-pulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    30% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Chat-specific: Message typing indicator */
.expi-typing-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 12px 16px;
    background: rgba(30, 35, 45, 0.8);
    border-radius: var(--radius-lg);
    margin: 8px 0;
    max-width: fit-content;
}

.expi-typing-indicator .expi-thinking {
    padding: 0 4px;
}

.expi-typing-label {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
}
/**
 * Loading Splash Screen
 * Animierter Ladebildschirm für besseren ersten Eindruck
 * @version 1.0.0
 */

/* ============================================
   SPLASH SCREEN CONTAINER
   ============================================ */
.loading-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-max);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    opacity: 1;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

/* Verstecken wenn geladen */
body.loaded .loading-splash {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ============================================
   CONTENT
   ============================================ */
.loading-splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 1;
    background: transparent;
}

/* Logo / 3D Container */
.loading-logo, .neural-3d-container {
    width: 140px;
    height: 140px;
    margin-bottom: 35px;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.4));
}

/* Deactivate old pulse for 3D container */
.neural-3d-container.loading-logo {
    animation: none;
}

@keyframes logo-pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.5));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.8));
    }
}

/* Title */
.loading-title {
    font-family: var(--font-sans, sans-serif);
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    color: #fff;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 50%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subtitle */
.loading-subtitle {
    font-family: var(--font-sans, sans-serif);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 40px 0;
    text-transform: uppercase;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.loading-progress {
    width: 280px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #d4af37, #f4d03f, #d4af37);
    background-size: 200% 100%;
    border-radius: 3px;
    animation: progress-fill 5s ease-out forwards, progress-shimmer 1.5s ease-in-out infinite;
}

@keyframes progress-fill {
    0% { width: 0%; }
    20% { width: 25%; }
    40% { width: 45%; }
    60% { width: 65%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

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

/* ============================================
   LOADING TIP
   ============================================ */
.loading-tip {
    font-family: var(--font-sans, sans-serif);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    max-width: 300px;
    min-height: 1.2em;
    animation: fade-tip 1s ease-in-out;
}

@keyframes fade-tip {
    0% { opacity: 0; transform: translateY(5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .loading-logo {
        width: 80px;
        height: 80px;
    }

    .loading-title {
        font-size: 1.8rem;
        letter-spacing: 0.2em;
    }

    .loading-progress {
        width: 200px;
    }
}
/* ============================================================================
   LOADING STATES SYSTEM
   ============================================================================
   Global and component-specific loading indicators

   Usage:
   - Global: loadingManager.show('Loading...')
   - Component: loadingManager.showComponent('my-component', 'Loading...')
   ============================================================================ */

/* Global Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(var(--glass-blur-md));
  z-index: var(--z-max);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.loading-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
  border: 1px solid rgba(var(--color-secondary-rgb), 0.3);
  border-radius: var(--radius-xl);
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(var(--color-secondary-rgb), 0.15),
    inset 0 1px 0 var(--glass-border);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.loading-spinner {
  width: 64px;
  height: 64px;
  border: 4px solid rgba(var(--color-secondary-rgb), 0.2);
  border-top: 4px solid var(--color-secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-message {
  color: #e2e8f0;
  font-size: var(--text-lg);
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Component-Specific Loading */
.component-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--glass-bg-dark);
  backdrop-filter: blur(var(--glass-blur-md));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  z-index: var(--z-dropdown);
  border-radius: inherit;
  animation: fadeIn 0.2s ease;
}

.component-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(var(--color-secondary-rgb), 0.2);
  border-top: 3px solid var(--color-secondary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.component-loading-message {
  color: var(--text-secondary);
  font-size: var(--text-md);
  font-weight: 500;
}

/* Skeleton Loaders (Alternative) */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(30, 41, 59, 0.3) 0%,
    rgba(51, 65, 85, 0.4) 50%,
    rgba(30, 41, 59, 0.3) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

/* === Splash Loader (FOUC Prevention) === */
/* During loading: show splash, hide main content */
body.loading > *:not(.loading-splash):not(canvas) {
    opacity: 0;
}
body.loading .loading-splash {
    opacity: 1;
}
body.loaded .loading-splash {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
body.loaded {
    opacity: 1;
}
body.loaded > * {
    opacity: 1;
    transition: opacity 0.5s ease;
}
/* Ensure topbar stays fixed during load */
.app-topbar {
    position: fixed !important;
}

/* === Knowledge Match Button Pulse === */
@keyframes km-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(74, 144, 226, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(74, 144, 226, 0.6);
        transform: scale(1.05);
    }
}

.km-pulse-btn {
  animation: km-pulse 1.5s infinite ease-in-out;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
  background: var(--glass-bg-light);
  border-radius: var(--radius-xs);
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-circle {
  border-radius: 50%;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

/* Loading States for Common UI Elements */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Input Loading State */
.input-loading {
  background-image: linear-gradient(
    90deg,
    rgba(var(--color-secondary-rgb), 0.1) 0%,
    rgba(var(--color-secondary-rgb), 0.2) 50%,
    rgba(var(--color-secondary-rgb), 0.1) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .loading-overlay {
    background: rgba(0, 0, 0, 0.9);
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .loading-card {
    padding: 24px 32px;
  }

  .loading-spinner {
    width: 48px;
    height: 48px;
    border-width: 3px;
  }

  .loading-message {
    font-size: 14px;
  }
}

/* ============================================================================
   REACTIVE 2026 LOADING (NEON)
   ============================================================================ */

/* Backdrop Blur effect for the main viewport when graph is loading data */
#canvas-container {
    transition: filter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

body.graph-loading #canvas-container {
    filter: blur(8px) grayscale(0.3) brightness(0.6);
    pointer-events: none;
}

.global-loading-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: var(--z-dropdown);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: transparent;
    /* Prevent sub-element 3D layers from creating a dark composite rectangle */
    isolation: isolate;
}

body.graph-loading .global-loading-overlay {
    opacity: 1;
}

/* ==================== MODERN NEURAL 3D SPINNER (2026) ==================== */

.neural-3d-container {
    perspective: 1200px;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 35px;
    position: relative;
    /* Prevent CSS 3D compositing layer from rendering as dark rectangle */
    background: transparent;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.neural-3d-spinner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: neural-global-rotate 15s linear infinite;
    background: transparent;
}

.neural-3d-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 50%;
    box-shadow:
        0 0 15px rgba(0, 240, 255, 0.1),
        inset 0 0 15px rgba(0, 240, 255, 0.1);
}

.neural-3d-ring::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #00f0ff;
    border-radius: 50%;
    box-shadow:
        0 0 15px #00f0ff,
        0 0 30px rgba(0, 240, 255, 0.6),
        0 0 50px rgba(0, 240, 255, 0.3);
}

.neural-3d-ring:nth-child(1) { transform: rotateX(75deg) rotateY(0deg); animation: neural-ring-1 3s linear infinite; }
.neural-3d-ring:nth-child(2) { transform: rotateX(75deg) rotateY(120deg); animation: neural-ring-2 3s linear infinite; }
.neural-3d-ring:nth-child(3) { transform: rotateX(75deg) rotateY(240deg); animation: neural-ring-3 3s linear infinite; }

.neural-3d-core {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #fff 10%, #00f0ff 60%, rgba(0, 240, 255, 0) 100%);
    border-radius: 50%;
    box-shadow:
        0 0 30px #00f0ff,
        0 0 60px rgba(0, 240, 255, 0.5),
        0 0 100px rgba(0, 240, 255, 0.2);
    animation: neural-core-pulse 2s ease-in-out infinite alternate;
    z-index: 10;
}

@keyframes neural-ring-1 { 0% { transform: rotateX(75deg) rotateY(0deg) rotateZ(0deg); } 100% { transform: rotateX(75deg) rotateY(0deg) rotateZ(360deg); } }
@keyframes neural-ring-2 { 0% { transform: rotateX(75deg) rotateY(120deg) rotateZ(0deg); } 100% { transform: rotateX(75deg) rotateY(120deg) rotateZ(360deg); } }
@keyframes neural-ring-3 { 0% { transform: rotateX(75deg) rotateY(240deg) rotateZ(0deg); } 100% { transform: rotateX(75deg) rotateY(240deg) rotateZ(360deg); } }

@keyframes neural-global-rotate {
    0% { transform: rotateY(0deg) rotateX(0deg); }
    100% { transform: rotateY(360deg) rotateX(20deg); }
}

@keyframes neural-core-pulse {
    0% { transform: scale(0.85); filter: brightness(0.8) blur(0.5px); }
    100% { transform: scale(1.15); filter: brightness(1.2) blur(0px); }
}

.loading-text {
    font-family: var(--font-sans, sans-serif);
    color: #00f0ff;
    text-transform: uppercase;
    letter-spacing: 5px;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.8);
    animation: neon-pulse-text 2s ease-in-out infinite alternate;
}

@keyframes neon-pulse-text {
    0% { opacity: 0.4; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1.02); }
}

/**
 * Service Status LED Indicators
 * Visual indicators for Node Server, Ollama, Voice Clone, OpenAI, Perplexity, Gemini
 */

.service-status-indicators {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduzierter Gap für Kompaktmodus */
    margin-left: 14px;
    padding: 0 12px;
    background: rgba(15, 15, 25, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    height: 28px; /* Noch flacher für Kompaktheit */
    position: relative;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    overflow: hidden;
    max-width: 130px; /* Kompaktstart */
}

.service-status-indicators:hover {
    background: rgba(25, 25, 35, 0.9);
    border-color: rgba(var(--color-primary-rgb), 0.3);
    max-width: 600px; /* Erweitert beim Hover für Details */
    gap: 12px;
    padding: 0 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Smart Health Summary */
.system-health-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary-light);
    white-space: nowrap;
    transition: all 0.3s ease;
    padding-right: 4px;
}

/* Compact Stack for Bell & Health */
.upcoming-status-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px; /* Minimal constant gap */
    margin: 0 16px;
    position: relative;
    height: 100%;
    min-width: 44px;
}

/* Bell Container */
.upcoming-status-stack .upcoming-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: none !important;
}

.upcoming-status-stack .upcoming-icon {
    font-size: 20px;
}

.system-health-summary.mini {
    padding: 2px 8px;
    margin: 0;
    cursor: pointer;
    background: var(--glass-bg-subtle) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
    z-index: 5;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.system-health-summary.mini:hover {
    background: var(--glass-bg-medium) !important;
    transform: scale(1.05);
    box-shadow: 0 0 10px color-mix(in srgb, var(--color-primary), transparent 40%) !important;
}

.system-health-summary.mini .health-text {
    display: none; /* Keep text hidden in mini mode */
}

.system-health-summary.mini .health-icon {
    font-size: 15px; /* Slightly larger and clearer */
    transform: none;
    line-height: 1;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.2));
}

/* Health status specific border colors */
.service-status-indicators.mini.all-ok #system-health-summary {
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #10b981;
}

.service-status-indicators.mini.has-issues #system-health-summary {
    border-color: rgba(244, 63, 94, 0.7) !important;
    color: #f43f5e;
    animation: mini-health-pulse 2s infinite;
}

@keyframes mini-health-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 5px rgba(244, 63, 94, 0.3); }
    50% { transform: scale(1.08); box-shadow: 0 0 12px rgba(244, 63, 94, 0.5); }
}

.health-icon {
    font-size: 15px;
    filter: drop-shadow(0 0 5px rgba(var(--color-primary-rgb), 0.5));
    animation: icon-float 3s ease-in-out infinite;
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.health-text {
    opacity: 0.9;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 9px;
}

/* Status Modes */
.service-status-indicators.all-ok {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(10, 30, 20, 0.4);
}

.service-status-indicators.all-ok .health-text {
    color: #10b981;
}

.service-status-indicators.has-issues {
    border-color: rgba(244, 63, 94, 0.4);
    background: rgba(40, 10, 20, 0.6);
    animation: critical-border-pulse 2s infinite;
}

.service-status-indicators.has-issues .health-text {
    color: #f43f5e;
}

@keyframes critical-border-pulse {
    0%, 100% { border-color: rgba(244, 63, 94, 0.3); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }
    50% { border-color: rgba(244, 63, 94, 0.8); box-shadow: 0 0 20px rgba(244, 63, 94, 0.3); }
}

/* Handle LED Visibility: Hidden by default in Smart Mode, visible on Hover */
.service-status-indicators .service-led,
.service-status-indicators .diagnostic-btn,
.service-status-indicators .topbar-separator {
    opacity: 0;
    transform: scale(0.8);
    width: 0;
    margin: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-status-indicators:hover .service-led,
.service-status-indicators:hover .diagnostic-btn {
    opacity: 1;
    transform: scale(1);
    width: auto;
    margin: 0 2px;
    pointer-events: auto;
}

/* Exception: Show OFFLINE LEDs even without hover if issues exist */
.service-status-indicators.has-issues .service-led.offline {
    opacity: 1;
    transform: scale(1);
    width: auto;
    margin: 0 4px;
    pointer-events: auto;
}

.service-status-indicators:hover .system-health-summary {
    opacity: 0.4;
}

/* LED Basestyles (Standardized) */
.service-led {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.led-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #444; /* Default offline */
    position: relative;
    transition: all 0.5s ease;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.brand-svg {
    width: 140%;
    height: 140%;
    display: none;
    color: rgba(255,255,255,0.9);
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

.service-led.online .brand-svg {
    display: block;
}

.service-led.online[data-service="openai"] .brand-svg { color: #10a37f; } /* OpenAI Green */
.service-led.online[data-service="perplexity"] .brand-svg { color: #20b2aa; } /* Perplexity Teal */
.service-led.online[data-service="gemini"] .brand-svg { color: #8e75ff; } /* Gemini Purple */

.service-led.online .led-dot {
    background: transparent !important;
    box-shadow: none !important;
}

/* Service Specific Colors when ONLINE */
.service-led[data-service="node"].online .led-dot { background: #10b981; box-shadow: 0 0 10px #10b981; }
.service-led[data-service="ollama"].online .led-dot { background: #f59e0b; box-shadow: 0 0 10px #f59e0b; }
.service-led[data-service="openai"].online .led-dot { background: #06b6d4; box-shadow: 0 0 10px #06b6d4; }
.service-led[data-service="voice"].online .led-dot { background: #f43f5e; box-shadow: 0 0 10px #f43f5e; }

.service-led.online .led-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0;
    animation: led-ring-pulse 3s infinite;
}

@keyframes led-ring-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

.led-label {
    display: none;
}

/* System Pulse Animation for the whole bar */
.service-status-indicators::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(var(--color-primary-rgb), 0.3), transparent);
    background-size: 200% 100%;
    animation: status-border-pulse 4s linear infinite;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

@keyframes status-border-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Tooltip via data-tooltip (preferred) or title */
.service-led::before {
    content: attr(title);
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    padding: 5px 10px;
    background: rgba(10, 10, 20, 0.95);
    color: white;
    font-size: 11px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.service-led:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Specific groupings visually indicated by spacers */
.service-led[data-service="openai"] {
    margin-left: 2px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 10px;
}

/* Cursor styles based on state */
.service-led.offline[data-service="voice"],
.service-led.offline[data-service="ollama"] {
    cursor: pointer;
}

.service-led.online,
.service-led.offline:not([data-service="voice"]):not([data-service="ollama"]) {
    cursor: help;
}

/* LED Status Overrides for Offline */
.service-led.offline .led-dot {
    background: #333;
    box-shadow: inset 0 0 2px rgba(0,0,0,0.8);
}

/* Offline Pulse for critical services */
.service-led.offline[data-service="node"] .led-dot {
    background: #500;
    animation: critical-offline 2s infinite;
}

@keyframes critical-offline {
    0%, 100% { background: #500; box-shadow: 0 0 2px #f00; }
    50% { background: #900; box-shadow: 0 0 8px #f00; }
}

.service-led.online .led-dot {
    background: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
    animation: pulse-green 2s ease-in-out infinite;
}

.service-led.online .led-dot::after {
    background: radial-gradient(circle, rgba(0, 255, 136, 0.4) 0%, transparent 70%);
    opacity: 1;
}

.service-led.starting .led-dot {
    background: #ffaa00;
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.6);
    animation: pulse-yellow 1s ease-in-out infinite;
}

.service-led.starting .led-dot::after {
    background: radial-gradient(circle, rgba(255, 170, 0, 0.4) 0%, transparent 70%);
    opacity: 1;
}

/* Animations */
@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
    }
    50% {
        box-shadow: 0 0 12px rgba(0, 255, 136, 0.8), 0 0 20px rgba(0, 255, 136, 0.4);
    }
}

@keyframes pulse-yellow {
    0%, 100% {
        box-shadow: 0 0 6px rgba(255, 170, 0, 0.4);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 12px rgba(255, 170, 0, 0.8);
        opacity: 0.7;
    }
}

/* Responsive: Noch kompakter auf kleinen Screens */
@media (max-width: 1000px) {
    .service-status-indicators {
        gap: 2px;
        padding: 3px 2px;
    }

    .service-led {
        width: 14px;
        height: 14px;
    }

    .led-dot {
        width: 6px;
        height: 6px;
    }
}
/**
 * Voice Services Status Banner & Modal Styles
 */

/* ============================================================================
   Status Banner (Top of Page)
   ============================================================================ */

.voice-services-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-dropdown);
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    padding: 16px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.voice-services-banner.visible {
    transform: translateY(0);
}

.voice-services-banner.warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.voice-services-banner.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    max-width: 1400px;
    margin: 0 auto;
}

.banner-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.banner-message {
    flex: 1;
    min-width: 0;
}

.banner-message strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.banner-message p {
    margin: 2px 0;
    font-size: 14px;
    opacity: 0.95;
}

.banner-hint {
    font-size: 13px !important;
    opacity: 0.85 !important;
    font-style: italic;
}

.banner-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.banner-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.banner-btn.primary {
    background: rgba(255, 255, 255, 0.95);
    color: #f57c00;
}

.banner-btn.primary:hover {
    background: white;
    transform: scale(1.05);
}

.banner-btn.secondary {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 8px 12px;
}

.banner-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   Instructions Modal
   ============================================================================ */

.voice-services-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-dropdown);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.voice-services-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(var(--glass-blur-md));
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.voice-services-modal.visible .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 24px;
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 180px);
    color: white;
}

.modal-body h3 {
    margin: 20px 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #4fc3f7;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.code-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.code-block code {
    font-family: var(--font-mono, monospace);
    font-size: 14px;
    color: #4fc3f7;
    flex: 1;
    word-break: break-all;
}

.code-block button {
    background: rgba(79, 195, 247, 0.2);
    border: 1px solid rgba(79, 195, 247, 0.3);
    color: #4fc3f7;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.code-block button:hover {
    background: rgba(79, 195, 247, 0.3);
    transform: scale(1.05);
}

.service-commands {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.service-command strong {
    display: block;
    margin-bottom: 8px;
    color: #81c784;
    font-size: 14px;
}

.modal-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-footer p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .banner-actions {
        width: 100%;
        justify-content: stretch;
    }

    .banner-btn {
        flex: 1;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-body {
        padding: 16px;
        max-height: calc(90vh - 160px);
    }

    .code-block {
        flex-direction: column;
        align-items: stretch;
    }

    .code-block button {
        width: 100%;
    }
}

/* ============================================================================
   Animation Keyframes
   ============================================================================ */

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes fadeInOpacity {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}











