/* Voice Bubble Styles */
.voice-bubble-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px 0;
    position: relative;
}

.voice-bubble {
    width: 250px; /* Increased from 200px */
    height: 250px; /* Increased from 200px */
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15); /* Slightly more visible */
    backdrop-filter: blur(15px); /* Increased blur effect */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.2);
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
    will-change: transform;
    margin-bottom: 30px; /* Increased from 20px */
    border: 2px solid var(--accent-color); /* Added border */
}

.voice-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.2);
}

.voice-bubble.pulse {
    animation: pulse 1s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.smoke-container {
    width: 50%;
    height: 80%;
    overflow: hidden;
    border-radius: 50%;
    z-index: 1;
}

.smoke-particle {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    pointer-events: none;
    animation: float var(--smoke-duration, 2.5s) ease-out forwards;
    filter: hue-rotate(calc(var(--hue, 0) * 1deg));
    backdrop-filter: blur(2px);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.8), transparent);
}

@keyframes float {
    0% {
        transform: translateY(0) scale(0.5) rotate(0deg);
        opacity: 0.2;
    }
    50% {
        opacity: 0.5;
        transform: translateY(-75px) scale(1.25) rotate(180deg);
    }
    100% {
        transform: translateY(-150px) scale(2) rotate(360deg);
        opacity: 0;
    }
}

.additional-smoke {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    border-radius: 50%;
    z-index: 1;
}

.smoke-layer {
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: smoke-rotate 20s infinite linear;
    opacity: 0.3;
}

.smoke-layer:nth-child(1) { animation-duration: 25s; }
.smoke-layer:nth-child(2) { animation-duration: 30s; animation-delay: -5s; }
.smoke-layer:nth-child(3) { animation-duration: 35s; animation-delay: -10s; }
.smoke-layer:nth-child(4) { animation-duration: 40s; animation-delay: -15s; }
.smoke-layer:nth-child(5) { animation-duration: 45s; animation-delay: -20s; }

@keyframes smoke-rotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.bubble-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    padding: 20px;
}

/* Voice Select Dropdown */
.voice-select-container {
    width: 80%;
    max-width: 300px;
    margin: 20px auto;
}

.voice-select {
    width: 100%;
    padding: 10px 15px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.voice-select:hover, .voice-select:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(0, 0, 0, 0.3);
}

.voice-select optgroup {
    background-color: rgba(0, 0, 0, 0.8);
}

.voice-select option {
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
}
.voice-bubble-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    max-width: 500px;
}

.voice-bubble {
    width: 142px;
    height: 142px;
    background: linear-gradient(145deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(37, 117, 252, 0.5);
    transition: all 0.3s ease;
    /* Removed the always-on animation */
}

.voice-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(106, 17, 203, 0.7);
    filter: hue-rotate(30deg);
}

.voice-bubble.speaking {
    animation: blob-speak 1.5s ease-in-out infinite;
    background: linear-gradient(145deg, #ff4e50 0%, #f9d423 100%);
    box-shadow: 0 0 25px rgba(249, 212, 35, 0.7);
}

@keyframes blob-morph {
    0% {
        border-radius: 60% 40% 70% 30% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 40% 70% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 40% 60% 50% / 40% 50% 60% 50%;
    }
    75% {
        border-radius: 40% 60% 30% 70% / 60% 40% 70% 30%;
    }
    100% {
        border-radius: 60% 40% 70% 30% / 60% 30% 70% 40%;
    }
}

@keyframes blob-speak {
    0% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: scale(1);
    }
    5% {
        border-radius: 60% 40% 50% 50% / 50% 50% 50% 50%;
    }
    10% {
        border-radius: 65% 35% 50% 50% / 50% 50% 50% 50%;
    }
    15% {
        border-radius: 60% 40% 50% 50% / 50% 50% 50% 50%;
    }
    20% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: scale(1.01);
    }
    25% {
        border-radius: 50% 50% 60% 40% / 50% 50% 50% 50%;
    }
    30% {
        border-radius: 50% 50% 65% 35% / 50% 50% 50% 50%;
    }
    35% {
        border-radius: 50% 50% 60% 40% / 50% 50% 50% 50%;
    }
    40% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: scale(1.02);
    }
    45% {
        border-radius: 50% 50% 50% 50% / 60% 40% 50% 50%;
    }
    50% {
        border-radius: 50% 50% 50% 50% / 65% 35% 50% 50%;
    }
    55% {
        border-radius: 50% 50% 50% 50% / 60% 40% 50% 50%;
    }
    60% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: scale(1.01);
    }
    65% {
        border-radius: 50% 50% 50% 50% / 50% 50% 60% 40%;
    }
    70% {
        border-radius: 50% 50% 50% 50% / 50% 50% 65% 35%;
    }
    75% {
        border-radius: 50% 50% 50% 50% / 50% 50% 60% 40%;
    }
    80% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: scale(1.02);
    }
    85% {
        border-radius: 40% 60% 50% 50% / 50% 50% 50% 50%;
    }
    90% {
        border-radius: 35% 65% 50% 50% / 50% 50% 50% 50%;
    }
    95% {
        border-radius: 40% 60% 50% 50% / 50% 50% 50% 50%;
    }
    100% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: scale(1);
    }
}

.smoke-container {
    width: 50%;
    height: 80%;
    border-radius: 50%;
    overflow: hidden; /* This ensures content stays within the container */
    z-index: 1;
    clip-path: circle(50%); /* Additional clipping to ensure smoke stays within circle */
}

.smoke-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.3), transparent);
    opacity: 0;
    pointer-events: none;
}

.smoke-particle-1 {
    width: 20px;
    height: 20px;
    animation: smoke-rise-1 4s ease-in-out infinite;
}

.smoke-particle-2 {
    width: 30px;
    height: 30px;
    animation: smoke-rise-2 5s ease-in-out infinite;
}

.smoke-particle-3 {
    width: 25px;
    height: 25px;
    animation: smoke-rise-3 3.5s ease-in-out infinite;
}

.smoke-particle-4 {
    width: 35px;
    height: 35px;
    animation: smoke-rise-4 4.5s ease-in-out infinite;
}

.smoke-particle-5 {
    width: 15px;
    height: 15px;
    animation: smoke-rise-5 3s ease-in-out infinite;
}

@keyframes smoke-rise-1 {
    0% {
        bottom: -20px;
        left: 45%;
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 0.8;
        transform: scale(1) rotate(45deg);
    }
    60% {
        opacity: 0.6;
        transform: scale(1.2) rotate(90deg);
    }
    100% {
        bottom: 120px; /* Reduced height to keep within container */
        left: 40%;
        opacity: 0;
        transform: scale(1.5) rotate(180deg); /* Reduced scale to keep within container */
    }
}

@keyframes smoke-rise-2 {
    0% {
        bottom: -30px;
        left: 50%;
        opacity: 0;
        transform: scale(0.3) rotate(0deg);
    }
    15% {
        opacity: 0.7;
        transform: scale(0.8) rotate(30deg);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1) rotate(120deg);
    }
    100% {
        bottom: 110px; /* Reduced height to keep within container */
        left: 55%;
        opacity: 0;
        transform: scale(1.4) rotate(240deg); /* Reduced scale to keep within container */
    }
}

@keyframes smoke-rise-3 {
    0% {
        bottom: -25px;
        left: 40%;
        opacity: 0;
        transform: scale(0.4) rotate(0deg);
    }
    25% {
        opacity: 0.9;
        transform: scale(1) rotate(60deg);
    }
    70% {
        opacity: 0.4;
        transform: scale(1.2) rotate(150deg);
    }
    100% {
        bottom: 100px; /* Reduced height to keep within container */
        left: 35%;
        opacity: 0;
        transform: scale(1.3) rotate(300deg); /* Reduced scale to keep within container */
    }
}

@keyframes smoke-rise-4 {
    0% {
        bottom: -35px;
        left: 55%;
        opacity: 0;
        transform: scale(0.2) rotate(0deg);
    }
    10% {
        opacity: 0.6;
        transform: scale(0.7) rotate(20deg);
    }
    45% {
        opacity: 0.8;
        transform: scale(1) rotate(80deg);
    }
    100% {
        bottom: 105px; /* Reduced height to keep within container */
        left: 60%;
        opacity: 0;
        transform: scale(1.2) rotate(200deg); /* Reduced scale to keep within container */
    }
}

@keyframes smoke-rise-5 {
    0% {
        bottom: -15px;
        left: 48%;
        opacity: 0;
        transform: scale(0.6) rotate(0deg);
    }
    30% {
        opacity: 1;
        transform: scale(1) rotate(90deg);
    }
    80% {
        opacity: 0.3;
        transform: scale(1.1) rotate(180deg);
    }
    100% {
        bottom: 95px; /* Reduced height to keep within container */
        left: 40%;
        opacity: 0;
        transform: scale(1.2) rotate(270deg); /* Reduced scale to keep within container */
    }
}

.bubble-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 3;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: inherit;
    overflow: hidden;
    text-align: center;
    font-size: 14px;
}

.voice-bubble.speaking {
    animation: blob-speak 0.8s ease-in-out infinite alternate;
    background: linear-gradient(135deg, #ff3366 0%, #ba00ff 50%, #4169e1 100%);
}

@keyframes blob-speak {
    0% {
        transform: scaleY(1) scaleX(1);
        border-radius: 50%;
    }
    20% {
        transform: scaleY(1.03) scaleX(0.98);
        border-radius: 48% 52% 48% 52%;
    }
    40% {
        transform: scaleY(0.97) scaleX(1.02);
        border-radius: 52% 48% 52% 48%;
    }
    60% {
        transform: scaleY(1.02) scaleX(0.97);
        border-radius: 48% 52% 48% 52%;
    }
    80% {
        transform: scaleY(0.98) scaleX(1.03);
        border-radius: 52% 48% 52% 48%;
    }
    100% {
        transform: scaleY(1) scaleX(1);
        border-radius: 50%;
    }
}

.voice-select-container {
    margin-top: 20px;
    width: 100%;
    max-width: 300px;
    text-align: center;
}

.voice-select {
    width: 20%;
    padding: 10px 15px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    /* background-image: url('data:image/svg+xml;utf8,<svg fill="%2329b6f6" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    margin-bottom: 14px;
}

.voice-select:hover, .voice-select:focus {
    border-color: #0288d1;
    box-shadow: 0 0 10px rgba(41, 182, 246, 0.5);
}

.voice-select option {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.additional-smoke {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.smoke-layer {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2), transparent);
    animation: smoke-float 6s ease-in-out infinite;
}

.smoke-layer:nth-child(1) { animation-delay: 0s; left: 30%; }
.smoke-layer:nth-child(2) { animation-delay: 1s; left: 50%; }
.smoke-layer:nth-child(3) { animation-delay: 2s; left: 70%; }
.smoke-layer:nth-child(4) { animation-delay: 3s; left: 40%; }
.smoke-layer:nth-child(5) { animation-delay: 4s; left: 60%; }

@keyframes smoke-float {
    0%, 100% {
        bottom: 20%;
        opacity: 0;
        transform: scale(0.8) rotate(0deg);
    }
    50% {
        bottom: 60%; /* Reduced height to keep within container */
        opacity: 0.7;
        transform: scale(1.1) rotate(180deg); /* Reduced scale to keep within container */
    }
}