/* ============================================
   RESET Y VARIABLES
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --dark-light: #374151;
    --light: #f9fafb;
    --light-dark: #e5e7eb;
    --text: #111827;
    --text-light: #6b7280;
    
    --border-radius: 0.5rem;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: calc(var(--border-radius) * 2);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* ============================================
   SECTIONS
   ============================================ */

section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--light-dark);
}

section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    border-bottom: 3px solid var(--primary-light);
    padding-bottom: 1rem;
}

section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

/* ============================================
   INFO SECTION
   ============================================ */

.info-section .benefits-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-section li {
    padding: 1rem;
    background: var(--light);
    border-left: 4px solid var(--primary);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.info-section li:hover {
    background: var(--primary-light);
    transform: translateX(4px);
}

.info-section strong {
    color: var(--primary);
}

/* ============================================
   FORM STYLES
   ============================================ */

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 0.95rem;
}

.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light-dark);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group small {
    display: block;
    margin-top: 0.4rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Checkboxes Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--border-radius);
    margin: 0.5rem 0;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label {
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ============================================
   BOTÓN CALCULAR
   ============================================ */

.btn-calculate {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* ============================================
   RESULTS SECTION
   ============================================ */

.results-section {
    animation: slideInUp 0.4s ease-out;
}

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

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: linear-gradient(135deg, var(--light) 0%, #fafafa 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--light-dark);
    text-align: center;
    transition: var(--transition);
}

.result-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.result-card.highlight {
    background: linear-gradient(135deg, var(--primary-light) 0%, #dbeafe 100%);
    border-color: var(--primary);
}

.result-card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}

/* ============================================
   OPTIMIZATION POTENTIAL
   ============================================ */

.optimization-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--success) 0%, #10b981 50%, #059669 100%);
    border-radius: var(--border-radius);
    color: white;
}

.optimization-section h3 {
    color: white;
    margin-bottom: 1.5rem;
}

.potential-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.potential-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    backdrop-filter: blur(10px);
}

.potential-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.potential-label {
    font-size: 0.85rem;
    opacity: 0.95;
}

/* ============================================
   TABLA DE RESULTADOS
   ============================================ */

.breakdown-section {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 2px solid var(--light-dark);
    border-bottom: 2px solid var(--light-dark);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.results-table thead {
    background: var(--light);
}

.results-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.results-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light-dark);
}

.results-table tbody tr:hover {
    background: var(--primary-light);
}

.results-table td:first-child {
    font-weight: 600;
    color: var(--dark);
}

/* ============================================
   BOTTLENECK ANALYSIS
   ============================================ */

.bottleneck-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--light);
    border-radius: var(--border-radius);
}

.bottleneck-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bottleneck-item {
    padding: 1.5rem;
    border-left: 4px solid;
    border-radius: var(--border-radius);
    background: white;
}

.bottleneck-item.severity-high {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.bottleneck-item.severity-medium {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.bottleneck-item.severity-low {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.bottleneck-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.bottleneck-item.severity-high .severity-badge {
    background: var(--danger);
    color: white;
}

.bottleneck-item.severity-medium .severity-badge {
    background: var(--warning);
    color: white;
}

.bottleneck-item.severity-low .severity-badge {
    background: var(--success);
    color: white;
}

.bottleneck-header h4 {
    margin: 0;
    color: var(--dark);
}

.bottleneck-description {
    margin: 0.5rem 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.bottleneck-solution {
    margin: 0;
    color: var(--dark);
    font-size: 0.95rem;
}

/* ============================================
   STRATEGY SECTION
   ============================================ */

.strategy-section {
    margin: 2rem 0;
}

.strategy-priority {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.priority-card {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.priority-card.p1 {
    background: rgba(239, 68, 68, 0.05);
    border-left-color: var(--danger);
}

.priority-card.p2 {
    background: rgba(245, 158, 11, 0.05);
    border-left-color: var(--warning);
}

.priority-card.p3 {
    background: rgba(59, 130, 246, 0.05);
    border-left-color: var(--primary);
}

.priority-label {
    display: block;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-card.p1 .priority-label {
    color: var(--danger);
}

.priority-card.p2 .priority-label {
    color: var(--warning);
}

.priority-card.p3 .priority-label {
    color: var(--primary);
}

.strategy-list {
    list-style: none;
}

.strategy-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    color: var(--text);
}

.strategy-list li:last-child {
    border-bottom: none;
}

.strategy-list strong {
    color: var(--dark);
}

/* ============================================
   RECURSOS Y TOOLS
   ============================================ */

.resources-section,
.tools-section {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(219, 234, 254, 0.5) 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary);
    margin: 2rem 0;
}

.resources-list,
.tools-list {
    list-style: none;
}

.resources-list li,
.tools-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(37, 99, 235, 0.2);
    font-size: 0.95rem;
}

.resources-list li:last-child,
.tools-list li:last-child {
    border-bottom: none;
}

.resources-list strong,
.tools-list strong {
    color: var(--primary);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    border-top: 2px solid var(--light-dark);
    margin-top: 3rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        padding: 2rem 1rem;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    .header .subtitle {
        font-size: 1rem;
    }

    section {
        padding: 1.5rem 1rem;
    }

    section h2 {
        font-size: 1.5rem;
    }

    .results-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .results-table {
        font-size: 0.85rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.75rem;
    }

    .strategy-priority {
        grid-template-columns: 1fr;
    }

    .potential-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .header .subtitle {
        font-size: 0.9rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .result-value {
        font-size: 2rem;
    }

    section h2 {
        font-size: 1.25rem;
    }

    .bottleneck-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .potential-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   OPTIMIZACIONES PARA CORE WEB VITALS
   ============================================ */

img, input, select {
    max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

@media print {
    body {
        background: white;
    }

    .header {
        background: var(--primary);
        color: white;
        page-break-after: avoid;
    }

    section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }

    .btn-calculate {
        display: none;
    }
}
