.loader.small {
    display: inline-block;
    position: relative;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-right: 4px solid #764ba2;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.loader.small:before,
.loader.small:after {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loader.small:before {
    left: -2em;
    -webkit-animation-delay: -0.32s;
    animation-delay: -0.32s;
}
.loader.small:after {
    left: 2em;
}

@-webkit-keyframes small-loader {
    0%,
    80%,
    100% {
        box-shadow: 0 1em 0 -1.3em;
    }
    40% {
        box-shadow: 0 1em 0 0;
    }
}
@keyframes small-loader {
    0%,
    80%,
    100% {
        box-shadow: 0 1em 0 -1.3em;
    }
    40% {
        box-shadow: 0 1em 0 0;
    }
}


#app.samsung #subtitle-loader-container {
    display: none;
}
#subtitle-loader-container {
    background: rgba(18, 24, 38, 0.96);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    gap: 15px;
}


#subtitle-loader-container .loading-text {
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 500;
    margin-top: 10px;
}
/* Old fallback styles removed - consolidated into drawer section below */

/* 
 * SUBTITLE STYLE REFERENCE (hardcoded for 2016-2017 TV compatibility)
 * CSS custom properties (var()) are NOT supported on Samsung 2016-2017 TVs
 * Default values used throughout this file:
 * - subtitle-size: 24px
 * - subtitle-bg: rgba(0, 0, 0, 0.8)
 * - subtitle-color: white
 * - subtitle-outline: 1px 1px 2px rgba(0, 0, 0, 0.8)
 */

/* Enhanced subtitle display styling from exo app */
.subtitle-container {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: 80%;
    pointer-events: none;
}

.subtitle-text {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 24px;
    line-height: 1.4;
    text-align: center;
    font-family: 'Arial', sans-serif;
    word-wrap: break-word;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Platform-specific subtitle styling */
#app.samsung .subtitle-container {
    bottom: 80px;
    font-size: 26px;
}

#app.lg .subtitle-container {
    bottom: 60px;
    font-size: 24px;
}

/* Responsive subtitle sizing */
@media (max-width: 1280px) {
    .subtitle-text {
        font-size: 20px;
        padding: 6px 12px;
    }
}

@media (max-width: 768px) {
    .subtitle-text {
        font-size: 18px;
        padding: 4px 8px;
    }
    
    .subtitle-container {
        max-width: 90%;
        bottom: 40px;
    }
}

/* =====================================================
   NETFLIX-STYLE SIDE DRAWER - Subtitle Selection Panel
   ES5/Tizen 2.4+ Compatible - No CSS Variables
   ===================================================== */

/* Hide Bootstrap backdrop ONLY when subtitle drawer is the active modal */
/* Uses data attribute on body set by JavaScript when drawer opens */
body[data-subtitle-drawer-open="true"] .modal-backdrop {
    opacity: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
}

/* Backdrop overlay - handled by modal itself */
#subtitle-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    display: none;
    background: rgba(0, 0, 0, 0);
    -webkit-transition: background 300ms ease;
    transition: background 300ms ease;
    overflow: hidden;
}

#subtitle-selection-modal.show {
    display: block;
    background: rgba(0, 0, 0, 0.75);
}

/* Side drawer panel - slides from right */
/* Custom class .subtitle-drawer-panel avoids conflicts with generic .modal-dialog */
.subtitle-drawer-panel,
#subtitle-selection-modal .modal-dialog {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    margin: 0 !important;
    width: 38%;
    min-width: 380px;
    max-width: 520px;
    height: 100%;
    -webkit-transform: translate3d(100%, 0, 0) !important;
    transform: translate3d(100%, 0, 0) !important;
    -webkit-transition: -webkit-transform 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition: transform 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#subtitle-selection-modal.show .subtitle-drawer-panel,
#subtitle-selection-modal.show .modal-dialog {
    -webkit-transform: translate3d(0, 0, 0) !important;
    transform: translate3d(0, 0, 0) !important;
}

/* Panel content wrapper */
#subtitle-selection-modal .modal-content {
    background: linear-gradient(180deg, #1a1d29 0%, #141620 100%);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    overflow: hidden;
}

/* Header section */
#subtitle-selection-modal .modal-header {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding: 28px 32px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

#subtitle-selection-modal .modal-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-align: left;
    letter-spacing: 0.5px;
}

/* Body section - flex column, no scroll on body itself */
#subtitle-modal-body {
    background: transparent;
    padding: 0;
    position: relative;
    min-height: 200px;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
}

/* Subtitle options container - THIS is the scrollable area */
#subtitle-selection-container {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 32px 32px;
    padding-bottom: 24px;
    margin: 0;
}

#subtitle-selection-container::-webkit-scrollbar {
    width: 6px;
}

#subtitle-selection-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}

#subtitle-selection-container::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 3px;
}

#subtitle-selection-container::-webkit-scrollbar-thumb:hover {
    background: #3730a3;
}

/* Netflix-style subtitle option buttons */
.subtitle-option {
    background: #1a1d29;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin: 0;
    margin-bottom: 10px;
    padding: 18px 24px;
    padding-right: 60px;
    color: #a3a3a3;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.4px;
    -webkit-transition: all 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
    transition: all 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
    cursor: pointer;
    position: relative;
    display: block;
    min-height: 62px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.subtitle-option:hover {
    background: #22262f;
    border-color: rgba(255, 255, 255, 0.15);
    color: #e5e5e5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Selected state - subtle Netflix red border */
.subtitle-option.selected,
.subtitle-option.active {
    background: #1e2230;
    border-color: rgba(229, 9, 20, 0.5);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Focused state - Strong Netflix red highlight */
.subtitle-option:focus,
.subtitle-option.focused {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.15) 0%, rgba(229, 9, 20, 0.08) 100%);
    background-color: #1e2230;
    border-color: #e50914;
    color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25), 0 6px 20px rgba(0, 0, 0, 0.4);
    -webkit-transform: scale(1.015) translateZ(0);
    transform: scale(1.015) translateZ(0);
}

/* Selected + Focused - combined state */
.subtitle-option.selected.focused,
.subtitle-option.active.focused {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.18) 0%, rgba(229, 9, 20, 0.1) 100%);
    background-color: #1e2230;
    border-color: #e50914;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.3), 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* Checkmark for selected state */
.subtitle-option.selected::after,
.subtitle-option.active::after {
    content: '✓';
    position: absolute;
    right: 22px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    color: #e50914;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Footer button wrapper - in-flow flex footer with frosted glass effect */
#subtitle-modal-body .modal-button-wrapper {
    position: relative;
    width: 100%;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    z-index: 100;
    padding: 28px 40px;
    box-sizing: border-box;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    /* Frosted glass background */
    background: rgba(20, 22, 32, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Button wrappers - centered with gap between them */
#subtitle-modal-body .modal-button-wrapper .btn-wrapper-1 {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    margin: 0;
}

/* Gap between buttons using adjacent sibling selector */
#subtitle-modal-body .modal-button-wrapper .btn-wrapper-1 + .btn-wrapper-1 {
    margin-left: 24px;
}

/* Netflix-style modern action buttons */
#subtitle-modal-body .modal-btn-1 {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 14px 40px;
    width: auto;
    min-width: 140px;
    -webkit-transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: inline-block;
    cursor: pointer;
    text-transform: uppercase;
}

#subtitle-modal-body .modal-btn-1:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Primary action button (OK/Save) - Netflix red */
#subtitle-modal-body .modal-btn-1[data-word_code="ok"],
#subtitle-modal-body .modal-btn-1[data-action="save"] {
    background: #e50914;
    border-color: #e50914;
    color: #ffffff;
}

#subtitle-modal-body .modal-btn-1[data-word_code="ok"]:hover,
#subtitle-modal-body .modal-btn-1[data-action="save"]:hover {
    background: #f40612;
    border-color: #f40612;
}

#subtitle-modal-body .modal-btn-1:focus,
#subtitle-modal-body .modal-btn-1.focused {
    background: #e50914;
    border-color: #e50914;
    outline: none;
    -webkit-transform: scale(1.02);
    transform: scale(1.02);
}

/* =====================================================
   RESPONSIVE BREAKPOINTS - TV Screen Sizes
   ===================================================== */

/* 720p TVs (1280x720) */
@media (max-height: 720px) {
    #subtitle-selection-modal .modal-dialog {
        width: 45%;
        min-width: 320px;
        max-width: 450px;
    }
    
    #subtitle-selection-modal .modal-header {
        padding: 20px 24px;
    }
    
    #subtitle-selection-modal .modal-title {
        font-size: 24px;
    }
    
    #subtitle-selection-container {
        padding: 24px 24px;
        padding-bottom: 16px;
    }
    
    #subtitle-modal-body .modal-button-wrapper {
        padding: 20px 24px;
    }
    
    #subtitle-modal-body .modal-button-wrapper .btn-wrapper-1 + .btn-wrapper-1 {
        margin-left: 16px;
    }
    
    .subtitle-option {
        font-size: 20px;
        padding: 14px 20px;
        padding-right: 50px;
        min-height: 54px;
        margin-bottom: 6px;
    }
    
    .subtitle-option.selected::after {
        font-size: 20px;
        right: 18px;
    }
    
    
    #subtitle-modal-body .modal-btn-1 {
        font-size: 18px;
        padding: 14px 20px;
    }
}

/* 1080p TVs (1920x1080) - Default styles apply */

/* 4K UHD TVs (3840x2160) */
@media (min-height: 1440px) {
    #subtitle-selection-modal .modal-dialog {
        width: 32%;
        min-width: 500px;
        max-width: 680px;
    }
    
    #subtitle-selection-modal .modal-header {
        padding: 36px 40px;
    }
    
    #subtitle-selection-modal .modal-title {
        font-size: 36px;
    }
    
    #subtitle-selection-container {
        padding: 40px 40px;
        padding-bottom: 32px;
    }
    
    #subtitle-modal-body .modal-button-wrapper {
        padding: 36px 48px;
    }
    
    #subtitle-modal-body .modal-button-wrapper .btn-wrapper-1 + .btn-wrapper-1 {
        margin-left: 32px;
    }
    
    .subtitle-option {
        font-size: 30px;
        padding: 24px 32px;
        padding-right: 80px;
        min-height: 80px;
        margin-bottom: 12px;
        border-radius: 8px;
    }
    
    .subtitle-option.selected::after {
        font-size: 32px;
        right: 28px;
    }
    
    
    #subtitle-modal-body .modal-btn-1 {
        font-size: 26px;
        padding: 22px 32px;
    }
}

/* Selected state indicator */
.subtitle-option-button.selected::after,
.subtitle-color-button.selected::after,
.subtitle-action-btn.selected::after {
    content: "✓";
    position: absolute;
    top: 5px;
    right: 8px;
    color: #4ade80;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.subtitle-option-button,
.subtitle-color-button {
    position: relative;
}

/* Radio button styling in subtitle options */
.subtitle-option .magic-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.subtitle-option .magic-radio + label {
    display: inline-block;
    padding-left: 0;
    padding-right: 35px;
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    color: inherit;
    flex-grow: 1;
    vertical-align: middle;
    font-weight: 500;
}

/* Empty subtitle state styling */
.no-subtitles-message {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
}

.no-subtitles-message::before {
    content: "🎬";
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.no-subtitles-icon {
    font-size: 48px;
    color: #64748b;
    margin-bottom: 15px;
    opacity: 0.6;
}

/* Subtitle quality indicators */
.subtitle-option .quality-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
    margin-right: 30px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.subtitle-option .quality-badge.hearing-impaired {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.subtitle-option .quality-badge.auto-generated {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.3);
}

/* Language flag indicators */
.subtitle-option .language-flag {
    font-size: 20px;
    margin-right: 8px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.subtitle-option .magic-radio + label:before {
    display: none;
}

.subtitle-option .magic-radio + label:after {
    display: none;
}

/* Loading indicator for subtitle fetch */
.subtitle-loading-indicator {
    display: inline-block;
    margin-left: 8px;
}

.subtitle-loading-indicator::after {
    content: "⏳";
    animation: rotate 1s infinite linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Subtitle Settings Modal Styles */
#subtitle-preview-container {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 12px;
    padding: 40px 20px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subtitle-preview-background {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><rect width="60" height="60" fill="%23ffffff" opacity="0.05"/><rect x="10" y="10" width="40" height="40" fill="%23000000" opacity="0.1"/></svg>');
    background-size: 60px 60px;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
}

.subtitle-preview-text {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 24px;
    line-height: 1.4;
    text-align: center;
    font-family: 'Arial', sans-serif;
    word-wrap: break-word;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: inline-block;
}

.subtitle-setting-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.subtitle-setting-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.subtitle-size-options, 
.subtitle-bg-color-options, 
.subtitle-text-color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.subtitle-option-button {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 12px 20px;
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-align: center;
    min-width: 80px;
}

.subtitle-option-button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* Selected state - only checkmark, no green styling */
.subtitle-option-button.active,
.subtitle-option-button.selected {
    /* No special styling, just the checkmark from ::after */
}

/* Focused state - green styling when navigating */
.subtitle-option-button.focused {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(22, 163, 74, 0.3) 100%);
    border-color: #22c55e;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3), 0 8px 25px rgba(34, 197, 94, 0.4);
}

.subtitle-color-button {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px 15px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 90px;
}

.subtitle-color-button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* Selected state - only checkmark, no green styling */
.subtitle-color-button.active,
.subtitle-color-button.selected {
    /* No special styling, just the checkmark from ::after */
}

/* Focused state - green styling when navigating */
.subtitle-color-button.focused {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(22, 163, 74, 0.3) 100%);
    border-color: #22c55e;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3), 0 8px 25px rgba(34, 197, 94, 0.4);
}

.color-preview {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
}

/* Background Color Previews */
.transparent-bg {
    background: transparent;
    border: none; /* Remove dashed border completely */
}

.black-bg {
    background: rgba(0, 0, 0, 0.8);
}

.red-bg {
    background: rgba(255, 0, 0, 0.8);
}

.white-bg {
    background: rgba(255, 255, 255, 0.8);
}

.blue-bg {
    background: rgba(0, 0, 255, 0.8);
}

/* Text Color Previews */
.white-text {
    background: #ffffff;
}

.black-text {
    background: #000000;
}

.yellow-text {
    background: #ffff00;
}

.red-text {
    background: #ff0000;
}

.green-text {
    background: #00ff00;
}

.subtitle-modal-buttons {
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.subtitle-modal-buttons .btn-wrapper-1 {
    flex: 0 0 auto;
    display: inline-block;
    white-space: nowrap;
}

.subtitle-modal-buttons .subtitle-action-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    white-space: nowrap;
}

.subtitle-modal-buttons .subtitle-action-btn:hover,
.subtitle-modal-buttons .subtitle-action-btn.focused {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.subtitle-modal-buttons .subtitle-action-btn.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    border: 2px solid #4ade80 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.5);
}

.subtitle-action-btn {
    min-width: 120px;
}

/* Position Action Buttons - Save and Cancel in subtitle position overlay */
.position-action-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: 2px solid #4facfe;
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    white-space: nowrap;
    min-width: 120px;
}

.position-action-btn:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.position-action-btn.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    border: 2px solid #4ade80 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.5);
}

/* Subtitle Position Modal Styling */
#subtitle-position-modal .modal-content {
    background: linear-gradient(145deg, #1a1f2e 0%, #16191e 50%, #0f1419 100%);
    border: 2px solid #2d3748;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

#subtitle-position-preview-container {
    background: linear-gradient(135deg, #2a2d3a 0%, #212328 100%);
    border: 2px solid #3d4250;
    border-radius: 12px;
    height: 150px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.subtitle-position-preview-background {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #000428 0%, #004e92 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subtitle-position-preview-text {
    color: white;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 6px;
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    transition: bottom 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.subtitle-position-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
    gap: 20px;
}

.position-button {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 12px 20px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    min-width: 120px;
    justify-content: center;
}

.position-button:hover,
.position-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.position-display {
    text-align: center;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 600;
    min-width: 150px;
}

.position-presets {
    display: flex;
    gap: 12px;
    margin: 15px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.preset-button {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 16px;
    color: #cbd5e0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.preset-button:hover,
.preset-button.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: #00f2fe;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

/* =====================================================
   SUBTITLE SETTINGS MODAL - Netflix-style Drawer
   Same pattern as subtitle selection drawer
   ===================================================== */

/* Hide Bootstrap backdrop for settings drawer too */
body[data-subtitle-settings-open="true"] .modal-backdrop {
    opacity: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
}

#subtitle-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    display: none;
    background: rgba(0, 0, 0, 0);
    -webkit-transition: background 300ms ease;
    transition: background 300ms ease;
    overflow: hidden;
}

#subtitle-settings-modal.show {
    display: block;
    background: rgba(0, 0, 0, 0.75);
}

/* Settings drawer panel - slides from right */
#subtitle-settings-modal .subtitle-drawer-panel,
#subtitle-settings-modal .modal-dialog {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    margin: 0 !important;
    width: 42%;
    min-width: 420px;
    max-width: 580px;
    height: 100%;
    -webkit-transform: translate3d(100%, 0, 0) !important;
    transform: translate3d(100%, 0, 0) !important;
    -webkit-transition: -webkit-transform 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition: transform 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#subtitle-settings-modal.show .subtitle-drawer-panel,
#subtitle-settings-modal.show .modal-dialog {
    -webkit-transform: translate3d(0, 0, 0) !important;
    transform: translate3d(0, 0, 0) !important;
}

/* Settings panel content wrapper */
#subtitle-settings-modal .modal-content {
    background: linear-gradient(180deg, #1a1d29 0%, #141620 100%);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    overflow: hidden;
}

/* Settings header section */
#subtitle-settings-modal .modal-header {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding: 28px 32px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

#subtitle-settings-modal .modal-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-align: left;
    letter-spacing: 0.5px;
}

/* Settings body - flex column layout */
#subtitle-settings-body {
    background: transparent;
    padding: 0;
    position: relative;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
}

/* Scrollable settings container */
#subtitle-settings-container {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 24px 32px;
    padding-bottom: 20px;
}

#subtitle-settings-container::-webkit-scrollbar {
    width: 6px;
}

#subtitle-settings-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}

#subtitle-settings-container::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 3px;
}

/* Settings preview area - compact version for drawer */
#subtitle-settings-modal #subtitle-preview-container,
#subtitle-settings-modal .settings-preview-area {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 10px;
    padding: 24px 16px;
    margin-bottom: 20px;
    text-align: center;
    min-height: 80px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#subtitle-settings-modal .subtitle-preview-background {
    padding: 12px;
    width: 100%;
}

#subtitle-settings-modal .subtitle-preview-text {
    font-size: 20px;
    padding: 6px 14px;
}

/* Settings sections - drawer optimized */
#subtitle-settings-modal .subtitle-setting-section {
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#subtitle-settings-modal .subtitle-setting-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    text-shadow: none;
    letter-spacing: 0.3px;
}

/* Drawer-specific option button overrides */
#subtitle-settings-modal .subtitle-size-options,
#subtitle-settings-modal .subtitle-bg-color-options,
#subtitle-settings-modal .subtitle-text-color-options {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: -4px;
}

#subtitle-settings-modal .subtitle-option-button {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    margin: 4px;
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 6px;
    min-width: 80px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #b3b3b3;
    -webkit-transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

#subtitle-settings-modal .subtitle-option-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
}

#subtitle-settings-modal .subtitle-option-button.active,
#subtitle-settings-modal .subtitle-option-button.selected {
    background: rgba(229, 9, 20, 0.08);
    border-color: rgba(229, 9, 20, 0.4);
    color: #ffffff;
}

#subtitle-settings-modal .subtitle-option-button.focused {
    background: rgba(229, 9, 20, 0.12);
    border-color: #e50914;
    color: #ffffff;
    -webkit-transform: scale(1.02);
    transform: scale(1.02);
}

#subtitle-settings-modal .subtitle-color-button {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    margin: 4px;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 6px;
    min-width: 80px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #b3b3b3;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

#subtitle-settings-modal .subtitle-color-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
}

#subtitle-settings-modal .subtitle-color-button.active,
#subtitle-settings-modal .subtitle-color-button.selected {
    background: rgba(229, 9, 20, 0.08);
    border-color: rgba(229, 9, 20, 0.4);
    color: #ffffff;
}

#subtitle-settings-modal .subtitle-color-button.focused {
    background: rgba(229, 9, 20, 0.12);
    border-color: #e50914;
    color: #ffffff;
    -webkit-transform: scale(1.02);
    transform: scale(1.02);
}

#subtitle-settings-modal .color-preview {
    width: 26px;
    height: 16px;
    border-radius: 3px;
    margin-bottom: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Settings footer button wrapper */
#subtitle-settings-body .modal-button-wrapper {
    position: relative;
    width: 100%;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    z-index: 100;
    padding: 24px 32px;
    box-sizing: border-box;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    background: rgba(20, 22, 32, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#subtitle-settings-body .modal-button-wrapper .btn-wrapper-1 {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    margin: 0;
}

#subtitle-settings-body .modal-button-wrapper .btn-wrapper-1 + .btn-wrapper-1 {
    margin-left: 20px;
}

/* Settings buttons - Netflix style */
#subtitle-settings-body .modal-btn-1 {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 12px 32px;
    width: auto;
    min-width: 120px;
    -webkit-transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: inline-block;
    cursor: pointer;
    text-transform: uppercase;
}

#subtitle-settings-body .modal-btn-1:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Save button - Netflix red */
#subtitle-settings-body .modal-btn-1[data-action="save"] {
    background: #e50914;
    border-color: #e50914;
    color: #ffffff;
}

#subtitle-settings-body .modal-btn-1[data-action="save"]:hover {
    background: #f40612;
    border-color: #f40612;
}

#subtitle-settings-body .modal-btn-1:focus,
#subtitle-settings-body .modal-btn-1.focused {
    background: #e50914;
    border-color: #e50914;
    color: #ffffff;
    outline: none;
    -webkit-transform: scale(1.02);
    transform: scale(1.02);
}

/* =====================================================
   SETTINGS DRAWER RESPONSIVE - TV Screen Sizes
   ===================================================== */

/* 720p TVs */
@media (max-height: 720px) {
    #subtitle-settings-modal .subtitle-drawer-panel,
    #subtitle-settings-modal .modal-dialog {
        width: 48%;
        min-width: 360px;
        max-width: 500px;
    }
    
    #subtitle-settings-modal .modal-header {
        padding: 18px 24px;
    }
    
    #subtitle-settings-modal .modal-title {
        font-size: 22px;
    }
    
    #subtitle-settings-container {
        padding: 18px 24px;
    }
    
    #subtitle-settings-modal .subtitle-setting-section {
        margin-bottom: 12px;
        padding: 12px;
    }
    
    #subtitle-settings-modal .subtitle-setting-title {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .subtitle-options-grid > .subtitle-option {
        padding: 10px 12px;
        font-size: 14px;
        min-width: 70px;
    }
    
    #subtitle-settings-body .modal-button-wrapper {
        padding: 18px 24px;
    }
    
    #subtitle-settings-body .modal-btn-1 {
        font-size: 14px;
        padding: 10px 24px;
        min-width: 100px;
    }
}

/* 4K UHD TVs */
@media (min-height: 1440px) {
    #subtitle-settings-modal .subtitle-drawer-panel,
    #subtitle-settings-modal .modal-dialog {
        width: 36%;
        min-width: 540px;
        max-width: 720px;
    }
    
    #subtitle-settings-modal .modal-header {
        padding: 36px 40px;
    }
    
    #subtitle-settings-modal .modal-title {
        font-size: 34px;
    }
    
    #subtitle-settings-container {
        padding: 32px 40px;
    }
    
    #subtitle-settings-modal .subtitle-setting-section {
        margin-bottom: 20px;
        padding: 20px;
    }
    
    #subtitle-settings-modal .subtitle-setting-title {
        font-size: 20px;
        margin-bottom: 16px;
    }
    
    .subtitle-options-grid > .subtitle-option {
        padding: 16px 22px;
        font-size: 20px;
        min-width: 110px;
        border-radius: 8px;
    }
    
    .subtitle-options-grid.color-grid .color-preview {
        width: 36px;
        height: 24px;
    }
    
    #subtitle-settings-body .modal-button-wrapper {
        padding: 32px 40px;
    }
    
    #subtitle-settings-body .modal-btn-1 {
        font-size: 20px;
        padding: 16px 40px;
        min-width: 150px;
    }
}