* {
    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%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: fadeIn 0.6s ease-in-out;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e7ff;
}

header h1 {
    color: #4a3f5c;
    font-size: 2.2em;
    margin-bottom: 10px;
}

header h2 {
    color: #667eea;
    font-size: 1.2em;
    font-weight: 500;
}

.subtitle {
    color: #6b7280;
    margin-top: 10px;
    font-size: 1em;
}

.form-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.form-section h3 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.optional {
    font-size: 0.7em;
    color: #9ca3af;
    font-weight: normal;
}

.section-description {
    color: #6b7280;
    font-size: 0.95em;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.conditional {
    margin-top: 20px;
    padding: 20px;
    background: #f0f4ff;
    border-radius: 10px;
    border: 2px dashed #667eea;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

.hidden {
    display: none;
}

.error-message {
    color: #ef4444;
    font-size: 0.85em;
    margin-top: 5px;
    display: none;
}

.error-message.visible {
    display: block;
}

.rating-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rating-group input[type="range"] {
    flex: 1;
    accent-color: #667eea;
    height: 6px;
    border-radius: 3px;
}

#rating-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    min-width: 30px;
    text-align: center;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e7ff;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

#success-message {
    margin-top: 30px;
    padding: 30px;
    background: #ecfdf5;
    border-radius: 12px;
    border: 2px solid #10b981;
    text-align: center;
}

#success-message h3 {
    color: #065f46;
    margin-bottom: 10px;
}

#success-message p {
    color: #047857;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .form-section {
        padding: 15px;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .rating-group {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Agregar al final de styles.css */

/* ===== ESTILOS PARA RESULTADOS ===== */

.resultados-container {
    max-width: 1400px !important;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.header-top h1 {
    font-size: 2em;
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Estadísticas resumen */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-card i {
    font-size: 2.2em;
    color: #667eea;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #667eea20;
    border-radius: 10px;
}

.stat-card > div {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.8em;
    font-weight: bold;
    color: #1f2937;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85em;
    color: #6b7280;
}

/* Sección de gráficos */
.charts-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.charts-section h3 {
    color: #1f2937;
    margin-bottom: 25px;
    font-size: 1.5em;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.chart-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    transition: transform 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
}

.chart-card h4 {
    color: #374151;
    margin-bottom: 15px;
    font-size: 1em;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 250px;
    max-width: 100%;
}

.chart-full {
    grid-column: 1 / -1;
}

/* Satisfacción general */
.satisfaccion-container {
    padding: 20px;
    text-align: center;
}

.satisfaccion-promedio {
    font-size: 3.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 20px;
}

.satisfaccion-promedio .satisfaccion-label {
    font-size: 0.5em;
    color: #6b7280;
}

.satisfaccion-bar {
    width: 100%;
    height: 25px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.satisfaccion-progreso {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    transition: width 1s ease;
    position: relative;
}

.satisfaccion-progreso::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Sección de tabla */
.table-section {
    margin-top: 40px;
}

.table-section h3 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    overflow-x: auto;
}

/* Estilos para DataTables */
.dataTables_wrapper {
    font-size: 0.9em;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 12px;
    margin-left: 8px;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 12px;
}

.dataTables_wrapper .dt-buttons {
    margin-bottom: 15px;
}

.dataTables_wrapper .dt-buttons .btn {
    margin-right: 5px;
}

#resultadosTable {
    border-collapse: collapse;
    width: 100%;
}

#resultadosTable thead th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 12px 15px;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

#resultadosTable tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid #f3f4f6;
}

#resultadosTable tbody tr:hover {
    background: #f8fafc;
}

#resultadosTable .text-center {
    text-align: center;
}

/* Sin datos */
.sin-datos {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 1.1em;
}

/* Responsive para resultados */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        padding: 15px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.4em;
    }
    
    .satisfaccion-promedio {
        font-size: 2.5em;
    }
    
    .table-container {
        padding: 10px;
    }
    
    #resultadosTable {
        font-size: 0.85em;
    }
    
    #resultadosTable thead th,
    #resultadosTable tbody td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .header-actions .btn {
        width: 100%;
    }
}