/* ==========================================
   Talk Back Aksesibilitas - Styles
   ========================================== */

/* Floating Action Button */
#talkback-fab {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 99998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4), 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* WhatsApp FAB */
#wa-fab {
    position: fixed;
    bottom: 30px;
    left: 96px; /* Next to Talkback FAB (30px offset + 56px width + 10px gap) */
    z-index: 99998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4), 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

#wa-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5), 0 4px 10px rgba(0,0,0,0.2);
}

#wa-fab:active {
    transform: scale(0.95);
}

#wa-fab.talkback-fab-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
}

#talkback-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5), 0 4px 10px rgba(0,0,0,0.2);
}

#talkback-fab:active {
    transform: scale(0.95);
}

#talkback-fab.talkback-fab-active {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4), 0 2px 6px rgba(0,0,0,0.15);
}

#talkback-fab.talkback-fab-active:hover {
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.5), 0 4px 10px rgba(0,0,0,0.2);
}

#talkback-fab.talkback-fab-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
}

/* Overlay */
#talkback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#talkback-overlay.talkback-overlay-open {
    opacity: 1;
    visibility: visible;
}

/* Modal */
#talkback-modal {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 99999;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 8px 20px rgba(0,0,0,0.1);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

#talkback-modal.talkback-modal-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Modal Header */
.talkback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
}

.talkback-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.talkback-modal-title svg {
    flex-shrink: 0;
}

#talkback-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1;
}

#talkback-close:hover {
    background: #f1f5f9;
    color: #475569;
}

/* Modal Body */
.talkback-modal-body {
    padding: 20px;
}

.talkback-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 18px 0;
}

/* Action Buttons */
.talkback-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.talkback-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    color: #fff;
}

.talkback-btn svg {
    flex-shrink: 0;
}

.talkback-btn-activate {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.talkback-btn-activate:hover {
    background: linear-gradient(135deg, #15803d, #166534);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
    transform: translateY(-1px);
}

.talkback-btn-deactivate {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.talkback-btn-deactivate:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    transform: translateY(-1px);
}

.talkback-btn-test {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    padding: 10px 16px;
    font-size: 13px;
}

.talkback-btn-test:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

/* Settings */
.talkback-settings {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.talkback-speed-control {
    margin-bottom: 12px;
}

.talkback-speed-control label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: 8px;
}

.talkback-speed-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.talkback-speed-label {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

#talkback-speed {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e2e8f0, #cbd5e1);
    outline: none;
    cursor: pointer;
}

#talkback-speed::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
    transition: transform 0.2s ease;
}

#talkback-speed::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#talkback-speed::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
    border: none;
}

.talkback-speed-value {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
    margin-top: 6px;
}

/* Status */
.talkback-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.talkback-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.talkback-status-active {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
    animation: talkback-dot-pulse 1.5s infinite;
}

.talkback-status-inactive {
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

@keyframes talkback-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#talkback-status-text {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

/* Highlight on hover - when talkback is active */
.talkback-highlight {
    outline: 2px solid rgba(37, 99, 235, 0.6) !important;
    outline-offset: 2px !important;
    background-color: rgba(37, 99, 235, 0.06) !important;
    border-radius: 4px;
    transition: outline 0.15s ease, background-color 0.15s ease !important;
}

/* Responsive */
@media (max-width: 480px) {
    #talkback-fab {
        bottom: 20px;
        left: 20px;
        width: 48px;
        height: 48px;
    }

    #talkback-fab svg {
        width: 22px;
        height: 22px;
    }

    #wa-fab {
        bottom: 20px;
        left: 78px; /* 20px offset + 48px width + 10px gap */
        width: 48px;
        height: 48px;
    }

    #wa-fab svg {
        width: 22px;
        height: 22px;
    }

    #talkback-modal {
        bottom: 20px;
        left: 20px;
        right: 20px;
        width: auto;
    }

    .talkback-modal-body {
        padding: 16px;
    }

    .talkback-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}
