/**
 * Estilos - Planificador Docente PBA
 * Versión: 2.0.0
 * Diseño moderno, responsivo y accesible
 */

/* ========== Reset y Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    
    /* Colores de fondo */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --bg-info: #e7f3ff;
    
    /* Colores de texto */
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #6c757d;
    --text-white: #ffffff;
    
    /* Bordes */
    --border-color: #dee2e6;
    --border-radius: 8px;
    --border-radius-lg: 20px;
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.15);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.3);
    
    /* Espaciado */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 50px;
    
    /* Tipografía */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 22px;
    --font-size-xxl: 28px;
    
    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    padding: var(--spacing-md);
    line-height: 1.6;
    color: var(--text-primary);
}

/* ========== Container Principal ========== */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeIn var(--transition-slow);
}

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

/* ========== Header ========== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    padding: var(--spacing-lg);
    text-align: center;
}

.header h1 {
    font-size: var(--font-size-xxl);
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    opacity: 0.9;
    font-size: var(--font-size-base);
}

/* ========== Barra de Progreso ========== */
.progress-container {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
    cursor: default;
}

.progress-step::before {
    content: attr(data-step);
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-color);
    margin: 0 auto 10px;
    line-height: 40px;
    font-weight: 600;
    transition: all var(--transition-normal);
    color: var(--text-white);
}

.progress-step.active::before {
    background: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.progress-step.completed::before {
    background: var(--success-color);
    content: '✓';
}

.progress-step span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.progress-step.active span,
.progress-step.completed span {
    color: var(--text-primary);
    font-weight: 600;
}

/* ========== Contenido Principal ========== */
.content {
    padding: var(--spacing-lg);
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: slideIn var(--transition-slow);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: 24px;
    font-weight: 600;
}

/* ========== Formularios ========== */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

select, 
input[type="text"], 
input[type="number"], 
textarea {
    width: 100%;
    padding: var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all var(--transition-fast);
    background: var(--bg-white);
}

select:focus, 
input:focus, 
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select:hover,
input:hover,
textarea:hover {
    border-color: var(--primary-color);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

select[multiple] {
    padding: 8px;
}

select[multiple] option {
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 2px;
}

select[multiple] option:hover {
    background: var(--bg-info);
}

/* ========== Botones ========== */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: var(--spacing-lg);
}

button {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
}

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

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

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========== Loading ========== */
#loading {
    display: none;
    text-align: center;
    padding: var(--spacing-xl);
    animation: fadeIn var(--transition-normal);
}

#loading.show {
    display: block;
}

.spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#loading p {
    margin: 10px 0;
    color: var(--text-primary);
}

#loading p:first-of-type {
    font-weight: 600;
    font-size: var(--font-size-lg);
}

#loading p:last-of-type {
    color: var(--text-muted);
    font-size: var(--font-size-base);
}

/* ========== Resultados ========== */
#resultado {
    display: none;
    animation: fadeIn var(--transition-slow);
}

#resultado.show {
    display: block;
}

.planificacion {
    background: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: 12px;
    margin-bottom: var(--spacing-lg);
    border: 2px solid var(--border-color);
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.planificacion:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.planificacion h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    padding: 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
    font-size: 22px;
    font-weight: 700;
}

.seccion {
    margin-bottom: var(--spacing-md);
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 3px solid #e0e0e0;
    transition: all var(--transition-fast);
}

.seccion:hover {
    border-left-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.03);
}

.seccion h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.seccion p, 
.seccion ul {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 15px;
}

.seccion ul {
    padding-left: 25px;
    margin-top: 10px;
}

.seccion li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 5px;
}

.seccion li strong {
    color: var(--primary-color);
    font-weight: 600;
}

.info-box {
    background: linear-gradient(135deg, var(--bg-info) 0%, #f0f7ff 100%);
    border-left: 5px solid var(--primary-color);
    padding: 18px;
    margin-bottom: var(--spacing-md);
    border-radius: 8px;
    font-size: var(--font-size-base);
    line-height: 1.8;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.1);
}

.info-box strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* ========== Resumen ========== */
.summary {
    background: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: 10px;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.summary h3 {
    margin-bottom: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.summary-value {
    color: var(--primary-color);
    font-weight: 600;
    text-align: right;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    .header {
        padding: var(--spacing-md);
    }

    .header h1 {
        font-size: var(--font-size-xl);
    }

    .content {
        padding: var(--spacing-md);
    }

    .button-group {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .progress-bar::before {
        display: none;
    }

    .progress-step span {
        font-size: 10px;
    }

    .progress-step::before {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 13px;
    }

    .summary-item {
        flex-direction: column;
        gap: 5px;
    }

    .summary-value {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }

    .header p {
        font-size: 13px;
    }

    .step h2 {
        font-size: 20px;
    }

    .planificacion {
        padding: 15px;
    }

    .planificacion h3 {
        font-size: 18px;
    }
}

/* ========== Accesibilidad ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para navegación por teclado */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========== Impresión ========== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
    }

    .header,
    .progress-container,
    .button-group,
    #loading {
        display: none !important;
    }

    .planificacion {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .step {
        display: block !important;
    }
}

/* ========== Utilidades ========== */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
