/* Custom premium player matching layout */
.falak-tts-wrapper {
    background-color: #f7f7f7;
    border-radius: 4px;
    padding: 18px 24px;
    margin: 20px 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.falak-tts-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Left structural panel */
.falak-tts-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 280px;
    gap: 16px;
}

/* Play button wrapper */
.falak-play-trigger {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s, transform 0.1s, border-color 0.2s;
    flex-shrink: 0;
}

.falak-play-trigger:hover {
    background-color: rgba(230, 0, 0, 0.05);
    border-color: #e60000;
}

.falak-play-trigger:active {
    transform: scale(0.95);
}

/* Play / Pause Icon Shapes */
.falak-play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 0 7px 12px;
    border-color: transparent transparent transparent #333333;
    margin-left: 3px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.falak-tts-wrapper.playing .falak-play-icon {
    width: 11px;
    height: 13px;
    border-style: double;
    border-width: 0px 0px 0px 11px;
    border-color: #333333;
    margin-left: 0;
}

.falak-play-trigger:hover .falak-play-icon {
    border-color: transparent transparent transparent #e60000;
}

.falak-tts-wrapper.playing .falak-play-trigger:hover .falak-play-icon {
    border-color: #e60000;
}

/* Meta & Text styling (Darker and crisp) */
.falak-player-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.falak-player-label {
    font-size: 14px;
    color: #222222; /* Darker, high-contrast text */
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.falak-progress-timeline {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.falak-time-stamp {
    font-size: 13px;
    color: #333333; /* Darkened from light grey to sharp charcoal */
    font-weight: 600;
    min-width: 38px;
    transition: color 0.3s ease;
}

.falak-slider-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
}

/* Timeline Slider */
.falak-progress-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #dcdcdc; /* High contrast track */
    outline: none;
    margin: 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.falak-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e60000; /* Vibrant Brand Red */
    cursor: pointer;
    transition: transform 0.1s;
}

.falak-progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.falak-progress-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e60000;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
}

/* Right utility controls layout */
.falak-tts-right {
    display: flex;
    align-items: center;
    gap: 16px;
    user-select: none;
}

/* Fixes squishing & blurring on skip controls */
.falak-utility-btn {
    background: transparent;
    border: none;
    padding: 0;
    width: 32px;  /* Increased from 28px to give the button more breathing room */
    height: 32px; /* Increased from 28px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333333; 
    transition: color 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.falak-utility-btn:hover {
    color: #e60000; 
    transform: scale(1.08);
}

.falak-svg-icon {
    width: 27px; /* Scaled up from 26px to create a larger empty center circle */
    height: 27px;
    fill: currentColor;
    position: absolute; /* Locks the SVG behind the text */
}

.falak-skip-num {
    position: relative;
    font-size: 10px; /* Shrunk slightly from 10px so it clears the inner arrowhead */
    font-weight: 800;
    color: currentColor;
    margin-top: 5px; /* Optically centers the number inside the new 30px loop */
    z-index: 2;
}
/* Speed badge selector */
.falak-speed-selector {
    background: #e60000; /* Made red to strongly tie into the theme */
    border: none;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff; /* Crisp white text over red badge */
    border-radius: 12px;
    cursor: pointer;
    min-width: 46px;
    text-align: center;
    transition: background-color 0.2s, transform 0.1s;
}

.falak-speed-selector:hover {
    background: #b30000; /* Darker red on hover */
    transform: scale(1.05);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .falak-tts-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .falak-tts-right {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ==========================================================================
   BULLETPROOF DARK MODE (Hooks into specific theme data-attributes)
   ========================================================================== */
body[data-theme="dark"] .falak-tts-wrapper,
.is-dark .falak-tts-wrapper,
html[data-theme="dark"] .falak-tts-wrapper {
    background-color: #0d0d0d !important; 
    border: 1px solid #1c1c1c !important;
}

body[data-theme="dark"] .falak-player-label,
.is-dark .falak-player-label,
html[data-theme="dark"] .falak-player-label {
    color: #ffffff !important;
}

body[data-theme="dark"] .falak-time-stamp,
.is-dark .falak-time-stamp,
html[data-theme="dark"] .falak-time-stamp {
    color: #cccccc !important;
}

body[data-theme="dark"] .falak-play-trigger,
.is-dark .falak-play-trigger,
html[data-theme="dark"] .falak-play-trigger {
    border-color: #ffffff !important;
}

body[data-theme="dark"] .falak-play-trigger:hover,
.is-dark .falak-play-trigger:hover,
html[data-theme="dark"] .falak-play-trigger:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: #e60000 !important;
}

body[data-theme="dark"] .falak-play-icon,
.is-dark .falak-play-icon,
html[data-theme="dark"] .falak-play-icon {
    border-color: transparent transparent transparent #ffffff !important;
}

body[data-theme="dark"] .falak-tts-wrapper.playing .falak-play-icon,
.is-dark .falak-tts-wrapper.playing .falak-play-icon,
html[data-theme="dark"] .falak-tts-wrapper.playing .falak-play-icon {
    border-color: #ffffff !important;
}

body[data-theme="dark"] .falak-play-trigger:hover .falak-play-icon,
.is-dark .falak-play-trigger:hover .falak-play-icon,
html[data-theme="dark"] .falak-play-trigger:hover .falak-play-icon {
    border-color: transparent transparent transparent #e60000 !important;
}

body[data-theme="dark"] .falak-progress-slider,
.is-dark .falak-progress-slider,
html[data-theme="dark"] .falak-progress-slider {
    background: #2a2a2a !important;
}

body[data-theme="dark"] .falak-utility-btn,
.is-dark .falak-utility-btn,
html[data-theme="dark"] .falak-utility-btn {
    color: #cccccc !important;
}

body[data-theme="dark"] .falak-utility-btn:hover,
.is-dark .falak-utility-btn:hover,
html[data-theme="dark"] .falak-utility-btn:hover {
    color: #e60000 !important;
}

/* ==========================================================================
   THEME 2: VOKE MAG (Light Red Pill with Straight Arrows)
   ========================================================================== */
.voke-tts-wrapper {
    background: #f5e6e6; /* Very soft, elegant red tint */
    border: 1px solid #ffebeb;
    border-radius: 50px;
    padding: 10px 22px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 4px 15px rgba(230, 0, 0, 0.06); /* Subtle red glowing shadow */
}

.voke-tts-container {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Play/Pause Button */
.voke-play-trigger {
    width: 44px;
    height: 44px;
    border-radius: 14px; /* Squircle shape instead of 50% circle */
    background: #e60000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s, background 0.2s;
    padding: 0;
}

.voke-play-trigger:hover {
    transform: scale(1.05);
    background: #cc0000; /* Slightly darker red on hover */
}

.voke-icon-play {
    width: 18px;
    height: 18px;
    fill: #ffffff; /* White play icon */
    margin-left: 3px;
}

/* CSS Magic: Turns SVG Play into Pause bars dynamically */
.voke-tts-wrapper.playing .voke-icon-play {
    display: none;
}
.voke-tts-wrapper.playing .voke-play-trigger::after {
    content: '';
    display: block;
    width: 12px;
    height: 14px;
    border-left: 4px solid #ffffff;
    border-right: 4px solid #ffffff;
    box-sizing: border-box;
}

/* Meta Data & Text */
.voke-player-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
}

.voke-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voke-title-bar span {
    color: #333333; /* Dark text for contrast */
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.voke-speed-btn {
    background: #ffe6e6; /* Soft red badge */
    border: none;
    color: #e60000; /* Red text */
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.voke-speed-btn:hover {
    background: #ffcccc;
}

/* Progress Slider */
.voke-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.voke-progress-row span {
    color: #666666;
    font-size: 11px;
    font-weight: 600;
    min-width: 32px;
}

.voke-progress-slider {
    -webkit-appearance: none;
    flex: 1;
    height: 4px;
    background: #ffcccc; /* Light red track */
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.voke-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e60000; /* Solid red thumb */
    cursor: pointer;
    transition: transform 0.1s;
}

.voke-progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

/* Side Controls (Straight Arrows) */
.voke-controls-right {
    display: flex;
    gap: 14px;
    align-items: center;
}

.voke-skip {
    background: transparent;
    border: none;
    color: #e60000; /* Red icons & text */
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 3px;
}

.voke-skip:hover {
    color: #cc0000;
    transform: scale(1.05);
}

.voke-straight-arrow {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .voke-tts-wrapper {
        border-radius: 20px;
        padding: 16px;
    }
    .voke-tts-container {
        flex-wrap: wrap; /* Allows controls to wrap instead of forcing a vertical stack */
        gap: 12px;
    }
    .voke-play-trigger {
        align-self: center;
    }
    .voke-player-meta {
        flex: 1 1 60%; /* Keeps the title and slider on the same row as the play button */
    }
    .voke-controls-right {
        flex: 1 1 100%; /* Forces the skip buttons to drop to a new line */
        justify-content: center;
        margin-top: 4px;
        padding-top: 12px;
        border-top: 1px solid #ffebeb; /* Adds a clean divider line above the skip buttons */
    }
}