/* Voice AI Widget Styles */
.domkrat-voice-popup {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 360px;
    height: 60vh;
    max-height: 700px;
    background: #1e1e2e;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(255, 71, 87, 0.2);
    border: 1px solid #313244;
    padding: 30px 20px;
    color: #cdd6f4;
    font-family: 'Inter', sans-serif;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.domkrat-voice-popup.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .domkrat-voice-popup {
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        height: 85vh !important;
        max-height: 90vh !important;
    }
}

.dv-header {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f38ba8;
    text-shadow: 0 0 10px rgba(243, 139, 168, 0.3);
}

.dv-visualizer {
    width: 100%;
    flex-grow: 1;
    min-height: 200px;
    background: transparent;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    overflow: visible;
}

.auto-scene {
    position: relative;
    width: 240px;
    height: 240px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.scene-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,71,87,0.4) 0%, rgba(255,71,87,0) 70%);
    transition: all 0.5s ease;
    z-index: 0;
    filter: blur(20px);
    animation: breathe-glow 4s ease-in-out infinite alternate;
}

.neon-ring-outer, .neon-ring-middle, .neon-ring-inner, .neon-core {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.neon-ring-outer {
    filter: drop-shadow(0 0 12px rgba(255, 71, 87, 0.8)) drop-shadow(0 0 24px rgba(255, 71, 87, 0.4));
    animation: spin 12s linear infinite;
}

.neon-ring-middle {
    filter: drop-shadow(0 0 15px rgba(137, 180, 250, 0.9)) drop-shadow(0 0 30px rgba(137, 180, 250, 0.5));
    animation: spin 8s linear infinite reverse;
}

.neon-ring-inner {
    filter: drop-shadow(0 0 10px rgba(166, 227, 161, 0.8));
    animation: spin 5s linear infinite;
}

.neon-core {
    width: 45%;
    height: 45%;
    filter: drop-shadow(0 0 25px rgba(255, 71, 87, 1));
    animation: pulse-core 3s ease-in-out infinite alternate;
    z-index: 2;
}

.audio-waves {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s;
}

.audio-waves .wave {
    width: 8px;
    height: 12px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 15px #ffffff, 0 0 30px #ffffff;
    transform-origin: center;
}

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

@keyframes breathe-glow {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.1); opacity: 1; }
}

@keyframes pulse-core {
    0% { transform: scale(0.85); opacity: 0.8; filter: drop-shadow(0 0 20px currentColor); }
    100% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 40px currentColor); }
}

@keyframes sound-wave {
    0% { height: 12px; transform: scaleY(1); }
    100% { height: 60px; transform: scaleY(1.2); }
}

/* 1. Listening State */
.dv-visualizer.listening .scene-glow {
    background: radial-gradient(circle, rgba(137,180,250,0.5) 0%, rgba(137,180,250,0) 70%);
}
.dv-visualizer.listening .neon-ring-outer {
    filter: drop-shadow(0 0 15px rgba(137, 180, 250, 0.9)) drop-shadow(0 0 30px rgba(137, 180, 250, 0.5));
    animation: spin 6s linear infinite;
}
.dv-visualizer.listening .neon-ring-outer circle { stroke: #89b4fa; stroke-width: 5; }
.dv-visualizer.listening .neon-ring-middle {
    filter: drop-shadow(0 0 20px rgba(166, 227, 161, 0.9));
    animation: spin 4s linear infinite reverse;
}
.dv-visualizer.listening .neon-ring-middle circle { stroke: #a6e3a1; stroke-width: 7; }
.dv-visualizer.listening .neon-ring-inner circle { stroke: #94e2d5; stroke-width: 4; }
.dv-visualizer.listening .neon-core circle { fill: #89b4fa; }
.dv-visualizer.listening .neon-core {
    color: #89b4fa;
    animation: pulse-core 1.5s ease-in-out infinite alternate;
}

/* 2. Processing State */
.dv-visualizer.processing .scene-glow {
    background: radial-gradient(circle, rgba(249,226,175,0.6) 0%, rgba(243,139,168,0) 75%);
    animation: breathe-glow 1s ease-in-out infinite alternate;
}
.dv-visualizer.processing .neon-ring-outer {
    filter: drop-shadow(0 0 25px rgba(249, 226, 175, 1));
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}
.dv-visualizer.processing .neon-ring-outer circle { stroke: #f9e2af; stroke-width: 6; }
.dv-visualizer.processing .neon-ring-middle {
    filter: drop-shadow(0 0 25px rgba(243, 139, 168, 1));
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite reverse;
}
.dv-visualizer.processing .neon-ring-middle circle { stroke: #f38ba8; stroke-width: 8; stroke-dasharray: 40 20; }
.dv-visualizer.processing .neon-ring-inner {
    animation: spin 0.8s linear infinite;
}
.dv-visualizer.processing .neon-ring-inner circle { stroke: #fab387; stroke-width: 5; }
.dv-visualizer.processing .neon-core {
    color: #f9e2af;
    transform: scale(0.6);
    animation: pulse-core 0.5s ease-in-out infinite alternate;
}
.dv-visualizer.processing .neon-core circle { fill: #f9e2af; }

/* 3. Speaking State */
.dv-visualizer.speaking .scene-glow {
    background: radial-gradient(circle, rgba(255,71,87,0.7) 0%, rgba(255,71,87,0) 80%);
    animation: breathe-glow 0.8s ease-in-out infinite alternate;
}
.dv-visualizer.speaking .neon-ring-outer {
    filter: drop-shadow(0 0 35px rgba(255, 71, 87, 1)) drop-shadow(0 0 60px rgba(255, 71, 87, 0.6));
    animation: spin 8s linear infinite;
}
.dv-visualizer.speaking .neon-ring-outer circle { stroke: #ff4757; stroke-width: 6; stroke-dasharray: 20 10; }
.dv-visualizer.speaking .neon-ring-middle {
    filter: drop-shadow(0 0 25px rgba(243, 139, 168, 0.9));
    animation: spin 5s linear infinite reverse;
    opacity: 0.8;
}
.dv-visualizer.speaking .neon-ring-middle circle { stroke: #f38ba8; stroke-width: 8; }
.dv-visualizer.speaking .neon-ring-inner circle { stroke: #ff4757; stroke-width: 4; }
.dv-visualizer.speaking .neon-core {
    color: #ff4757;
    transform: scale(1.3);
    animation: pulse-core 0.4s ease-in-out infinite alternate;
}
.dv-visualizer.speaking .neon-core circle { fill: #ffffff; }

.dv-visualizer.speaking .audio-waves {
    opacity: 1;
}

.dv-visualizer.speaking .audio-waves .wave {
    background: #ffffff;
    box-shadow: 0 0 15px #ffffff, 0 0 30px #ffffff;
    animation: sound-wave 0.35s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.dv-visualizer.speaking .audio-waves .wave:nth-child(1) { animation-delay: 0.0s; }
.dv-visualizer.speaking .audio-waves .wave:nth-child(2) { animation-delay: 0.1s; }
.dv-visualizer.speaking .audio-waves .wave:nth-child(3) { animation-delay: 0.2s; }
.dv-visualizer.speaking .audio-waves .wave:nth-child(4) { animation-delay: 0.05s; }
.dv-visualizer.speaking .audio-waves .wave:nth-child(5) { animation-delay: 0.25s; }
.dv-visualizer.speaking .audio-waves .wave:nth-child(6) { animation-delay: 0.15s; }
.dv-visualizer.speaking .audio-waves .wave:nth-child(7) { animation-delay: 0.3s; }

.dv-status {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    margin-bottom: 20px;
    text-align: center;
    min-height: 28px;
    letter-spacing: 0.5px;
}

.dv-close-btn {
    background: #f38ba8;
    color: #11111b;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.dv-close-btn:hover {
    background: #eba0ac;
}
