/* visual_mode.css - Estilos específicos para el modo visual de Auris
   Diseñado para ser compatible con main.css */

.visual-mode-card {
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.visual-mode-header {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.visual-mode-header h2 {
    margin: 0;
    font-size: 20px;
}

.visual-mode-header p {
    margin: 5px 0 0;
    font-size: 14px;
    color: var(--gray-text);
}

/* Sección de documentos */
.document-section {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.document-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.document-buttons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.left-buttons {
    flex: 1;
    margin-right: 10px;
}

.right-buttons {
    width: 100px;
}

.btn-gray {
    width: 100%;
    padding: 8px;
    background-color: #e0e0e0;
    border: none;
    border-radius: 5px;
    text-align: left;
    font-size: 14px;
    color: #333;
}

.btn-orange {
    width: 100%;
    padding: 8px;
    background-color: var(--primary-orange);
    border: none;
    border-radius: 5px;
    color: var(--light-bg);
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

.btn-orange:hover {
    background-color: var(--secondary-orange);
}

/* Sección de lectura */
.reading-section {
    padding: 15px;
}

.reading-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.reading-content {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 14px;
}

.reading-content p {
    margin-bottom: 8px;
}

/* Controles de reproducción */
.playback-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin-top: 15px;
}

.playback-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 20px;
}

.play-btn {
    width: 45px;
    height: 45px;
    background-color: var(--dark-bg);
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.play-btn:hover {
    background-color: var(--primary-blue);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.play-btn:active {
    transform: scale(0.95);
}

/* Botón principal de play/pause más grande */
.play-btn.main-control {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    font-size: 18px;
    margin: 0 5px;
}

.play-btn.main-control:hover {
    background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
    transform: scale(1.08);
}

/* Botones secundarios más pequeños */
.play-btn.secondary-control {
    width: 40px;
    height: 40px;
    background-color: #6c757d;
    font-size: 14px;
}

.play-btn.secondary-control:hover {
    background-color: var(--primary-orange);
}

.playback-slider {
    flex: 1;
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    position: relative;
    margin-right: 15px;
}



.playback-info {
    margin-right: 15px;
    font-size: 14px;
}

.save-button {
    min-width: 120px;
}

.save-button .btn-orange {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

.save-button .btn-orange:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

/* Estilo específico para el botón modo visual en la barra lateral */
#btn-modo-visual.active {
    background-color: var(--primary-orange);
    color: var(--light-bg);
}

/* Media queries para mantener la coherencia con el diseño responsive */
@media (max-width: 768px) {
    .visual-mode-card {
        max-width: 100%;
    }
    
    .document-buttons {
        flex-direction: column;
    }
    
    .left-buttons {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .right-buttons {
        width: 100%;
    }
    
    .playback-controls {
        flex-wrap: wrap;
    }
    
    .playback-slider {
        width: 100%;
        margin: 15px 0;
    }
    
    .save-button {
        width: 100%;
        margin-top: 10px;
    }
}
/* === Estilos para maximizar el área de lectura === */
.reading-content {
    transition: all 0.3s ease;
}

.reading-content.maximized {
    position: fixed;
    top: 50px;
    left: 250px; /* ajuste si cambia el ancho del sidebar */
    right: 20px;
    bottom: 100px;
    z-index: 999;
    background-color: #fff;
    border: 2px solid var(--primary-orange);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    font-size: 18px !important;
    overflow-y: auto;
}
/* === Estilos para los botones de control === */
.control-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    gap: 10px; /* Espacio entre botones */
    flex-wrap: wrap; /* Para que se adapten en pantallas pequeñas */
}

.control-buttons button {
    flex: 1 1 calc(25% - 10px); /* 4 botones con espacio */
    min-width: 120px; /* Evita que sean demasiado pequeños */
    padding: 4px;
    background-color: var(--primary-orange);
    border: none;
    border-radius: 8px;
    color: var(--light-bg);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

.control-buttons button:hover {
    background-color: var(--secondary-orange);
}
/* === Overlay para modo maximizado === */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; /* Inicialmente oculto */
    z-index: 998;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: none;
}

.reading-content.maximized .close-button {
    display: block;
}
.reading-content.maximized {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 900px;
    padding: 20px;
    height: 100vh;
    z-index: 999;
    background-color: #fff;
    border: 2px solid var(--primary-orange);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    font-size: 18px !important;
    overflow-y: auto;
    /* Aseguramos que esté sobre otros elementos */
    margin: 0 auto;
}
.reading-content {
    position: relative;
}
/* Mejoras para la barra de progreso */
.playback-slider {
    flex: 1;
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    position: relative;
    margin: 0 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.playback-slider:hover {
    height: 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.playback-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%; /* Inicialmente en 0% */
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    border-radius: 4px;
    transition: width 0.1s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Indicador de posición en la barra */
.playback-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--primary-blue);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.playback-slider:hover .playback-fill::after {
    opacity: 1;
}

/* Mejoras para el control de velocidad */
.playback-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    padding: 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.playback-info label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-text);
    margin-bottom: 5px;
}

#speed-control {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

#speed-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#speed-control::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#speed-display {
    min-width: 40px;
    font-weight: bold;
    color: var(--primary-blue);
    font-size: 14px;
    text-align: center;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

/* Mejoras para el botón de play/pause */
.play-btn {
    width: 40px;
    height: 40px;
    background-color: var(--dark-bg);
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.play-btn:hover {
    background-color: var(--primary-orange);
    transform: scale(1.05);
}

.play-btn:active {
    transform: scale(0.95);
}

/* Responsivo */
@media (max-width: 768px) {
    .playback-controls {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .playback-buttons {
        order: 1;
        justify-content: center;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .playback-slider {
        order: 2;
        width: 100%;
        margin: 15px 0;
    }
    
    .playback-info {
        order: 3;
        flex-direction: row;
        justify-content: center;
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .save-button {
        order: 4;
        width: 100%;
    }
    
    .save-button .btn-orange {
        width: 100%;
    }
}
/* Estados del botón play/pause */
.play-btn.main-control.playing {
    background-color: #ef4444 !important; /* Rojo cuando está reproduciendo */
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.play-btn.main-control.paused {
    background-color: #f59e0b !important; /* Amarillo cuando está pausado */
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === ESTILOS PARA EL MODAL DE GUARDAR DOCUMENTO === */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    width: 90%;
    max-width: 500px;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-blue);
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 0;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.modal-body input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    outline: none;
}

.modal-body input[type="text"]:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 70, 181, 0.1);
}

.char-counter {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    text-align: right;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.modal-footer .btn-cancel {
    padding: 10px 20px;
    border: 2px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-footer .btn-cancel:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

.modal-footer .btn-save {
    padding: 10px 20px;
    border: none;
    background: var(--primary-blue);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-footer .btn-save:hover {
    background: var(--secondary-blue);
}

.modal-footer .btn-save:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Animaciones del modal */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn-cancel,
    .modal-footer .btn-save {
        width: 100%;
    }
}