/* Reset y Estilos Generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    height: calc(100vh - 40px);
}

/* Paneles */
.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* Panel Izquierdo */
.stats {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95rem;
    color: #555;
}

.lista-correos {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.mensaje-vacio {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
}

.correo-item {
    background: #f8f9fa;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.2s;
}

.correo-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

/* Panel Derecho */
.panel-derecho {
    overflow-y: auto;
}

.seccion-config,
.seccion-editor {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.seccion-config h3 {
    color: #667eea;
    font-size: 1.1rem;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
}

.form-group small a {
    color: #667eea;
    text-decoration: none;
}

.form-group small a:hover {
    text-decoration: underline;
}

/* Editor de Texto */
.toolbar {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 10px;
    display: flex;
    gap: 5px;
}

.tool-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.editor-content {
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 0 0 6px 6px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.editor-content:focus {
    outline: none;
    border-color: #667eea;
}

.editor-content:empty:before {
    content: attr(data-placeholder);
    color: #999;
}

/* Lista de Adjuntos */
.lista-adjuntos {
    margin-top: 10px;
}

.adjunto-item {
    background: #f8f9fa;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.adjunto-item button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.adjunto-item button:hover {
    background: #c82333;
}

/* Botones */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-save {
    background: #17a2b8;
    color: white;
    font-size: 0.85rem;
    padding: 8px 16px;
}

.btn-save:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Barra de Progreso */
.progreso-container {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.progreso-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #555;
}

.barra-progreso {
    width: 100%;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.barra-progreso-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 12px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    margin: 5% auto;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.close,
.close-alerta {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.close:hover,
.close-alerta:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 30px;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    background: #f8f9fa;
    border-color: #5568d3;
}

.upload-area.dragover {
    background: #e7e9fc;
    border-color: #5568d3;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.archivo-seleccionado {
    margin-top: 20px;
    text-align: center;
}

.archivo-seleccionado p {
    margin-bottom: 15px;
    color: #28a745;
}

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

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .panel-izquierdo {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        gap: 10px;
    }
    
    .panel-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-buttons {
        width: 100%;
        justify-content: center;
    }
}