/* Menu Speech Toggle Button */
.speech-toggle-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.speech-toggle-btn:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    transform: translateY(-2px);
}

.speech-toggle-btn:active {
    transform: translateY(0);
}

.speech-toggle-btn i {
    font-size: 20px;
}

.speech-toggle-btn.btn-success {
    background-color: #28a745;
    color: white;
}

.speech-toggle-btn.btn-success:hover {
    background-color: #218838;
}

.speech-toggle-btn.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.speech-toggle-btn.btn-secondary:hover {
    background-color: #5a6268;
}

/* Animasi pulse untuk button saat aktif */
.speech-toggle-btn.btn-success {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    }
    50% {
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.5), 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    }
}

/* Responsiveness */
@media (max-width: 768px) {
    .speech-toggle-btn {
        bottom: 70px;
        right: 15px;
        width: 45px;
        height: 45px;
    }

    .speech-toggle-btn i {
        font-size: 18px;
    }
}

/* Welcome Popup Modal */
#speech-welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
}

#speech-welcome-modal .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
    position: relative;
    width: auto;
    pointer-events: none;
}

#speech-welcome-modal.show .modal-dialog {
    transform: none;
}

#speech-welcome-modal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
}

#speech-welcome-modal .modal-header {
    border: none;
    padding: 20px 25px;
}

#speech-welcome-modal .modal-title {
    font-weight: 600;
    font-size: 18px;
}

#speech-welcome-modal .modal-body {
    border: none;
    position: relative;
    flex: 1 1 auto;
}

#speech-welcome-modal .btn-lg {
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 25px;
}

#speech-welcome-modal .btn-secondary {
    padding: 10px 25px;
    border-radius: 25px;
}

/* Modal backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Modal animation */
#speech-welcome-modal.show {
    display: block !important;
}

#speech-welcome-modal.show .modal-dialog {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive modal */
@media (max-width: 576px) {
    #speech-welcome-modal .modal-dialog {
        margin: 10px;
    }

    #speech-welcome-modal .modal-body {
        padding: 20px !important;
    }

    #speech-welcome-modal .btn-lg {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0 !important;
    }

    #speech-welcome-modal .btn-secondary {
        width: 100%;
    }
}
