/* Variables globales */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #e74c3c;
    --background-color: #ecf0f1;
    --text-color: #2c3e50;
    --spacing-unit: clamp(0.5rem, 2vw, 1rem);
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: clamp(14px, 2vw, 16px);
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: var(--spacing-unit);
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

/* Main content */
main {
    max-width: min(95vw, 1200px);
    margin: 0 auto;
    padding: var(--spacing-unit);
}

/* Sección de creación */
#creacion-teatro.visible {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
}

@media (min-width: 768px) {
    #creacion-teatro.visible {
        flex-direction: row;
        justify-content: center;
    }
}

/* Imagen del teatro */
#maqueta-teatro {
    width: min(100%, 400px);
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Formulario */
#registro-creacion {
    background: white;
    padding: calc(var(--spacing-unit) * 2);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: min(100%, 400px);
}

#registro-creacion h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: var(--primary-color);
    text-align: center;
}

.form-group {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.form-group label {
    display: block;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.input {
    width: 100%;
    padding: calc(var(--spacing-unit) * 0.75);
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

#boton-creacion {
    width: 100%;
    padding: var(--spacing-unit);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    cursor: pointer;
    transition: background-color 0.3s;
}

#boton-creacion:hover {
    background-color: var(--secondary-color);
}

/* Teatro */
#mostrar-teatro {
    width: 100%;
}

.teatro-container {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
}

/* Filas de butacas */
.filaDiv {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 0.5);
    margin: calc(var(--spacing-unit) * 0.5) 0;
}

/* Contadores */
.estadisticas {
    margin-top: calc(var(--spacing-unit) * 2);
    padding: var(--spacing-unit);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.contador {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: var(--spacing-unit);
}

.contador-item {
    text-align: center;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

/* Utilidades */
.oculto {
    display: none;
}

/* Media queries adicionales */
@media (max-width: 480px) {
    :root {
        --spacing-unit: 0.5rem;
    }
    
    .filaDiv {
        gap: 0.25rem;
    }
}

@media (min-width: 1200px) {
    .teatro-container {
        flex-direction: row;
    }
    
    #patio, #palco {
        flex: 1;
    }
}