/* ============================================================
   ACTBlitzRead — RSVP Speed Reader
   Professional speed reading tool with ORP fixation
   ============================================================ */

/* ---- Modal Overlay ---- */
.actblitzread-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: actblitzread-fadein 0.3s ease;
}
.actblitzread-overlay.active { display: flex; }

@keyframes actblitzread-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Main Container ---- */
.actblitzread-container {
    width: 90vw;
    max-width: 900px;
    max-height: 95vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,0.5);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ---- Header ---- */
.actblitzread-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #0D1B2A;
    color: #FFB300;
    border-bottom: 2px solid #FFB300;
}
.actblitzread-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.actblitzread-header-logo {
    width: 36px; height: 36px;
    border-radius: 8px;
}
.actblitzread-header-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}
.actblitzread-header-subtitle {
    font-size: 11px;
    color: #8899AA;
    margin-top: -2px;
}
.actblitzread-close {
    background: none;
    border: 2px solid #FFB300;
    color: #FFB300;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.actblitzread-close:hover {
    background: #FFB300;
    color: #0D1B2A;
}

/* ---- Word Display Area ---- */
.actblitzread-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    position: relative;
    transition: background 0.3s, color 0.3s;
    overflow: hidden;
}

/* ORP guide line — the fixed vertical line where the red letter always sits */
.actblitzread-orp-guide {
    position: absolute;
    top: 20%;
    bottom: 20%;
    width: 2px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.15;
    pointer-events: none;
}

/* The word container — positioned so ORP letter aligns with guide */
.actblitzread-word-container {
    position: relative;
    display: flex;
    align-items: baseline;
    white-space: nowrap;
    transition: font-size 0.2s;
}

.actblitzread-word-pre,
.actblitzread-word-post {
    transition: color 0.3s;
}

.actblitzread-word-orp {
    font-weight: 900;
    transition: color 0.3s;
}

/* Progress bar */
.actblitzread-progress-bar {
    height: 4px;
    background: rgba(128,128,128,0.2);
    width: 100%;
    position: relative;
}
.actblitzread-progress-fill {
    height: 100%;
    background: #FFB300;
    transition: width 0.1s linear;
    width: 0%;
}

/* ---- Controls Panel ---- */
.actblitzread-controls {
    padding: 16px 20px;
    background: #0D1B2A;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Row layout */
.actblitzread-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Play/Pause/Stop buttons */
.actblitzread-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.actblitzread-btn-play {
    background: #FFB300;
    color: #0D1B2A;
}
.actblitzread-btn-play:hover { background: #FFC107; }
.actblitzread-btn-stop {
    background: #E63946;
    color: white;
}
.actblitzread-btn-stop:hover { background: #FF4D5A; }
.actblitzread-btn-rewind {
    background: #334155;
    color: #CBD5E1;
}
.actblitzread-btn-rewind:hover { background: #475569; }

/* Speed slider */
.actblitzread-speed-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}
.actblitzread-speed-label {
    color: #8899AA;
    font-size: 12px;
    white-space: nowrap;
}
.actblitzread-speed-value {
    color: #FFB300;
    font-weight: 700;
    font-size: 14px;
    min-width: 70px;
    text-align: center;
}
.actblitzread-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #334155;
    outline: none;
}
.actblitzread-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #FFB300;
    cursor: pointer;
    border: 2px solid #0D1B2A;
}
.actblitzread-slider::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #FFB300;
    cursor: pointer;
    border: 2px solid #0D1B2A;
}

/* Font controls */
.actblitzread-font-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.actblitzread-font-btn {
    background: #1E293B;
    border: 1px solid #334155;
    color: #CBD5E1;
    width: 32px; height: 32px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.actblitzread-font-btn:hover {
    background: #334155;
    border-color: #FFB300;
}
.actblitzread-font-size-display {
    color: #CBD5E1;
    font-size: 12px;
    min-width: 35px;
    text-align: center;
}

/* Font family selector */
.actblitzread-select {
    background: #1E293B;
    border: 1px solid #334155;
    color: #CBD5E1;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}
.actblitzread-select:focus {
    border-color: #FFB300;
}

/* Palette selector */
.actblitzread-palette-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.actblitzread-palette-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.actblitzread-palette-btn.active {
    border-color: #FFB300;
    box-shadow: 0 0 8px rgba(255,179,0,0.5);
}
.actblitzread-palette-btn:hover {
    transform: scale(1.15);
}

/* Voice controls */
.actblitzread-voice-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.actblitzread-btn-voice {
    background: #1E293B;
    border: 1px solid #334155;
    color: #CBD5E1;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.actblitzread-btn-voice:hover {
    border-color: #FFB300;
}
.actblitzread-btn-voice.active {
    background: #FFB300;
    color: #0D1B2A;
    border-color: #FFB300;
    font-weight: 600;
}

/* Voice adjustment sliders */
.actblitzread-voice-adjust {
    display: flex;
    align-items: center;
    gap: 6px;
}
.actblitzread-voice-adjust label {
    color: #8899AA;
    font-size: 11px;
    min-width: 40px;
}
.actblitzread-voice-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: #334155;
    outline: none;
}
.actblitzread-voice-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #CBD5E1;
    cursor: pointer;
}

/* Section labels */
.actblitzread-section-label {
    color: #FFB300;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 8px;
    white-space: nowrap;
}

/* Word count / position info */
.actblitzread-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px 8px;
    background: #0D1B2A;
}
.actblitzread-info-item {
    color: #667788;
    font-size: 11px;
}
.actblitzread-info-value {
    color: #CBD5E1;
    font-weight: 600;
}

/* ---- Trigger Button (sits on document viewer frame) ---- */
.actblitzread-trigger {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 2px solid #FFB300;
    background: #0D1B2A;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1000;
}
.actblitzread-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(255,179,0,0.4);
}
.actblitzread-trigger img {
    width: 28px; height: 28px;
    border-radius: 6px;
}
.actblitzread-trigger-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #0D1B2A;
    color: #FFB300;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.actblitzread-trigger:hover .actblitzread-trigger-tooltip {
    opacity: 1;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .actblitzread-container { width: 98vw; }
    .actblitzread-row { gap: 8px; }
    .actblitzread-speed-group { min-width: 150px; }
}
