/**
 * VoiceX - Text Reader Component Stylesheet
 * Theme: Pengadilan Negeri Red (pn-red)
 * Package: PN-RED Suite
 */

/* 1. Highlight Teks yang Sedang Dibaca */
.c-voicex-reading {
    background-color: rgba(154, 33, 9, 0.12) !important;
    outline: 2px solid rgba(154, 33, 9, 0.38) !important;
    outline-offset: 3px !important;
    border-radius: 4px !important;
    box-shadow: 0 0 12px rgba(154, 33, 9, 0.12) !important;
    transition: background-color 0.2s ease, outline-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* 2. Floating Player Controls */
.c-voicex-controls {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000003;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #9a2109;
    padding: 10px 16px;
    border-radius: 50px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 13px;
    color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.95);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
    pointer-events: none;
    user-select: none;
}

.c-voicex-controls.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Sound Wave / Speaker Indicator */
.c-voicex-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #9a2109;
    color: #ffffff;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(154, 33, 9, 0.35);
}

.c-voicex-indicator svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.c-voicex-indicator.is-playing {
    animation: cvoicexPulse 1.4s ease-in-out infinite;
}

@keyframes cvoicexPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(154, 33, 9, 0.5);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 0 6px rgba(154, 33, 9, 0);
    }
}

/* Status Text Info */
.c-voicex-info {
    display: flex;
    flex-direction: column;
    min-width: 80px;
    line-height: 1.25;
}

.c-voicex-title {
    font-weight: 700;
    font-size: 12px;
    color: #9a2109;
    letter-spacing: 0.3px;
    text-transform: none;
}

.c-voicex-status {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

/* Action Buttons Container */
.c-voicex-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.c-voicex-controls .c-voicex-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease !important;
    line-height: 1 !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.c-voicex-controls .c-voicex-btn:active {
    transform: scale(0.96);
}

.c-voicex-controls .c-voicex-btn span {
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}

.c-voicex-controls .c-voicex-btn svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0 !important;
}

/* Tombol Jeda (Pause / Lanjutkan) - Teks Gelap Kontras Jelas */
.c-voicex-controls .c-voicex-btn-pause {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

.c-voicex-controls .c-voicex-btn-pause span {
    color: #0f172a !important;
}

.c-voicex-controls .c-voicex-btn-pause svg {
    fill: #0f172a !important;
    color: #0f172a !important;
}

.c-voicex-controls .c-voicex-btn-pause:hover {
    background: #e2e8f0 !important;
    color: #000000 !important;
    border-color: #94a3b8 !important;
}

.c-voicex-controls .c-voicex-btn-pause:hover span {
    color: #000000 !important;
}

.c-voicex-controls .c-voicex-btn-pause:hover svg {
    fill: #000000 !important;
}

/* Tombol Berhenti (Stop) - Teks Merah Gelap Kontras Jelas */
.c-voicex-controls .c-voicex-btn-stop {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
}

.c-voicex-controls .c-voicex-btn-stop span {
    color: #991b1b !important;
}

.c-voicex-controls .c-voicex-btn-stop svg {
    fill: #991b1b !important;
    color: #991b1b !important;
}

.c-voicex-controls .c-voicex-btn-stop:hover {
    background: #fecaca !important;
    color: #7f1d1d !important;
    border-color: #f87171 !important;
}

.c-voicex-controls .c-voicex-btn-stop:hover span {
    color: #7f1d1d !important;
}

.c-voicex-controls .c-voicex-btn-stop:hover svg {
    fill: #7f1d1d !important;
}

/* Responsive adjustment for Controls */
@media (max-width: 999px) {
    .c-voicex-controls {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        right: 20px;
        z-index: 10000003;
    }
}

@media (max-width: 640px) {
    .c-voicex-controls {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        right: 14px;
        left: 14px;
        justify-content: space-between;
        border-radius: 16px;
        padding: 8px 12px;
        z-index: 10000003;
    }
}

/* ==========================================================================
   3. Welcome Audio Interaction Prompt (Dialog Persetujuan Audio Browser)
   ========================================================================== */
.c-voicex-welcome-prompt {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000003;
    max-width: 380px;
    width: calc(100% - 48px);
    background: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #fdfbfb 100%);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #9a2109;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.18), 0 6px 15px -3px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
    user-select: none;
}

.c-voicex-welcome-prompt.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.c-voicex-wp-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    position: relative;
}

.c-voicex-wp-icon {
    width: 36px;
    height: 36px;
    background: #9a2109;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(154, 33, 9, 0.35);
    animation: cvoicexPulse 2s ease-in-out infinite;
}

.c-voicex-wp-icon svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
}

.c-voicex-wp-title-wrap {
    flex: 1;
    padding-right: 20px;
}

.c-voicex-wp-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #9a2109;
    background: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.c-voicex-wp-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.c-voicex-wp-close {
    position: absolute;
    top: -4px;
    right: -4px;
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.c-voicex-wp-close:hover {
    color: #0f172a;
}

.c-voicex-wp-body {
    margin-bottom: 14px;
}

.c-voicex-wp-desc {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: #475569;
}

.c-voicex-wp-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.c-voicex-wp-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #9a2109;
    color: #ffffff !important;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(154, 33, 9, 0.3);
    transition: background 0.15s, transform 0.1s;
}

.c-voicex-wp-btn-primary:hover {
    background: #7f1d1d;
    transform: translateY(-1px);
}

.c-voicex-wp-btn-primary:active {
    transform: scale(0.97);
}

.c-voicex-wp-btn-primary svg {
    width: 14px;
    height: 14px;
    fill: #ffffff;
}

.c-voicex-wp-btn-dismiss {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    color: #64748b !important;
    border: 1px solid #e2e8f0;
    outline: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.c-voicex-wp-btn-dismiss:hover {
    background: #e2e8f0;
    color: #1e293b !important;
}

/* Responsive adjustments when Mobile Bottom Nav is active (<= 999px) */
@media (max-width: 999px) {
    .c-voicex-welcome-prompt {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        right: 20px;
        max-width: 380px;
        z-index: 10000003;
    }
}

@media (max-width: 640px) {
    .c-voicex-welcome-prompt {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        right: 14px;
        left: 14px;
        width: auto;
        max-width: none;
        padding: 14px 16px;
        border-radius: 14px;
        z-index: 10000003;
    }
}
