/* ============================================
   VARIABLES Y RESET
   ============================================ */
:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d30;
    --bg-modal: #1e1e1e;
    --text-primary: #d4d4d4;
    --text-secondary: #858585;
    --accent-blue: #007acc;
    --accent-green: #4ec9b0;
    --accent-orange: #ce9178;
    --accent-red: #f48771;
    --border-color: #3e3e42;
    --shadow: rgba(0, 0, 0, 0.5);
    --line-number-bg: #1e1e1e;
    --line-number-text: #858585;
    --cursor-color: #aeafad;
}

/* Tema claro */
body.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f3f3f3;
    --bg-tertiary: #e8e8e8;
    --bg-modal: #ffffff;
    --text-primary: #333333;
    --text-secondary: #6b6b6b;
    --border-color: #d4d4d4;
    --shadow: rgba(0, 0, 0, 0.1);
    --line-number-bg: #f5f5f5;
    --line-number-text: #999999;
    --cursor-color: #528bff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================================
   BARRA DE HERRAMIENTAS
   ============================================ */
.toolbar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.toolbar h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* Selector de modo */
.mode-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-tertiary);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Control de velocidad */
.speed-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-tertiary);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.speed-input {
    width: 60px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    font-family: 'Fira Code', monospace;
    transition: all 0.2s ease;
}

.speed-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.speed-input::-webkit-inner-spin-button,
.speed-input::-webkit-outer-spin-button {
    opacity: 1;
    height: 20px;
}

.speed-display {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 12px;
    color: var(--accent-green);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Fira Code', monospace;
    min-width: 30px;
    text-align: center;
}

/* Selector de tema */
.theme-selector {
    display: flex;
    align-items: center;
}

.theme-btn {
    font-size: 18px;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    color: var(--accent-blue);
}

body.light-theme .theme-btn i::before {
    content: "\f185"; /* fa-sun */
}

/* Botón informativo (Completar) */
.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #0f6674 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(23, 162, 184, 0.4);
}

.recording-status {
    background-color: rgba(244, 135, 113, 0.95);
    color: white;
    padding: 12px 24px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 2px solid var(--accent-red);
}

.recording-status.hidden {
    display: none;
}

.recording-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.recording-dot {
    animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Salida hacia abajo para notificaciones flotantes (creadas desde JS) */
@keyframes slideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Ocultar solo textos durante grabación, NO la UI completa */
body.is-recording .panel-title,
body.is-recording .char-count,
body.is-recording #status {
    opacity: 0;
    pointer-events: none;
}

/* Mantener la estructura pero sin textos */
body.is-recording .panel-header {
    min-height: 40px;
}

body.is-recording .status-bar {
    min-height: 30px;
}

.processing-content {
    max-width: 500px;
    text-align: center;
}

.processing-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.processing-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.processing-body {
    padding: 40px 24px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#processingStatus {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 16px;
}

.download-links {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: none;
    flex-direction: column;
    gap: 12px;
}

.download-links.show {
    display: flex;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

.download-btn i {
    color: var(--accent-green);
}

.btn-icon.active {
    color: var(--accent-green);
}

.btn-icon.muted {
    color: var(--accent-red);
}

.btn-icon.muted i::before {
    content: "\f6a9";
}

.mode-selector label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.radio-group {
    display: flex;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.radio-label:hover {
    background-color: var(--bg-secondary);
    transform: translateY(-1px);
}

.radio-label input[type="radio"] {
    cursor: pointer;
    accent-color: var(--accent-blue);
}

.radio-label input[type="radio"]:checked + i {
    color: var(--accent-blue);
    animation: pulse 0.5s ease;
}

.radio-label input[type="radio"]:checked ~ span {
    color: var(--accent-blue);
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Botones */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.btn-primary:hover {
    background-color: #005a9e;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 122, 204, 0.4);
}

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

.btn-secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.2);
}

.btn-warning {
    background-color: var(--accent-orange);
    color: var(--bg-primary);
    box-shadow: 0 4px 12px rgba(206, 145, 120, 0.3);
}

.btn-warning:hover {
    background-color: #b87d63;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(206, 145, 120, 0.4);
}

.btn-success {
    background-color: var(--accent-green);
    color: var(--bg-primary);
    box-shadow: 0 4px 12px rgba(78, 201, 176, 0.3);
}

.btn-success:hover {
    background-color: #3da88a;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(78, 201, 176, 0.4);
}

.btn-danger {
    background-color: var(--accent-red);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 135, 113, 0.3);
}

.btn-danger:hover {
    background-color: #d96f5a;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(244, 135, 113, 0.4);
}

.btn-danger.recording {
    animation: pulse-record 1.5s infinite;
}

@keyframes pulse-record {
    0%, 100% { box-shadow: 0 4px 12px rgba(244, 135, 113, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(244, 135, 113, 0.8); }
}

.divider {
    width: 1px;
    height: 30px;
    background-color: var(--border-color);
    margin: 0 8px;
}

.layout-selector {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.layout-selector:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.layout-selector:hover {
    border-color: var(--accent-blue);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
    color: var(--text-secondary);
}

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

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px var(--shadow);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.btn-close:hover {
    color: var(--accent-red);
}

.code-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 24px;
    overflow-y: auto;
}

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

.input-section label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-icon {
    font-size: 16px;
}

.input-section textarea {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    min-height: 200px;
    resize: vertical;
    transition: all 0.3s ease;
}

.input-section textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.2);
    transform: scale(1.01);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================
   PANELES (EDITOR Y PREVIEW)
   ============================================ */
.editor-panel,
.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-panel {
    border-right: 1px solid var(--border-color);
}

.panel-header {
    background-color: var(--bg-secondary);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.char-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
}

/* Indicador de estado de JavaScript */
.js-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.js-status.incomplete {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.js-status.valid {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.js-status.error {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.js-status i {
    font-size: 10px;
}

.js-status.incomplete i {
    animation: spin 2s linear infinite;
}

/* Barra de progreso */
.progress-bar-container {
    height: 3px;
    background-color: var(--bg-tertiary);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-blue);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Editor */
.editor-wrapper {
    flex: 1;
    display: flex;
    overflow: auto;
    background-color: var(--bg-primary);
    scroll-behavior: smooth;
}

.editor-container {
    flex: 1;
    position: relative;
    overflow: auto;
    scroll-behavior: smooth;
}

.line-numbers {
    background-color: var(--line-number-bg);
    color: var(--line-number-text);
    padding: 16px 12px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--border-color);
    min-width: 50px;
    white-space: pre;
    overflow: hidden;
}

.code-editor {
    flex: 1;
    padding: 16px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow: visible;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    min-height: 100%;
}

.code-editor code {
    font-family: inherit;
    background: transparent !important;
    padding: 0 !important;
}

/* Mejoras de syntax highlighting */
.code-editor .hljs {
    background: transparent !important;
    padding: 0 !important;
}

.code-editor .hljs-tag,
.code-editor .hljs-name {
    color: #e06c75 !important;
}

.code-editor .hljs-attr {
    color: #d19a66 !important;
}

.code-editor .hljs-string {
    color: #98c379 !important;
}

.code-editor .hljs-keyword {
    color: #c678dd !important;
}

.code-editor .hljs-function {
    color: #61afef !important;
}

.code-editor .hljs-number {
    color: #d19a66 !important;
}

.code-editor .hljs-comment {
    color: #5c6370 !important;
    font-style: italic;
}

.code-editor .hljs-built_in {
    color: #e5c07b !important;
}

.code-editor .hljs-property {
    color: #56b6c2 !important;
}

.code-editor .hljs-selector-class,
.code-editor .hljs-selector-id {
    color: #e5c07b !important;
}

.code-editor .hljs-meta {
    color: #abb2bf !important;
}

/* Cursor parpadeante */
.typing-cursor {
    position: absolute;
    width: 2px;
    height: 20px;
    background-color: var(--cursor-color);
    animation: blink-cursor 1s infinite;
    z-index: 10;
    pointer-events: none;
    display: none;
}

.typing-cursor.active {
    display: block;
}

@keyframes blink-cursor {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.status-bar {
    background-color: var(--bg-secondary);
    padding: 6px 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-bar i {
    color: var(--accent-green);
    animation: blink 1.5s infinite;
}

.shortcuts-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.shortcuts-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--accent-blue);
    transform: scale(1.1);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Panel de atajos */
.shortcuts-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px var(--shadow);
    z-index: 999;
    min-width: 300px;
    animation: slideUp 0.3s ease;
}

.shortcuts-panel.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.shortcuts-content h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.shortcut-item kbd {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: var(--accent-blue);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

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

.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 16px;
}

/* Vista Previa */
#preview {
    flex: 1;
    border: none;
    background-color: white;
    width: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .code-inputs {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-center,
    .toolbar-right {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .editor-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

/* ============================================
   SCROLLBARS PERSONALIZADOS
   ============================================ */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* ============================================
   SISTEMA ADAPTATIVO - LAYOUTS VERTICALES
   ============================================ */

/* Contenedor principal adaptativo */
.app-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Barra lateral (solo visible en layouts verticales) */
.side-controls {
    width: 200px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    gap: 20px;
}

.side-controls.hidden {
    display: none;
}

.side-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.vertical-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.vertical-title i {
    font-size: 24px;
    color: var(--accent-blue);
}

.side-section h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-section h3 i {
    font-size: 14px;
}

/* Selector de modo lateral */
.side-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.side-radio-label:hover {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
}

.side-radio-label input {
    margin: 0;
    cursor: pointer;
}

.side-radio-label i {
    font-size: 16px;
}

.side-radio-label input:checked + i {
    color: var(--accent-blue);
}

/* Control de velocidad lateral */
.side-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.side-speed input[type="number"] {
    width: 50px;
    padding: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    text-align: center;
}

.side-speed small {
    color: var(--text-secondary);
    font-size: 10px;
}

/* Botones laterales */
.side-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
}

.side-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
    transform: translateX(2px);
}

.side-btn i {
    width: 16px;
    text-align: center;
}

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

.side-btn.recording {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
    animation: pulse 1.5s infinite;
}

/* Opciones laterales */
.side-options {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.side-icon-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

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

.side-icon-btn.active {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.side-icon-btn.muted {
    color: var(--accent-red);
}

/* Selector de layout lateral */
.side-layout-selector {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-family: inherit;
}

.side-layout-selector:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* ============================================
   LAYOUTS ADAPTATIVOS MEJORADOS
   ============================================ */

/* Default: toolbar horizontal arriba */
body.layout-default .side-controls,
body.layout-youtube .side-controls {
    display: none;
}

body.layout-default #toolbar,
body.layout-youtube #toolbar {
    display: flex;
}

/* YouTube: 16:9 ratio (1120x630 = 16:9 exacto, cabe mejor en pantalla) */
body.layout-youtube .main-container {
    width: 1120px;
    height: 630px;
    margin: 20px auto;
    border: 3px solid var(--accent-blue);
    box-shadow: 0 10px 40px var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

/* Reels/TikTok: 9:16 ratio EXACTO (540x960 = 9:16 perfecto) */
body.layout-reels .side-controls {
    display: flex;
}

body.layout-reels #toolbar {
    display: none;
}

body.layout-reels .main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow-y: auto;
}

body.layout-reels .main-container {
    flex-direction: column;
    width: 540px;
    height: 960px;
    margin: 0;
    border: 3px solid var(--accent-green);
    box-shadow: 0 10px 60px var(--shadow);
    border-radius: 12px;
    overflow: hidden;
}

body.layout-reels .editor-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
}

/* Instagram: 1:1 ratio EXACTO (600x600 para mejor visualización) */
body.layout-instagram .side-controls {
    display: flex;
}

body.layout-instagram #toolbar {
    display: none;
}

body.layout-instagram .main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow-y: auto;
}

body.layout-instagram .main-container {
    width: 600px;
    height: 600px;
    margin: 0;
    flex-direction: column;
    border: 3px solid var(--accent-orange);
    box-shadow: 0 10px 60px var(--shadow);
    border-radius: 12px;
    overflow: hidden;
}

body.layout-instagram .editor-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
}

/* Ajustar estado de grabación en layouts verticales */
body.layout-reels .recording-status,
body.layout-instagram .recording-status {
    position: fixed;
    bottom: 20px;
    right: 220px;
    left: auto;
    top: auto;
    transform: none;
    width: auto;
    border-radius: 8px;
    z-index: 1000;
    font-size: 12px;
    padding: 8px 16px;
}

body.layout-reels .recording-status span,
body.layout-instagram .recording-status span {
    font-size: 11px;
}

/* Para default y youtube, mantener arriba */
body.layout-default .recording-status,
body.layout-youtube .recording-status {
    position: relative;
    width: 100%;
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

/* Anillo de foco visible para navegación por teclado */
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.radio-label:has(input:focus-visible),
.side-radio-label:has(input:focus-visible) {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Respetar la preferencia de movimiento reducido del sistema */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
