/* Reset y estilos base */
* {
    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%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.contenedor {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(to right, #2c3e50, #4a6491);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitulo {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Layout principal */
.panel-contenedor {
    display: flex;
    min-height: 800px;
}

/* Panel izquierdo - Formulario */
.panel-izquierdo {
    flex: 0 0 45%;
    background: #f8f9fa;
    padding: 40px;
    border-right: 1px solid #e0e0e0;
}

.formulario-contenedor h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-control-pequeno {
    padding: 8px 12px;
    width: auto;
}

/* Botones */
.botones-contenedor {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 40px 0 25px;
}

.btn {
    padding: 16px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-actualizar {
    background: #3498db;
    color: white;
}

.btn-actualizar:hover {
    background: #2980b9;
}

.btn-descargar {
    background: #27ae60;
    color: white;
}

.btn-descargar:hover {
    background: #219653;
}

.btn-copiar {
    background: #9b59b6;
    color: white;
}

.btn-copiar:hover {
    background: #8e44ad;
}

.btn-guardar {
    background: #e67e22;
    color: white;
}

.btn-guardar:hover {
    background: #d35400;
}

.btn-pequeno {
    padding: 10px 15px;
    font-size: 14px;
    margin-top: 10px;
}

.btn-icon {
    padding: 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: #3498db;
}

/* Notas */
.notas {
    background: #e8f4fc;
    border-left: 4px solid #3498db;
    padding: 15px;
    border-radius: 5px;
    margin-top: 30px;
}

.notas p {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #2c3e50;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* Panel derecho - Vista previa */
.panel-derecho {
    flex: 0 0 55%;
    padding: 40px;
    background: white;
}

.vista-previa-contenedor h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Controles calidad */
.controles-calidad {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.resolucion {
    margin-left: auto;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Canvas contenedor */
.canvas-contenedor {
    position: relative;
    margin-bottom: 30px;
}

.preview-wrapper {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#previewCanvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Loading */
.loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 1.1rem;
    color: #2c3e50;
    z-index: 10;
}

/* Acciones preview */
.acciones-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.zoom-text {
    margin-left: auto;
    font-weight: 600;
    color: #2c3e50;
}

/* Estado generación */
.estado-generacion {
    margin: 25px 0;
}

.mensaje-exito, .mensaje-error, .mensaje-info {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mensaje-exito {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensaje-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mensaje-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.tamano-archivo {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Código HTML */
.codigo-html {
    margin-top: 40px;
}

.codigo-html h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.codigo-textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    background: #f8f9fa;
    resize: vertical;
    margin-bottom: 10px;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 25px 40px;
    text-align: center;
    border-top: 1px solid #34495e;
}

footer p {
    margin-bottom: 10px;
}

.tecnologias {
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

/* Responsive */
@media (max-width: 1200px) {
    .panel-contenedor {
        flex-direction: column;
    }
    
    .panel-izquierdo,
    .panel-derecho {
        flex: none;
        width: 100%;
    }
    
    .panel-izquierdo {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .panel-izquierdo,
    .panel-derecho {
        padding: 20px;
    }
    
    .botones-contenedor {
        grid-template-columns: 1fr;
    }
    
    .formulario-contenedor h2,
    .vista-previa-contenedor h2 {
        font-size: 1.3rem;
    }
    
    .tecnologias {
        flex-direction: column;
        gap: 5px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-izquierdo, .panel-derecho {
    animation: fadeIn 0.5s ease-out;
}

/* Scroll personalizado */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}