/* ============================================
   RESET Y VARIABLES GLOBALES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #2d5f3f;
    --secondary-green: #3d7a50;
    --light-green: #e8f5e9;
    --accent-blue: #2196f3;
    --accent-red: #e74c3c;
    --accent-orange: #f39c12;
    --accent-purple: #9b59b6;
    --accent-teal: #1abc9c;
    --text-dark: #2c3e50;
    --text-light: #666;
    --border-color: #ddd;
    --background: #f5f7fa;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background);
    min-height: 100vh;
}

/* ============================================
   HEADER MEJORADO
   ============================================ */
.header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: var(--white);
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 12px var(--shadow);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
}

.header-top {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo-container {
    flex-shrink: 0;
}

.university-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    padding: 8px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.header-info {
    flex: 1;
}

.header-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-title i {
    font-size: 1.5rem;
}

.header-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(10px);
}

/* ============================================
   INFO BANNER
   ============================================ */
.info-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.info-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-banner-content i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.grid-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 2rem;
}

/* ============================================
   PANELES MEJORADOS
   ============================================ */
.config-panel,
.results-panel {
    background: var(--white);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px var(--shadow);
    overflow: hidden;
}

.config-panel {
    position: sticky;
    top: 20px;
}

.panel-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.config-panel .form-group:first-of-type {
    margin-top: 1.5rem;
}

.config-panel > *:not(.panel-header) {
    padding: 0 1.5rem;
}

.config-panel > button {
    margin: 0 1.5rem 1.5rem 1.5rem;
    width: calc(100% - 3rem);
}

.results-panel > *:not(.panel-header) {
    padding: 1.5rem;
}

/* ============================================
   FORMULARIO MEJORADO
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.6rem;
}

.form-label i {
    color: var(--primary-green);
}

.tooltip-icon {
    margin-left: auto;
    cursor: help;
    color: var(--accent-blue);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-dark);
    background-color: var(--white);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
}

.form-range {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, var(--primary-green) 0%, var(--accent-blue) 100%);
    margin-bottom: 0.5rem;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.4rem;
    font-style: italic;
}

/* ============================================
   RADIO BUTTONS PERSONALIZADOS
   ============================================ */
.disease-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
}

.radio-option:hover {
    background-color: var(--light-green);
    border-color: var(--primary-green);
    transform: translateX(5px);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked ~ .radio-custom {
    border-color: var(--primary-green);
    background: var(--primary-green);
}

.radio-option input[type="radio"]:checked ~ .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.radio-option input[type="radio"]:checked ~ .radio-label {
    font-weight: 600;
    color: var(--primary-green);
}

.radio-label {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   BOTONES MEJORADOS
   ============================================ */
.btn-simulate {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1976d2 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-simulate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.btn-simulate:active {
    transform: translateY(0);
}

.btn-reset {
    width: 100%;
    padding: 0.75rem;
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-reset:hover {
    background: var(--background);
    border-color: var(--primary-green);
}

.btn-secondary {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--accent-teal) 0%, #16a085 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.3);
}

.btn-optimize {
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, var(--accent-purple) 0%, #8e44ad 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-optimize:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.btn-sensitivity {
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-sensitivity:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-export {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-export:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   MÉTRICAS MEJORADAS
   ============================================ */
.metrics-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--light-green) 0%, #f1f8f4 100%);
    border-radius: 10px;
    border-left: 5px solid var(--primary-green);
    box-shadow: 0 2px 6px var(--shadow);
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.metric-icon {
    font-size: 2rem;
    color: var(--primary-green);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow);
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.value-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.metric-description {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
}

/* ============================================
   TABS SYSTEM
   ============================================ */
.tabs-container {
    margin-top: 1.5rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.tab:hover {
    color: var(--primary-green);
    background: var(--light-green);
}

.tab.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ============================================
   GRÁFICOS
   ============================================ */
.chart-section {
    margin-bottom: 1.5rem;
}

.chart-header {
    margin-bottom: 1rem;
}

.chart-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.chart-legend-custom {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.legend-color {
    width: 20px;
    height: 12px;
    border-radius: 3px;
}

.chart-wrapper {
    background-color: var(--white);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 400px;
}

/* ============================================
   TABLA MEJORADA
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: var(--white);
}

.data-table th {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--secondary-green);
}

.data-table th i {
    margin-right: 0.4rem;
}

.data-table td {
    padding: 0.9rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: var(--light-green);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center;
    color: var(--text-light);
    padding: 2rem !important;
    font-style: italic;
}

.no-data i {
    margin-right: 0.5rem;
}

/* ============================================
   SECCIÓN EDUCATIVA
   ============================================ */
.educational-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.educational-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.edu-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-blue);
    box-shadow: 0 2px 4px var(--shadow);
}

.edu-card h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--primary-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.edu-card p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* ============================================
   FOOTER MEJORADO
   ============================================ */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: var(--white);
    margin-top: 3rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .grid-container {
        grid-template-columns: 350px 1fr;
    }
}

@media (max-width: 1024px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .config-panel {
        position: static;
    }

    .metrics-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
    }

    .header-badges {
        justify-content: center;
    }

    .metrics-container {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
    }

    .educational-content {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}