/* =============================================================================
   Floating Voice Search & Fullscreen Blur Overlay
   GKJW Inventaris Scanner
   ============================================================================= */


/* Fullscreen Blur Overlay */
.voice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.voice-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Blur Backdrop */
.voice-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
}

/* Main Content in Overlay */
.voice-overlay-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
    max-width: 600px;
    width: 92%;
    animation: overlayContentIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes overlayContentIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.voice-overlay-close {
    position: absolute;
    top: -60px;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.voice-overlay-close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: rotate(90deg) scale(1.08);
}

/* Microphone Ripple Container */
.voice-mic-container {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.voice-mic-core {
    position: relative;
    z-index: 3;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.65);
    transition: transform 0.2s ease, background 0.3s ease;
}

.voice-mic-core.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.7);
}

/* Animated Ripple Rings */
.voice-ripple-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(239, 68, 68, 0.6);
    pointer-events: none;
    animation: rippleWave 2.4s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

.voice-ripple-ring.ring-1 {
    animation-delay: 0s;
}

.voice-ripple-ring.ring-2 {
    animation-delay: 0.8s;
}

.voice-ripple-ring.ring-3 {
    animation-delay: 1.6s;
}

@keyframes rippleWave {
    0% {
        transform: scale(0.7);
        opacity: 0.9;
    }
    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

/* Equalizer Bars */
.voice-equalizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    margin-bottom: 16px;
}

.voice-equalizer .bar {
    width: 5px;
    height: 10px;
    border-radius: 10px;
    background: #60a5fa;
    animation: barBounce 1.2s infinite ease-in-out;
}

.voice-equalizer .bar-1 { animation-delay: 0.1s; }
.voice-equalizer .bar-2 { animation-delay: 0.3s; }
.voice-equalizer .bar-3 { animation-delay: 0.5s; }
.voice-equalizer .bar-4 { animation-delay: 0.2s; }
.voice-equalizer .bar-5 { animation-delay: 0.4s; }

@keyframes barBounce {
    0%, 100% {
        height: 8px;
        background: #60a5fa;
    }
    50% {
        height: 28px;
        background: #ef4444;
    }
}

/* Title / Status */
.voice-status-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 15px;
    letter-spacing: -0.01em;
}

/* Live Typewriter Transcript Wrapper */
.voice-transcript-wrapper {
    width: 100%;
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 16px 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    margin-bottom: 14px;
}

.voice-transcript-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
    word-break: break-word;
}

.voice-transcript-text .placeholder-dots {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    font-size: 1.1rem;
    font-style: italic;
}

/* Typing Cursor */
.voice-cursor {
    color: #60a5fa;
    font-size: 1.6rem;
    font-weight: 700;
    margin-left: 4px;
    animation: blinkCursor 0.8s infinite;
}

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

/* Hints */
.voice-hint-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
}

/* Action Controls */
.voice-overlay-actions {
    display: flex;
    gap: 12px;
}

.voice-cancel-btn {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    transition: all 0.25s ease;
}

.voice-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: scale(1.05);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .voice-fab-container {
        bottom: calc(75px + 5vh); /* Geser ke atas ~5% pada mobile */
        right: 18px;
    }
    
    .voice-fab-btn {
        width: 65px;  /* Diperbesar ~25% (dari 52px) */
        height: 65px; /* Diperbesar ~25% (dari 52px) */
        font-size: 25px;
    }

    .voice-overlay-content {
        padding: 20px 15px;
    }

    .voice-mic-container {
        width: 90px;
        height: 90px;
        margin-bottom: 18px;
    }

    .voice-mic-core {
        width: 66px;
        height: 66px;
        font-size: 26px;
    }

    .voice-transcript-text {
        font-size: 1.25rem;
    }

    .voice-transcript-wrapper {
        padding: 14px 18px;
        min-height: 75px;
    }

    .voice-overlay-close {
        top: -50px;
    }
}
