/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-blue: #4a9eff;
    --accent-green: #00d084;
    --accent-orange: #ff9500;
    --accent-purple: #af52de;
    --bg-danger: #dc3545;
    --border-color: #404040;
    --hover-bg: #404040;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* Main Application Styles */
.main-app {
    height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-header {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
}

.header-logo {
    height: 40px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.header-logo:hover {
    opacity: 1;
}

.header-left h1 {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
}

.version-info {
    background: var(--accent-blue);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-controls {
    display: flex;
    gap: 8px;
}

.header-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.header-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.header-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Connection Status Monitor */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 500;
    margin-right: 15px;
    min-width: 120px;
    transition: all 0.3s ease;
}

.connection-status.connected {
    background: rgba(39, 174, 96, 0.1);
    border-color: rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

.connection-status.disconnected {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.connection-status.error {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #f39c12;
}

.connection-status i {
    font-size: 8px;
    animation: pulse 2s infinite;
}

/* Inline connection status for section headers */
.connection-status-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 500;
    margin-left: 15px;
    min-width: 100px;
    transition: all 0.3s ease;
    vertical-align: middle;
}

.connection-status-inline.connected {
    background: rgba(39, 174, 96, 0.1);
    border-color: rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

.connection-status-inline.disconnected {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    border: 2px solid #e74c3c;
    color: white;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
    animation: disconnected-alert 1.5s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.connection-status-inline.error {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #f39c12;
}

.connection-status-inline i {
    font-size: 7px;
    animation: pulse 2s infinite;
}

/* Fullscreen and Window mode indicators */
.connection-status-inline span {
    font-size: 11px;
    line-height: 1.2;
}

/* Subtle highlighting for fullscreen vs windowed mode */
.connection-status-inline:has-text("🖥️FS") {
    background: rgba(34, 197, 94, 0.15) !important;
}

.connection-status-inline:has-text("🪟Win") {
    background: rgba(59, 130, 246, 0.1) !important;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes disconnected-alert {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(231, 76, 60, 0.9);
        background: linear-gradient(45deg, #c0392b, #e74c3c);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
    }
}

/* Disconnected Warning Banner */
.disconnected-warning {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: 2px solid #c0392b;
    border-radius: 8px;
    margin: 0;
    padding: 15px;
    text-align: center;
    animation: warning-pulse 2s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
}

.warning-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.warning-content i {
    color: #fff;
    font-size: 18px;
    animation: warning-icon-flash 1s ease-in-out infinite alternate;
}

.warning-text {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.warning-subtext {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
}

@keyframes warning-pulse {
    0% { 
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 6px 30px rgba(231, 76, 60, 0.7);
        transform: scale(1.01);
    }
    100% { 
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
        transform: scale(1);
    }
}

@keyframes warning-icon-flash {
    0% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* External Status Info Banner */
.external-status-info {
    border-radius: 8px;
    margin: 0;
    padding: 15px;
    text-align: center;
    animation: status-glow 3s ease-in-out infinite;
    transition: all 0.5s ease-in-out;
}

/* Green variant for fullscreen */
.external-status-info.connected {
    background: linear-gradient(135deg, rgba(0, 208, 132, 0.6) 0%, rgba(0, 166, 109, 0.5) 100%);
    border: 2px solid rgba(0, 208, 132, 0.5);
    box-shadow: 0 4px 20px rgba(0, 208, 132, 0.15);
    backdrop-filter: blur(12px);
}

/* Orange variant for ready (not fullscreen) */
.external-status-info.ready {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.6) 0%, rgba(255, 126, 0, 0.5) 100%);
    border: 2px solid rgba(255, 149, 0, 0.6);
    box-shadow: 0 4px 20px rgba(255, 149, 0, 0.18);
    backdrop-filter: blur(12px);
}

.status-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.status-content i {
    color: #fff;
    font-size: 18px;
}

.status-content .fas.fa-expand {
    animation: fullscreen-pulse 2s ease-in-out infinite;
}

.status-text {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.status-subtext {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
}

@keyframes status-glow {
    0% { 
        filter: brightness(1);
    }
    50% { 
        filter: brightness(1.1);
    }
    100% { 
        filter: brightness(1);
    }
}

/* Specific glow animations for different states */
.external-status-info.connected {
    animation: status-glow-green 3s ease-in-out infinite;
}

.external-status-info.ready {
    animation: status-glow-orange 3s ease-in-out infinite;
}

@keyframes status-glow-green {
    0% { 
        box-shadow: 0 4px 20px rgba(0, 208, 132, 0.15);
    }
    50% { 
        box-shadow: 0 6px 25px rgba(0, 208, 132, 0.25);
    }
    100% { 
        box-shadow: 0 4px 20px rgba(0, 208, 132, 0.15);
    }
}

@keyframes status-glow-orange {
    0% { 
        box-shadow: 0 4px 20px rgba(255, 149, 0, 0.18);
    }
    50% { 
        box-shadow: 0 6px 25px rgba(255, 149, 0, 0.28);
    }
    100% { 
        box-shadow: 0 4px 20px rgba(255, 149, 0, 0.18);
    }
}

@keyframes fullscreen-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Language Switcher */
.language-switcher {
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-right: 10px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 30px;
}

.lang-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--accent-blue);
    color: white;
}

.logout-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* App Container */
.app-container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    flex: 1;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
    min-height: 0;
}

.right-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    max-height: 100%;
    min-width: 420px;
}

/* Collapsible Sections */
.section-toggle {
    cursor: pointer;
    margin-right: 8px;
    transition: transform 0.3s ease;
    display: inline-block;
    width: 16px;
    text-align: center;
    font-size: 12px;
}

.section-toggle.collapsed {
    transform: rotate(-90deg);
}

.section-toggle:hover {
    color: var(--accent-blue);
}

.control-section h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 8px;
}

.control-section h3 i {
    width: 16px;
    text-align: center;
}

.control-section h3:hover {
    color: var(--accent-blue);
}

.section-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
    max-height: 2000px;
    opacity: 1;
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease-in, opacity 0.2s ease-in;
}

.monitor-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 20px;
    overflow: hidden;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Monitor Panel Specific */
.monitor-panel .control-section {
    flex: 0 0 auto;
    margin-bottom: 15px;
}

.monitor-panel .control-section:last-child {
    margin-bottom: 0;
    flex: 1;
    min-height: 0;
}

/* Section Header with Controls */
.section-header-with-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header-with-controls h3 {
    margin: 0;
    /*flex: 1;*/
}

/* Monitor Controls */
.monitor-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
}

.monitor-controls .btn-secondary,
.monitor-controls .btn-primary {
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
    min-width: auto;
    margin: 2px 0;
}

/* External Display Preview */

/* Panel Header */
.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: var(--bg-tertiary);
    border-radius: 12px 12px 0 0;
}

.panel-header h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.file-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Text Editor */
.text-editor {
    flex: 1;
    padding: 20px;
    border: none;
    outline: none;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-y: auto;
    background: var(--bg-primary);
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 200px;
}

.text-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolbar-separator {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 6px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 30px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.12s ease;
}

.toolbar-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.toolbar-btn:active,
.toolbar-btn.active {
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.toolbar-btn .size-label {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.toolbar-btn .size-large {
    font-size: 16px;
}

.toolbar-btn sub,
.toolbar-btn sup {
    font-size: 9px;
    font-weight: 700;
    opacity: 0.7;
}

/* Color buttons */
.toolbar-color-wrapper {
    position: relative;
}

.toolbar-color-btn {
    position: relative;
    width: 36px;
}

.color-indicator {
    display: block;
    width: 16px;
    height: 3px;
    border-radius: 1px;
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
}

.hidden-color-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* Emoji Picker */
.emoji-picker {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    max-height: 180px;
    overflow-y: auto;
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.emoji-grid button {
    width: 34px;
    height: 34px;
    font-size: 20px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s ease;
    line-height: 1;
    padding: 0;
}

.emoji-grid button:hover {
    background: var(--hover-bg);
    border-color: var(--border-color);
    transform: scale(1.15);
}

/* Rich text styles in editor and preview */
.text-editor span[style*="font-size: 0.7em"],
.teleprompter-preview span[style*="font-size: 0.7em"],
#teleprompter-text span[style*="font-size: 0.7em"] {
    font-size: 0.7em !important;
}

.text-editor span[style*="font-size: 1.4em"],
.teleprompter-preview span[style*="font-size: 1.4em"],
#teleprompter-text span[style*="font-size: 1.4em"] {
    font-size: 1.4em !important;
}

/* ==========================================
   INLINE EDIT MODE (Preview editing)
   ========================================== */

/* Edit toggle button in display header */
.display-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-edit-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s ease;
    opacity: 0.7;
}

.inline-edit-toggle-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    opacity: 1;
}

.inline-edit-toggle-btn.active {
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    opacity: 1;
}

/* Inline edit toolbar — floats over the top of the preview as an overlay so it
   does NOT push down or shrink the NÁHĽAD window. */
.inline-edit-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(28, 30, 36, 0.97);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
    flex-shrink: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.inline-edit-toolbar .toolbar-btn {
    height: 26px;
    width: 28px;
    font-size: 11px;
}

.inline-edit-toolbar .toolbar-separator {
    height: 18px;
}

.inline-edit-toolbar .toolbar-color-btn {
    width: 32px;
}

.inline-edit-toolbar .color-indicator {
    bottom: 2px;
    width: 14px;
    height: 2px;
}

/* Done button in inline toolbar */
.inline-edit-done-btn {
    width: auto !important;
    padding: 0 10px !important;
    gap: 4px;
    background: rgba(52, 199, 89, 0.15) !important;
    border-color: #34c759 !important;
    color: #34c759 !important;
    font-size: 11px !important;
    font-weight: 600;
}

.inline-edit-done-btn:hover {
    background: rgba(52, 199, 89, 0.3) !important;
}

.inline-edit-done-btn span {
    font-size: 11px;
}

/* Live sync toggle button */
.inline-sync-toggle-btn {
    width: auto !important;
    padding: 0 8px !important;
    gap: 4px;
    font-size: 11px !important;
    position: relative;
}

.inline-sync-toggle-btn .sync-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.inline-sync-toggle-btn.active {
    background: rgba(255, 59, 48, 0.15) !important;
    border-color: #ff3b30 !important;
    color: #ff3b30 !important;
    animation: live-pulse 1.5s ease-in-out infinite;
}

.inline-sync-toggle-btn.active .sync-label {
    color: #ff3b30;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Inline emoji picker positioned as an overlay just under the toolbar */
.inline-emoji-picker {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    z-index: 31;
}

/* Preview in edit mode */
.teleprompter-preview.inline-editing {
    cursor: text !important;
    outline: 2px solid var(--accent-blue);
    outline-offset: -2px;
    caret-color: var(--accent-blue);
}

.teleprompter-preview.inline-editing:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: -2px;
}

/* Edit mode no longer changes the layout — the toolbar floats as an overlay,
   so the preview keeps its exact size and position. */
.display-content-wrapper.editing-mode .display-content {
    flex: 1;
    min-height: 0;
}

.text-stats {
    padding: 15px 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 0 0 12px 12px;
}

/* Control Sections */
.control-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* External Display Preview */
.external-display-preview {
    margin-bottom: 15px;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.display-frame {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: aspect-ratio 0.3s ease; /* Smooth transition */
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    /* Responzívne škálovanie - prispôsobí sa veľkosti kontainera */
    max-height: calc(100vh - 200px); /* Maximálne výška minus priestor pre ovládače */
    max-width: 100%;
    object-fit: contain; /* Zachová pomer strán */
}

/* Dynamic aspect ratio classes - responzívne škálovanie */
.display-frame.external-closed {
    aspect-ratio: 16/10; /* For external screen format when closed */
    /* Škálovanie podľa dostupného priestoru v oboch smeroch */
    width: min(100%, calc((100vh - 200px) * 16 / 10), 90vw);
    height: min(calc(100vw * 10 / 16), calc(100vh - 200px), 90vh);
    max-width: calc((100vh - 200px) * 16 / 10);
    max-height: calc(100vw * 10 / 16);
}

.display-frame.external-open {
    aspect-ratio: 16/9; /* For common monitor format when open */
    /* Škálovanie podľa dostupného priestoru v oboch smeroch */
    width: min(100%, calc((100vh - 200px) * 16 / 9), 90vw);
    height: min(calc(100vw * 9 / 16), calc(100vh - 200px), 90vh);
    max-width: calc((100vh - 200px) * 16 / 9);
    max-height: calc(100vw * 9 / 16);
}

/* Support for ultrawide and other aspect ratios - responzívne škálovanie */
.display-frame.ultrawide {
    aspect-ratio: 21/9; /* For ultrawide monitors */
    width: min(100%, calc((100vh - 200px) * 21 / 9), 90vw);
    height: min(calc(100vw * 9 / 21), calc(100vh - 200px), 90vh);
    max-width: calc((100vh - 200px) * 21 / 9);
    max-height: calc(100vw * 9 / 21);
}

.display-frame.square {
    aspect-ratio: 1/1; /* For square monitors */
    width: min(100%, calc(100vh - 200px), 90vw);
    height: min(100vw, calc(100vh - 200px), 90vh);
    max-width: calc(100vh - 200px);
    max-height: 100vw;
}

.display-frame.portrait {
    aspect-ratio: 9/16; /* For portrait orientation */
    width: min(100%, calc((100vh - 200px) * 9 / 16), 90vw);
    height: min(calc(100vw * 16 / 9), calc(100vh - 200px), 90vh);
    max-width: calc((100vh - 200px) * 9 / 16);
    max-height: calc(100vw * 16 / 9);
}

/* Media queries pre menšie obrazovky */
@media (max-height: 600px) {
    .display-frame {
        max-height: calc(100vh - 100px); /* Menší offset pre malé obrazovky */
    }
    
    .display-frame.external-closed {
        width: min(80vw, calc((100vh - 100px) * 16 / 10));
        height: min(calc(80vw * 10 / 16), calc(100vh - 100px));
        max-width: calc((100vh - 100px) * 16 / 10);
        max-height: calc(80vw * 10 / 16);
    }
    
    .display-frame.external-open {
        width: min(80vw, calc((100vh - 100px) * 16 / 9));
        height: min(calc(80vw * 9 / 16), calc(100vh - 100px));
        max-width: calc((100vh - 100px) * 16 / 9);
        max-height: calc(80vw * 9 / 16);
    }
    
    .display-frame.ultrawide {
        width: min(80vw, calc((100vh - 100px) * 21 / 9));
        height: min(calc(80vw * 9 / 21), calc(100vh - 100px));
        max-width: calc((100vh - 100px) * 21 / 9);
        max-height: calc(80vw * 9 / 21);
    }
    
    .display-frame.square {
        width: min(80vw, calc(100vh - 100px));
        height: min(80vw, calc(100vh - 100px));
        max-width: calc(100vh - 100px);
        max-height: 80vw;
    }
    
    .display-frame.portrait {
        width: min(80vw, calc((100vh - 100px) * 9 / 16));
        height: min(calc(80vw * 16 / 9), calc(100vh - 100px));
        max-width: calc((100vh - 100px) * 9 / 16);
        max-height: calc(80vw * 16 / 9);
    }
}

/* Blackout preview state */
.display-frame.blackout-preview {
    border-color: #dc2626;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
    animation: blackout-glow 2s ease-in-out infinite alternate;
}

@keyframes blackout-glow {
    from {
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
    }
    to {
        box-shadow: 0 0 30px rgba(220, 38, 38, 0.5);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Blackout watermark styles */
#blackout-watermark-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.blackout-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    border: 2px solid #dc2626;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 14px;
    z-index: 100;
    backdrop-filter: blur(5px);
    animation: pulse 2s infinite;
    pointer-events: none;
}

.blackout-watermark .blackout-icon {
    font-size: 96px;
    margin-bottom: 16px;
}

.blackout-watermark .blackout-text {
    font-size: 48px;
    letter-spacing: 2px;
    font-weight: bold;
}

.display-header {
    background: var(--bg-tertiary);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Zabráni zmenšovaniu */
    order: 1; /* Prvý v poradí */
}

.display-resolution {
    color: var(--text-secondary);
    font-weight: 500;
}

.display-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff6b6b;
}

.status-indicator-dot.active {
    background: var(--accent-green);
}

.pause-label {
    color: var(--accent-orange);
    font-weight: 600;
    font-size: 11px;
}

.percentage {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Wrapper for display-content + minimap side by side */
.display-content-wrapper {
    flex: 1;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    order: 3;
    gap: 0;
    position: relative;
}

.display-content {
    padding: 10px 0; /* Only vertical padding to prevent horizontal overflow */
    flex: 1; /* Zaberie zvyšný priestor */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevent any overflow from this container */
    /* aspect-ratio sa nastavuje dynamicky cez JavaScript */
    container-type: inline-size; /* Enable container queries */
}

/* Text Minimap */
.text-minimap {
    width: 192px;
    flex-shrink: 0;
    background: #000;
    border-left: 1px solid #333;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
}

.minimap-content {
    position: absolute;
    top: 0;
    left: 0;
    color: rgba(220, 220, 220, 0.9);
    font-family: Arial, sans-serif;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    pointer-events: none;
    transform-origin: top left;
}

/* Dark overlays above and below viewport — dim text outside visible area */
.minimap-overlay-top,
.minimap-overlay-bottom {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: 1;
    height: 0;
}

.minimap-overlay-top {
    top: 0;
}

.minimap-overlay-bottom {
    top: 0;
}

.minimap-viewport {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(59, 130, 246, 0.12);
    border-top: 2px solid rgba(59, 130, 246, 0.7);
    border-bottom: 2px solid rgba(59, 130, 246, 0.7);
    border-left: 2px solid rgba(59, 130, 246, 0.9);
    border-right: none;
    pointer-events: none;
    min-height: 8px;
    transition: top 0.1s ease, height 0.1s ease;
    z-index: 2;
}

.text-minimap:hover .minimap-viewport {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.9);
}

/* Position percentage badge — shown while scrolling/dragging the minimap */
.minimap-percent {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    background: rgba(59, 130, 246, 0.95);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.minimap-percent.visible {
    opacity: 1;
}

.teleprompter-preview {
    color: var(--text-primary);
    /* font-size removed - controlled by JavaScript */
    text-align: left;
    opacity: 1;
    line-height: 1.4;
    overflow-y: auto;  /* Only vertical scrolling */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
    height: 100%;
    background: #000;
    border: 2px solid #333;
    border-radius: 4px;
    position: relative;
    padding: 0;
    box-sizing: border-box;
    cursor: grab;
    user-select: text;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word; /* Force breaking of long words */
    overflow-wrap: break-word; /* Modern CSS for word breaking */
    hyphens: none; /* NO hyphens for teleprompter - clean reading */
    /* GPU-accelerated scrolling for smooth performance */
    will-change: scroll-position;
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
}

.teleprompter-preview:active {
    cursor: grabbing;
}

.teleprompter-preview::-webkit-scrollbar {
    width: 0px; /* Skryje scrollbar úplne */
    display: none; /* Pre istotu */
}

/* Skryje scrollbar aj vo Firefox */
.teleprompter-preview {
    scrollbar-width: none; /* Firefox */
}

.teleprompter-preview::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.teleprompter-preview::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.teleprompter-preview::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* External Button */
.external-btn {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #357abd 100%);
}

/* Resync Button */
.resync-btn {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #cc7700 100%);
    margin-left: 8px;
    font-size: 12px;
    padding: 8px 12px;
    min-width: auto;
}

.resync-btn:hover {
    background: linear-gradient(135deg, #ff9500 0%, var(--accent-orange) 100%);
    transform: translateY(-1px);
}

.resync-btn i {
    margin-right: 4px;
}

/* Document Controls */
.document-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.doc-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.doc-btn.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.doc-btn:hover:not(.active) {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.doc-btn i {
    font-size: 16px;
}

.doc-btn-full {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.doc-btn-full:hover {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.doc-status {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    padding: 5px;
}

/* Settings Grid */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item.full-width {
    width: 100%;
}

/* Settings Persistence Section */
.settings-persistence {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.settings-persistence-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.settings-persistence-header label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.settings-persistence-header label i {
    margin-right: 4px;
}

.premium-badge {
    font-size: 10px;
    font-weight: 700;
    color: #ff9500;
    background: rgba(255, 149, 0, 0.12);
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.premium-badge i {
    margin-right: 3px;
    font-size: 9px;
}

.settings-persistence-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-btn-row {
    display: flex;
    gap: 6px;
}

.settings-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 8px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.settings-action-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.settings-action-btn.active {
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.settings-action-btn i {
    font-size: 11px;
}

.settings-action-btn-danger:hover {
    border-color: var(--bg-danger);
    color: var(--bg-danger);
}

.premium-only-feature.locked {
    opacity: 0.45;
    pointer-events: none;
    position: relative;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-row label {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Timer Position Grid */
.timer-position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    width: 120px;
    height: 80px;
    margin: 10px auto;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    background: var(--primary-dark);
}

.timer-pos-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.timer-pos-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--text-primary);
}

.timer-pos-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.timer-pos-btn.active:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Timer Display */
.timer-display {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 24px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    user-select: none;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.timer-display.top-left {
    top: 20px;
    left: 20px;
}

.timer-display.top-right {
    top: 20px;
    right: 20px;
}

.timer-display.bottom-left {
    bottom: 20px;
    left: 20px;
}

.timer-display.bottom-right {
    bottom: 20px;
    right: 20px;
}

.timer-display.preview-window {
    font-size: 16px;
    padding: 8px 12px;
}

.timer-display.external-window {
    font-size: 32px;
    padding: 16px 20px;
}

/* Preview Timer Display - Responsive CSS-based styling */
.preview-timer-display {
    position: absolute;
    z-index: 1000;
    bottom: 1.5%;
    
    /* Responsive typography */
    font-family: Arial, sans-serif;
    /* font-size: clamp(8px, 2.5vw, 16px);*/
    font-size: max(20px, 3.4vw);
    font-weight: bold;
    letter-spacing: 0.1em;
    color: #ffffff;
    /* Responsive spacing */
    padding: 0; /* Ešte väčší padding pre väčšie timery */
    border-radius: 8px; /* Väčší border radius */
    
    /* Visual styling */
    background-color: rgba(0, 0, 0, 0.7);
    background-color: #991b1b70;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.preview-timer-display#previewTimerLeft {
    left: 0;
}

.preview-timer-display#previewTimerRight {
    right: 0;
}



/* Timer Controls */
.timer-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.timer-controls .btn-secondary {
    padding: 8px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.timer-mode-elapsed {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.timer-mode-realtime {
    background: var(--accent);
    color: white;
}

.timer-mode-realtime:hover {
    background: var(--accent-hover);
}

/* Timer Enable Section */
.timer-enable-section {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.timer-sides-container {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 500px;
}

.timer-side-box {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.timer-side-box:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.timer-side-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
}

.timer-side-header i {
    color: var(--accent);
    font-size: 16px;
}

.timer-side-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timer-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 400px;
}

.timer-toggle-btn {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-toggle-btn.active {
    background: var(--accent) !important;
    border-color: var(--accent-hover) !important;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
    color: white !important;
}

.timer-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.realtime-text {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 1px;
}

.timer-text {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 1px;
}

.countdown-text {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Countdown Duration Section */
.countdown-duration-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 12px 0;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
}

.countdown-duration-section label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.countdown-time-picker {
    display: flex;
    align-items: center;
    gap: 6px;
}

.countdown-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
}

.spinner-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 18px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 9px;
    border-radius: 4px;
    transition: all 0.15s ease;
    opacity: 0.5;
}

.spinner-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    opacity: 1;
}

.spinner-btn:active {
    background: var(--accent-blue);
    color: #fff;
    opacity: 1;
}

.countdown-input {
    width: 40px;
    padding: 2px 0;
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    -moz-appearance: textfield;
    line-height: 1;
}

.countdown-input::-webkit-outer-spin-button,
.countdown-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.countdown-input:focus {
    color: var(--accent-blue);
}

.countdown-unit {
    font-size: 9px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: -2px;
    margin-bottom: 1px;
}

.countdown-colon {
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1;
    margin-top: -6px;
}

.timer-enable-section .showtime-btn {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
}

/* Timer Position - Bottom Only */
.timer-position-bottom-only {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 15px 0;
}

.timer-position-bottom-only .timer-pos-btn {
    flex: 1;
    max-width: 120px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.timer-position-bottom-only .pos-text {
    font-size: 11px;
    font-weight: 500;
}

/* Timer Controls Section */
.timer-controls-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Timer Display in Controls */
.timer-display-control {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.control-timer-display {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    letter-spacing: 2px;
    text-align: center;
    min-width: 140px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Timer Controls - Horizontal */
.timer-controls-horizontal {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 0;
}

.timer-control-btn {
    flex: 1;
    max-width: 90px;
    padding: 10px 12px !important;
    font-size: 12px !important;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 40px;
}

.timer-control-btn .btn-text {
    font-size: 11px;
    line-height: 1;
}

/* Alignment Buttons */
.alignment-buttons {
    display: flex;
    gap: 4px;
}

.align-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.align-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.align-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 4px;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-swatch.black {
    background: #000;
}

.color-swatch.white {
    background: #fff;
    border-color: var(--border-color);
}

.color-swatch.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
}

/* Alignment and Colors Row Layout */
.alignment-and-colors-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.alignment-section {
    flex: 1;
    min-width: 200px;
}

.colors-section {
    flex: 1;
    min-width: 300px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.color-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

.color-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Enhanced Color Swatches */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 80px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.color-swatch:hover {
    transform: scale(1.05);
}

.color-swatch.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
}

/* Color scheme swatches */
.color-swatch.black {
    background: #000;
    color: #fff;
}

.color-swatch.white {
    background: #fff;
    color: #000;
    border-color: #ddd;
}

.color-label {
    pointer-events: none;
}

/* Transform buttons for external screen */
.transform-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.transform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 10px;
    font-weight: 600;
}

.transform-btn:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.transform-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
}

.transform-btn i {
    font-size: 14px;
    margin-bottom: 2px;
}

.transform-btn span {
    font-size: 9px;
    font-weight: 700;
}

.transform-btn:disabled {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.transform-btn:disabled:hover {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* Size markers for font slider */
.size-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Custom Slider */
.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(74, 158, 255, 0.3);
    transition: all 0.3s ease;
}

.custom-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(74, 158, 255, 0.3);
    transition: all 0.3s ease;
}

/* Speed slider — brighter track so the line doesn't blend into the background */
.speed-slider {
    height: 6px;
    background: linear-gradient(to right, var(--accent-blue) 0%, rgba(74, 158, 255, 0.35) 100%);
    border-color: rgba(74, 158, 255, 0.6);
}

/* Speed Animation Effects */
.speed-increase-effect {
    animation: speedIncreaseGlow 0.5s ease-out;
}

.speed-decrease-effect {
    animation: speedDecreaseGlow 0.5s ease-out;
}

.speed-temp-effect {
    animation: speedTempPulse 0.3s ease-in-out;
}

@keyframes speedIncreaseGlow {
    0% { 
        box-shadow: 0 0 5px var(--accent-green), 0 0 10px var(--accent-green), 0 0 15px var(--accent-green);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 10px var(--accent-green), 0 0 20px var(--accent-green), 0 0 30px var(--accent-green);
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 2px 6px rgba(74, 158, 255, 0.3);
        transform: scale(1);
    }
}

@keyframes speedDecreaseGlow {
    0% { 
        box-shadow: 0 0 5px var(--accent-orange), 0 0 10px var(--accent-orange), 0 0 15px var(--accent-orange);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 10px var(--accent-orange), 0 0 20px var(--accent-orange), 0 0 30px var(--accent-orange);
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 2px 6px rgba(74, 158, 255, 0.3);
        transform: scale(1);
    }
}

@keyframes speedTempPulse {
    0% { 
        background: var(--accent-blue);
        transform: scale(1);
    }
    50% { 
        background: var(--accent-purple);
        transform: scale(1.2);
        box-shadow: 0 0 15px var(--accent-purple), 0 0 25px var(--accent-purple);
    }
    100% { 
        background: var(--accent-blue);
        transform: scale(1);
    }
}

/* Speed display text animation */
.speed-display-animate {
    animation: speedTextBounce 0.4s ease-out;
}

@keyframes speedTextBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); color: var(--accent-green); }
    100% { transform: scale(1); }
}

/* Playback Section */
.playback-section {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.playback-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.playback-left {
    flex: 1;
}

.shortcut-keys {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.key-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-group kbd {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid var(--border-color);
    min-width: 40px;
    text-align: center;
}

.key-group span {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Presenter Keys Styling */
.key-group.presenter-keys {
    border-left: 3px solid var(--accent-purple);
    padding-left: 10px;
    margin-top: 5px;
}

.key-group.presenter-keys kbd {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #8e4ec6 100%);
    color: white;
    font-weight: bold;
    border: 1px solid var(--accent-purple);
    box-shadow: 0 2px 4px rgba(175, 82, 222, 0.3);
}

.key-group.presenter-keys span {
    color: var(--accent-purple);
    font-weight: 500;
}

/* Interactive key highlighting */
.key-group {
    transition: all 0.2s ease;
}

.key-group.active {
    transform: scale(1.05);
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    padding: 4px 8px;
    margin: -4px -8px;
}

.key-group.active kbd {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%) !important;
    border-color: #4caf50 !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6) !important;
    animation: keyPulse 0.6s ease-out;
}

.key-group.active span {
    color: #4caf50 !important;
    font-weight: 700 !important;
}

/* Presenter keys when active */
.key-group.presenter-keys.active kbd {
    background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%) !important;
    border-color: #ff9800 !important;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.6) !important;
}

.key-group.presenter-keys.active span {
    color: #ff9800 !important;
}

@keyframes keyPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
    }
}

.play-button {
    background: linear-gradient(135deg, var(--accent-green) 0%, #00b570 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 16px 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 208, 132, 0.3);
    min-width: 140px;
    justify-content: center;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 208, 132, 0.4);
}

.play-button.playing {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e6850e 100%);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.4);
}

.play-button.playing:hover {
    box-shadow: 0 6px 16px rgba(255, 149, 0, 0.5);
}

.play-button.pause {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e6850e 100%);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
}

/* Playback buttons container */
.playback-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

/* Blackout button styling */
.blackout-btn {
    background: linear-gradient(135deg, #000000 0%, #1f1f1f 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 16px 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    min-width: 140px;
    justify-content: center;
}

.blackout-btn:hover {
    background: linear-gradient(135deg, #1f1f1f 0%, #333333 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.blackout-btn.active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.blackout-btn.active:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

.speed-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* =============================================
   LICENSE MODAL STYLES
   ============================================= */

.license-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.license-modal-content {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 10001;
    margin: 0 auto;
}

.license-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.license-header h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.license-header h2 i {
    color: var(--accent-blue);
    font-size: 2rem;
}

.version-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-purple);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(128, 90, 213, 0.3);
}

.license-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.license-options {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    gap: 30px !important;
    align-items: center !important;
    margin: 30px 0 !important;
}

.license-option {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px 25px;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.license-option:hover {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.option-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--accent-blue);
}

.license-option.trial .option-icon {
    color: var(--accent-green);
}

.license-option.premium .option-icon {
    color: var(--accent-orange);
}

.license-option h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.license-option p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn-trial {
    background: linear-gradient(135deg, var(--accent-green) 0%, #00b570 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-trial:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 208, 132, 0.4);
}

.btn-premium {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e6850e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.4);
}

.license-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.license-input-group input {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    color: var(--text-primary);
    font-size: 16px;
    text-align: center;
    font-family: monospace;
    letter-spacing: 1px;
    width: 200px;
    transition: border-color 0.3s ease;
}

.license-input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

.license-input-group input::placeholder {
    color: var(--text-secondary);
}

.license-divider {
    text-align: center !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    font-size: 1.2rem !important;
    writing-mode: vertical-lr !important;
    text-orientation: mixed !important;
    padding: 20px 10px !important;
    background: var(--bg-primary) !important;
    border-radius: 25px !important;
    border: 2px solid var(--border-color) !important;
    min-height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    position: relative !important;
}

.license-help {
    margin-top: 10px;
}

.license-help small {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsívne pre menšie obrazovky */
@media (max-width: 768px) {
    .license-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .license-divider {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        padding: 10px 20px;
        min-height: auto;
        min-width: 120px;
    }
    
    .license-option {
        min-height: 250px;
    }
    
    .license-modal-content {
        max-width: 95%;
        padding: 30px 20px;
    }
}

/* =============================================
   LICENSE DISPLAY STYLES
   ============================================= */

.license-display {
    margin-left: 40px;
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    min-width: 200px;
}

.license-display.trial {
    background: rgba(255, 149, 0, 0.1);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.license-display.premium {
    background: rgba(0, 208, 132, 0.1);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.license-display.expired {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
    color: #e74c3c;
    animation: license-warning 2s ease-in-out infinite;
}

.license-timer {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 13px;
}

.license-timer.warning {
    color: #e74c3c;
    animation: timer-blink 1s ease-in-out infinite;
}

@keyframes license-warning {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes timer-blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.speed-section label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.speed-slider {
    background: linear-gradient(to right, 
        var(--accent-green) 0%, 
        var(--accent-blue) 50%, 
        var(--accent-orange) 100%);
    height: 6px;
}

.speed-markers {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: -4px;
}

/* Responsive adjustments for new design */
@media (max-width: 1024px) {
    .right-panel {
        width: 100%;
        max-width: 400px;
    }
    
    .playback-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .doc-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

.display-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.screen-info {
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.screen-info i {
    margin-right: 5px;
    color: var(--accent-blue);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    border: 1px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
    transform: translateY(-1px);
}

.btn-urgent {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: white !important;
    border: 2px solid #e74c3c !important;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4) !important;
    font-weight: 600 !important;
}

.btn-urgent:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
    border-color: #c0392b !important;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.6) !important;
    transform: translateY(-1px) scale(1.02) !important;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 0 25px rgba(231, 76, 60, 0.8);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
    }
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-orange {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e6850e 100%);
    color: white;
    border: 1px solid transparent;
}

.btn-orange:hover {
    background: linear-gradient(135deg, #e6850e 0%, #cc7700 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.4);
}

.btn-black {
    background: #000000;
    color: white;
    border: 1px solid #333333;
}

.btn-black:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

/* Playback Controls */
.playback-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.control-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.play-btn, .pause-btn {
    background: linear-gradient(135deg, var(--accent-green) 0%, #00b570 100%);
    color: white;
}

.play-btn:hover, .pause-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 208, 132, 0.4);
}

.control-btn:not(.play-btn):not(.pause-btn) {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.control-btn:not(.play-btn):not(.pause-btn):hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Speed Control */
.speed-control {
    margin-bottom: 15px;
}

.speed-control label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.speed-control input[type="range"] {
    width: 100%;
    margin-bottom: 15px;
}

.speed-presets {
    display: flex;
    gap: 8px;
}

.speed-preset {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.speed-preset:hover {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
}

.speed-preset.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    border-color: var(--accent-blue);
}

/* Settings */
.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.setting-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

.alignment-controls {
    display: flex;
    gap: 8px;
}

.alignment-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.alignment-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
}

.alignment-btn.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    border-color: var(--accent-blue);
}

/* Keyboard Shortcuts */
.shortcuts-info {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.shortcut-item:last-child {
    margin-bottom: 0;
}

.shortcut-item kbd {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid var(--border-color);
}

.shortcut-item span {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Range Slider Styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    border: 1px solid var(--border-color);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .app-container {
        gap: 15px;
        padding: 15px;
    }
}

@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .right-panel,
    .monitor-panel {
        max-height: 50vh;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .header-left h1 {
        font-size: 1.2rem;
    }
    
    .app-container {
        padding: 10px;
        gap: 10px;
    }
    
    .panel-header {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .file-controls {
        justify-content: center;
    }
    
    .display-controls {
        flex-direction: column;
    }
    
    .playback-controls {
        flex-wrap: wrap;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .right-panel,
    .monitor-panel {
        max-height: 40vh;
    }
    
    /* Modal responsive */
    .text-editor-modal .modal-content {
        width: 95%;
        height: 90%;
    }
    
    .text-editor-modal .modal-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .text-editor-modal .modal-controls {
        justify-content: center;
    }
}

/* Text Editor Modal */
.text-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.text-editor-modal.show {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.text-editor-modal .modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    margin: auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    animation: none;
    overflow: hidden;
}

.text-editor-modal.show .modal-content {
    transform: scale(1);
}

.text-editor-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 12px 12px 0 0;
}

.text-editor-modal .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-editor-modal .modal-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.text-editor-modal .btn-close {
    background: var(--bg-danger);
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.text-editor-modal .btn-close:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.text-editor-modal .modal-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.text-editor-modal .modal-body .text-editor {
    flex: 1;
    width: 100%;
    min-height: 0;
}

.text-editor-modal .modal-body .text-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* Progress Bar Styles */
.progress-container {
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Zabráni zmenšovaniu */
    order: 2; /* Druhý v poradí */
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    font-family: monospace;
}

/* Enhanced help text for playback controls */
.help-text-large {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
}

/* Highlighted Show Timer button */
.showtime-btn-highlighted {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e6850e 100%) !important;
    color: white !important;
    border: 2px solid var(--accent-orange) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    padding: 16px 32px !important;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.4) !important;
    transition: all 0.3s ease !important;
}

.showtime-btn-highlighted:hover {
    background: linear-gradient(135deg, #ff9500 0%, var(--accent-orange) 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.5) !important;
}

/* Timer position buttons with text at top and square positioning */
.timer-pos-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 16px !important;
    height: 80px !important;
    background: var(--bg-secondary) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.pos-text-top {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    margin-bottom: 8px !important;
}

.position-indicator {
    width: 40px !important;
    height: 30px !important;
    position: relative !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    background: var(--bg-primary) !important;
}

.pos-square {
    position: absolute !important;
    font-size: 8px !important;
    color: var(--accent-blue) !important;
    bottom: 2px !important;
}

.pos-square.pos-left {
    left: 2px !important;
}

.pos-square.pos-right {
    right: 2px !important;
}

.timer-pos-btn:hover {
    background: var(--hover-bg) !important;
    border-color: var(--accent-blue) !important;
}

.timer-pos-btn:hover .pos-text-top {
    color: var(--text-primary) !important;
}

.timer-pos-btn.active {
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.3) !important;
}

.timer-pos-btn.active .pos-text-top {
    color: white !important;
}

.timer-pos-btn.active .position-indicator {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: white !important;
}

.timer-pos-btn.active .pos-square {
    color: var(--accent-blue) !important;
}

/* ========================
   LICENSE SYSTEM STYLES
   ======================== */

/* License Display in Header */
.license-display {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
    margin-top: 5px;
    text-align: center;
    display: block;
    width: fit-content;
    margin-left: 40px;
    margin-right: auto;
}

.license-display.free-license {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border-color: #ff6b35;
    animation: pulse-orange 2s infinite;
}

.license-display.premium-license {
    background: linear-gradient(135deg, #00d084 0%, #0bb671 100%);
    color: white;
    border-color: #00d084;
}

@keyframes pulse-orange {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* License Modal */
.license-modal {
    /* max-width: 500px; */
    width: 100%;
}

.license-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.license-option {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.license-option h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.license-option p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.license-divider {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px 0;
    position: relative;
}

.license-divider::before,
.license-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.license-divider::before {
    left: 0;
}

.license-divider::after {
    right: 0;
}

.license-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.license-input input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    text-transform: uppercase;
    font-family: monospace;
    letter-spacing: 1px;
}

.license-input input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

.btn-trial {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.btn-trial:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.btn-premium {
    background: linear-gradient(135deg, #00d084 0%, #0bb671 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    white-space: nowrap;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 208, 132, 0.3);
}

.license-help {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.license-help h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.license-help p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 5px;
}

/* Upgrade Modal */
.upgrade-modal {
    max-width: 450px;
    width: 90%;
    text-align: center;
}

.upgrade-input {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.upgrade-input input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    text-transform: uppercase;
    font-family: monospace;
    letter-spacing: 1px;
}

.upgrade-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Modal improvements */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 20px 0 20px;
    text-align: center;
}

.modal-header h2 {
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

/* ===== Mobile Gate (phones / small devices) ===== */
.mobile-gate {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, #0f3460 0%, #16213e 60%, #0b1020 100%);
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

.mobile-gate-content {
    width: 100%;
    max-width: 480px;
    text-align: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 36px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.mobile-gate-icon {
    font-size: 56px;
    color: #4a9eff;
    margin-bottom: 18px;
    line-height: 1;
}

.mobile-gate-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 14px;
    line-height: 1.3;
}

.mobile-gate-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    margin: 0 0 24px;
}

.mobile-gate-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
}

.mobile-gate-seconds {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-size: 2.4rem;
    font-weight: 800;
    color: #4a9eff;
    font-variant-numeric: tabular-nums;
}

.mobile-gate-seconds span[data-translate] {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
}

.mobile-gate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #4a9eff 0%, #2563eb 100%);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mobile-gate-button:active {
    transform: scale(0.98);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

@media (max-width: 380px) {
    .mobile-gate-content {
        padding: 28px 18px;
    }
    .mobile-gate-content h1 {
        font-size: 1.3rem;
    }
    .mobile-gate-icon {
        font-size: 48px;
    }
    .mobile-gate-seconds {
        font-size: 2rem;
    }
}
