/* Vibe Coding - Liquid Glass Effects */

.vibe-coding-container {
    position: fixed;
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    
    /* 위치 안정성 개선 */
    z-index: 2147483647;
    pointer-events: none; /* 텍스트 입력 방해 방지 */
    box-sizing: border-box;
    
    /* Liquid Glass Base - 더 투명하게 조정 */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) contrast(80%) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    
    /* Glass Shadows & Highlights */
    box-shadow:
        inset 10px 10px 20px rgba(153, 192, 255, 0.1),
        inset 2px 2px 5px rgba(195, 218, 255, 0.2),
        inset -10px -10px 20px rgba(229, 253, 190, 0.1),
        inset -2px -2px 30px rgba(247, 255, 226, 0.2),
        0 8px 32px rgba(255, 107, 107, 0.2);
    
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); /* 더 부드럽고 길게 */
    min-width: 80px; /* Ready용 최소 크기 */
    max-width: 220px; /* 최대 크기 제한 */
    width: auto;
    text-align: left;
    transform-origin: center;
    
    /* 텍스트 길이에 따른 동적 크기 조정 */
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    
    /* 오토레이아웃 및 정렬 개선 */
    height: 36px !important; /* 절대 고정 높이 */
}

/* Hover Effects - 더 투명하게 조정 */
.vibe-coding-container:hover {
    transform: scale(1.05) translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 10px 10px 20px rgba(153, 192, 255, 0.12),
        inset 2px 2px 5px rgba(195, 218, 255, 0.25),
        inset -10px -10px 20px rgba(229, 253, 190, 0.12),
        inset -2px -2px 30px rgba(247, 255, 226, 0.25),
        0 12px 40px rgba(255, 107, 107, 0.25);
}

/* Recording State - 크기 고정으로 수정 */
.vibe-coding-container.recording-active {
    background: rgba(255, 107, 107, 0.06);
    border-color: rgba(255, 107, 107, 0.25);
    animation: recordingPulse 2s ease-in-out infinite;
    /* transform: scale(1.02); 제거 - 크기 고정 */
    height: 36px !important; /* 높이 절대 고정 */
}

@keyframes recordingPulse {
    0%, 100% {
        box-shadow:
            inset 10px 10px 20px rgba(255, 107, 107, 0.1),
            inset 2px 2px 5px rgba(255, 130, 130, 0.2),
            inset -10px -10px 20px rgba(255, 150, 150, 0.1),
            inset -2px -2px 30px rgba(255, 180, 180, 0.2),
            0 8px 32px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow:
            inset 10px 10px 20px rgba(255, 107, 107, 0.2),
            inset 2px 2px 5px rgba(255, 130, 130, 0.4),
            inset -10px -10px 20px rgba(255, 150, 150, 0.2),
            inset -2px -2px 30px rgba(255, 180, 180, 0.4),
            0 12px 40px rgba(255, 107, 107, 0.5);
    }
}

/* Countdown State - 크기 고정으로 수정 */
.vibe-coding-container.countdown-active,
.vibe-coding-container.countdown-active.recording-active,
.vibe-coding-container.recording-active.countdown-active,
.vibe-coding-container[class*="countdown-active"] {
    background: rgba(255, 200, 100, 0.12) !important;
    background-color: rgba(255, 200, 100, 0.12) !important;
    border-color: rgba(255, 200, 100, 0.5) !important;
    animation: countdownPulse 1s ease-in-out infinite !important;
    /* transform: scale(1.08) !important; 제거 - 크기 고정 */
    box-shadow: 0 8px 32px rgba(255, 200, 100, 0.5) !important;
    height: 36px !important; /* 높이 절대 고정 */
}

@keyframes countdownPulse {
    0%, 100% {
        opacity: 1;
        box-shadow:
            inset 10px 10px 20px rgba(255, 200, 100, 0.15),
            inset 2px 2px 5px rgba(255, 220, 120, 0.4),
            inset -10px -10px 20px rgba(255, 240, 140, 0.15),
            inset -2px -2px 30px rgba(255, 250, 160, 0.4),
            0 8px 32px rgba(255, 200, 100, 0.5);
    }
    50% {
        opacity: 0.9; /* 더 부드러운 opacity 변화 */
        box-shadow:
            inset 10px 10px 20px rgba(255, 200, 100, 0.2),
            inset 2px 2px 5px rgba(255, 220, 120, 0.5),
            inset -10px -10px 20px rgba(255, 240, 140, 0.2),
            inset -2px -2px 30px rgba(255, 250, 160, 0.5),
            0 10px 36px rgba(255, 200, 100, 0.6); /* 더 부드러운 shadow 변화 */
    }
}

/* Branding Text */
.vibe-branding {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    white-space: nowrap;
    pointer-events: auto; /* 클릭 가능 */
}

/* Microphone Button */
.her-voice-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 107, 107, 0.2);
    color: rgba(255, 107, 107, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    
    /* Button Glass Effect */
    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.2),
        inset -2px -2px 4px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(255, 107, 107, 0.3);
}

.her-voice-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.1);
    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.3),
        inset -2px -2px 4px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(255, 107, 107, 0.4);
}

/* Status Text */
.status-text {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* 더 부드러운 transition */
    white-space: nowrap;
    flex-grow: 0;
    flex-shrink: 0;
    transform-origin: left center;
    
    /* 동적 크기 조정 개선 */
    width: fit-content; /* 텍스트 크기에 맞춤 */
    min-width: 35px;
    max-width: 120px; /* 더 작은 최대값 */
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0; /* 패딩 제거로 여백 최소화 */
    pointer-events: auto; /* 클릭 가능 */
    
    /* 중앙 정렬 */
    display: flex;
    align-items: center;
    height: 100%;
}

/* Status Text States */
.vibe-coding-container.recording-active .status-text {
    color: rgba(255, 107, 107, 0.9);
    font-weight: 600;
    /* transform: scale(1.05); 제거 - 글자 크기 변화 방지 */
}

.vibe-coding-container.countdown-active .status-text,
.vibe-coding-container.countdown-active.recording-active .status-text,
.vibe-coding-container.recording-active.countdown-active .status-text,
.vibe-coding-container[class*="countdown-active"] .status-text {
    color: rgba(255, 200, 100, 1) !important;
    font-weight: 700 !important;
    /* transform: scale(1.1); 제거 - 글자 크기 변화 방지 */
    animation: statusTextPulse 1.5s ease-in-out infinite !important; /* 더 느린 애니메이션 */
}

@keyframes statusTextPulse {
    0%, 100% { 
        opacity: 1; 
        /* transform: scale(1.1); 제거 - 글자 크기 변화 방지 */
    }
    50% { 
        opacity: 0.85; /* 더 부드러운 opacity 변화 */
        /* transform: scale(1.15); 제거 - 글자 크기 변화 방지 */
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .vibe-coding-container {
        min-width: 120px;
        padding: 6px 10px;
        gap: 6px;
    }
    
    .vibe-branding {
        font-size: 9px;
    }
    
    .her-voice-btn {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .status-text {
        font-size: 8px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .vibe-coding-container {
        backdrop-filter: blur(25px) contrast(85%) saturate(125%);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .vibe-coding-container {
        background: rgba(0, 0, 0, 0.15);
        border-color: rgba(255, 255, 255, 0.25);
    }
    
    .vibe-branding {
        color: rgba(255, 255, 255, 0.95);
    }
    
    .status-text {
        color: rgba(255, 255, 255, 0.8);
    }
}

/* Animation Performance Optimization */
.vibe-coding-container {
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .vibe-coding-container {
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
    
    .vibe-coding-container.recording-active {
        background: rgba(255, 107, 107, 0.9);
    }
    
    .vibe-coding-container.countdown-active {
        background: rgba(255, 200, 100, 0.9);
    }
}