/* Interactive Sid Avatar Styles */

.sid-interactive {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Avatar Container */
.sid-avatar-container {
    width: 200px;
    height: 200px;
    position: relative;
}

.sid-avatar {
    width: 100%;
    height: 100%;
}

/* Particles animation */
.particle {
    opacity: 0.6;
    animation: float 4s ease-in-out infinite;
}

.particle.p1 { animation-delay: 0s; }
.particle.p2 { animation-delay: 0.5s; }
.particle.p3 { animation-delay: 1s; }
.particle.p4 { animation-delay: 1.5s; }
.particle.p5 { animation-delay: 2s; }

@keyframes float {
    0%, 100% { 
        transform: translateY(0) translateX(0); 
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-10px) translateX(5px); 
        opacity: 1;
    }
}

/* Core breathing animation - stays perfectly centered */
.core {
    animation: breathe 3s ease-in-out infinite;
}

.core-pulse {
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { 
        filter: url(#glow) brightness(1);
    }
    50% { 
        filter: url(#glow) brightness(1.15);
    }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 0.2;
    }
    50% { 
        opacity: 0.5;
    }
}

/* Brackets idle animation */
.bracket {
    transition: all 0.3s ease;
}

.bracket-left {
    animation: bracketPulseLeft 4s ease-in-out infinite;
}

.bracket-right {
    animation: bracketPulseRight 4s ease-in-out infinite;
    animation-delay: 0.5s;
}

@keyframes bracketPulseLeft {
    0%, 100% { 
        stroke-opacity: 0.8;
        transform: translateX(0);
    }
    50% { 
        stroke-opacity: 1;
        transform: translateX(-3px);
    }
}

@keyframes bracketPulseRight {
    0%, 100% { 
        stroke-opacity: 0.8;
        transform: translateX(0);
    }
    50% { 
        stroke-opacity: 1;
        transform: translateX(3px);
    }
}

/* Speech rings - hidden by default */
.speech-rings {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.ring {
    transform-origin: center;
    opacity: 0;
}

/* Speaking state */
.sid-avatar.speaking .speech-rings {
    opacity: 1;
}

.sid-avatar.speaking .ring {
    animation: ringPulse 1.5s ease-out infinite;
}

.sid-avatar.speaking .ring1 { animation-delay: 0s; }
.sid-avatar.speaking .ring2 { animation-delay: 0.3s; }
.sid-avatar.speaking .ring3 { animation-delay: 0.6s; }

@keyframes ringPulse {
    0% { 
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1.2);
        opacity: 0;
    }
}

.sid-avatar.speaking .core {
    animation: speakingCore 1.2s ease-in-out infinite;
    transform-origin: 100px 100px; /* Center of SVG viewBox */
    transform-box: fill-box;
}

@keyframes speakingCore {
    0%, 100% { 
        opacity: 1;
        filter: url(#glow) brightness(1);
    }
    50% { 
        opacity: 0.85;
        filter: url(#glow) brightness(1.3);
    }
}

.sid-avatar.speaking .bracket-left {
    animation: speakingBracketLeft 1.2s ease-in-out infinite alternate;
}

.sid-avatar.speaking .bracket-right {
    animation: speakingBracketRight 1.2s ease-in-out infinite alternate;
}

@keyframes speakingBracketLeft {
    0% { transform: translateX(0); stroke-opacity: 0.9; }
    100% { transform: translateX(-3px); stroke-opacity: 1; }
}

@keyframes speakingBracketRight {
    0% { transform: translateX(0); stroke-opacity: 0.9; }
    100% { transform: translateX(3px); stroke-opacity: 1; }
}

/* Speech Bubble */
.sid-speech {
    width: 100%;
    max-width: 600px;
}

.speech-bubble {
    background: rgba(26, 26, 36, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid rgba(26, 26, 36, 0.9);
}

.speech-text {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #e0e0e8;
    text-align: center;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

.speech-cursor {
    color: #00d4ff;
    animation: blink 0.8s infinite;
    margin-left: 2px;
}

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

/* Controls */
.sid-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.sid-play-btn,
.sid-restart-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    flex-shrink: 0;
}

.sid-play-btn:hover,
.sid-restart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.4);
}

.sid-play-btn svg,
.sid-restart-btn svg {
    width: 24px;
    height: 24px;
}

.sid-play-btn .play-icon {
    margin-left: 3px;
}

.sid-restart-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.sid-restart-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.sid-restart-btn svg {
    width: 20px;
    height: 20px;
}

/* Progress bar */
.sid-progress {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.sid-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #7c3aed);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .sid-interactive {
        padding: 1rem;
    }
    
    .sid-avatar-container {
        width: 150px;
        height: 150px;
    }
    
    .speech-text {
        font-size: 1rem;
    }
    
    .speech-bubble {
        padding: 1rem 1.5rem;
        min-height: 80px;
    }
}

