/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin: 20px 0;
    color: #2c3e50;
    font-size: 2rem;
}

h2 {
    color: #3498db;
    margin: 10px 0;
    font-size: 1.4rem;
    padding-bottom: 5px;
    border-bottom: 2px solid #ecf0f1;
}

h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* Caja de instrucciones */
.instruction-box {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.instruction-box h3 {
    margin-top: 0;
    color: #3498db;
}

.instruction-box ul {
    margin-left: 20px;
}

/* Secciones del formulario */
.form-section {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Grupos de entrada */
.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.input-group input,
.input-group select,
.input-group textarea {
    flex: 1;
    min-width: 250px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

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

/* Contenedores dinámicos para educación y experiencia */
.dynamic-container {
    margin-bottom: 15px;
}

.dynamic-item {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr auto;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    align-items: start;
}

.education-item {
    grid-template-columns: 1fr 1fr 1fr auto;
}

.dynamic-item input,
.dynamic-item select,
.dynamic-item textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.dynamic-item textarea {
    grid-column: span 3;
    resize: vertical;
    min-height: 80px;
}

.course-hours-container {
    margin-top: 10px;
}

/* Botones */
button {
    cursor: pointer;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-add {
    background-color: #2ecc71;
    color: white;
    margin-bottom: 15px;
}

.btn-add:hover {
    background-color: #27ae60;
}

.btn-remove {
    background-color: #e74c3c;
    color: white;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.btn-remove:hover {
    background-color: #c0392b;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.btn-submit {
    background-color: #3498db;
    color: white;
    padding: 12px 25px;
    font-size: 1.1rem;
}

.btn-submit:hover {
    background-color: #2980b9;
}

.btn-save {
    background-color: #9b59b6;
    color: white;
    padding: 12px 25px;
    font-size: 1.1rem;
}

.btn-save:hover {
    background-color: #8e44ad;
}

.btn-secondary {
    background-color: #7f8c8d;
    color: white;
    padding: 12px 25px;
    font-size: 1.1rem;
}

.btn-secondary:hover {
    background-color: #95a5a6;
}

/* Indicador de carga */
.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

/* Sección de resultados */
.result-section {
    background-color: white;
    padding: 20px;
    margin-top: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

#result-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#result-content .result-section {
    display: block;
    box-shadow: none;
    padding: 15px;
    margin: 0;
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
}

#result-content .result-section h3 {
    color: #3498db;
    margin-bottom: 15px;
}

#result-content ul {
    margin-left: 20px;
}

/* Tabla de puntuaciones */
.scores-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.scores-table th,
.scores-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.scores-table th {
    background-color: #f5f7fa;
    font-weight: bold;
}

.scores-table .total-row {
    font-weight: bold;
    background-color: #e8f4f8;
}

/* Estilos para el dictamen */
.dictamen-apto {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.2em;
    padding: 10px;
    background-color: #eafaf1;
    border-radius: 4px;
    text-align: center;
}

.dictamen-condicional {
    color: #f39c12;
    font-weight: bold;
    font-size: 1.2em;
    padding: 10px;
    background-color: #fef9e7;
    border-radius: 4px;
    text-align: center;
}

.dictamen-no-apto {
    color: #c0392b;
    font-weight: bold;
    font-size: 1.2em;
    padding: 10px;
    background-color: #fadbd8;
    border-radius: 4px;
    text-align: center;
}

/* Proveedor de IA */
.provider-info {
    background-color: #f0f0f0;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

/* Mensajes de error y éxito */
.error-alert {
    display: none;
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid #dc3545;
    white-space: pre-line;
}

.error-section {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid #dc3545;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid #28a745;
    animation: fadeIn 0.5s ease;
    transition: opacity 0.5s ease;
}

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

/* Estilos para análisis guardados */
.saved-analyses {
    background-color: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.saved-analyses h3 {
    color: #3498db;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.analysis-list {
    list-style: none;
    padding: 0;
}

.analysis-item {
    background-color: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 3px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.3s ease;
}

.analysis-details {
    flex: 1;
}

.analysis-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.analysis-meta {
    font-size: 0.85rem;
    color: #7f8c8d;
}

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

.btn-view, 
.btn-delete {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-block;
}

.btn-view {
    background-color: #3498db;
    color: white;
}

.btn-view:hover {
    background-color: #2980b9;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* Campo de nota */
.field-note {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 5px;
}



/* Responsividad */
@media (max-width: 768px) {
    .dynamic-item {
        grid-template-columns: 1fr;
    }
    
    .dynamic-item textarea {
        grid-column: span 1;
    }
    
    .education-item {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit,
    .btn-save,
    .btn-secondary {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .analysis-item {
        flex-direction: column;
    }
    
    .analysis-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
    }
}

.advanced-options-section {
    margin-top: 20px;
}

.toggle-advanced-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.3s;
}

.toggle-advanced-btn:hover {
    background: #f5f5f5;
}

.weight-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

#weightValue {
    font-weight: bold;
    color: #333;
}

.explanation {
    font-size: 13px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
}

.explanation ul {
    padding-left: 20px;
}

.explanation ul ul {
    margin-top: 5px;
}

#loadingIndicator {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 20px 0;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-hint {
    margin-top: 15px;
    color: #666;
    text-align: center;
    font-style: italic;
}

#long-request-warning {
    margin-top: 15px;
    padding: 10px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}
 /* Estilo para contenedor de documento con botón de búsqueda */
 .documento-search-container {
    display: flex;
    width: 100%;
    gap: 10px;
}

.documento-search-container input {
    flex-grow: 1;
}

/* Estilos para el botón de búsqueda */
.btn-search {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-search:hover {
    background-color: #138496;
}

/* Mensaje de éxito */
.success-alert {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 5px solid #28a745;
}

/* Mejoras para el sistema de análisis de HV */

/* Estilo general mejorado */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Mejora de formulario */
.form-section {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.form-section h2 {
    color: #2c3e50;
    margin-top: 0;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    font-size: 1.3rem;
}

/* Mejoras para resultados */
.result-section {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.result-section h3 {
    color: #2c3e50;
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    font-size: 1.2rem;
}

/* Estilos específicos para dictamen */
.dictamen-apto {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.2rem;
    background-color: rgba(39, 174, 96, 0.1);
    padding: 10px 15px;
    border-radius: 5px;
    display: inline-block;
}

.dictamen-condicional {
    color: #f39c12;
    font-weight: bold;
    font-size: 1.2rem;
    background-color: rgba(243, 156, 18, 0.1);
    padding: 10px 15px;
    border-radius: 5px;
    display: inline-block;
}

.dictamen-no-apto {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.2rem;
    background-color: rgba(231, 76, 60, 0.1);
    padding: 10px 15px;
    border-radius: 5px;
    display: inline-block;
}

/* Estilos para la sección de requisitos */
.requisitos-section { 
    background-color: #f8f9fa; 
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.requisito-cumple { 
    color: #27ae60; 
    font-weight: bold; 
}

.requisito-nocumple { 
    color: #e74c3c; 
    font-weight: bold; 
}

/* Estilos para tabla de puntuaciones */
.puntuaciones-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.puntuaciones-table th, 
.puntuaciones-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

.puntuaciones-table th {
    background-color: #f5f5f5;
    color: #2c3e50;
}

.puntuaciones-table tr:hover {
    background-color: #f9f9f9;
}

.total-row {
    font-weight: bold;
    background-color: #eef5fa !important;
}

.total-row td {
    border-top: 2px solid #3498db;
}

/* Estilos para cálculo detallado expandible */
.expandable-header { 
    cursor: pointer; 
    background-color: #f0f0f0;
    padding: 12px;
    border-radius: 5px;
    transition: background-color 0.2s;
    user-select: none;
}

.expandable-header:hover { 
    background-color: #e0e0e0; 
}

.toggle-icon {
    float: right;
    font-weight: bold;
    font-size: 18px;
    color: #3498db;
}

.expandable-content {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 0 0 5px 5px;
    border: 1px solid #e0e0e0;
    border-top: none;
}

.expandable-content dl dt {
    font-weight: bold;
    margin-top: 12px;
    color: #2c3e50;
}

.expandable-content dl dd {
    margin-left: 20px;
    padding: 8px 0;
    line-height: 1.5;
}

/* Estilos para proveedor y timestamp */
.provider-info {
    background-color: #f8f9fa;
    padding: 8px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #555;
    border-left: 3px solid #3498db;
}

.timestamp {
    text-align: right;
    color: #777;
    margin-top: 20px;
    font-size: 0.85rem;
    font-style: italic;
}

/* Estilos para botones mejorados */
.btn-submit, .btn-save, .btn-add, .btn-search {
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-submit {
    background-color: #3498db;
    color: white;
}

.btn-submit:hover {
    background-color: #2980b9;
}

.btn-save {
    background-color: #2ecc71;
    color: white;
}

.btn-save:hover {
    background-color: #27ae60;
}

.btn-add {
    background-color: #f1c40f;
    color: #333;
}

.btn-add:hover {
    background-color: #f39c12;
}

.btn-search {
    background-color: #95a5a6;
    color: white;
}

.btn-search:hover {
    background-color: #7f8c8d;
}

/* Estilos para estados de carga */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #3498db;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Mejoras para mensajes de error/éxito */
.error-alert, .success-alert {
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 5px;
    font-weight: 500;
}

.error-alert {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success-alert {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Estilos para inputs */
input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Estilos para elementos dinámicos */
.dynamic-item {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    position: relative;
}

.btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e74c3c;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
}

.btn-remove:hover {
    background-color: #c0392b;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .form-section, .result-section {
        padding: 15px;
    }
    
    .puntuaciones-table th, 
    .puntuaciones-table td {
        padding: 8px;
    }
    
    .btn-submit, .btn-save, .btn-add, .btn-search {
        padding: 8px 12px;
    }
}

/* Estilos para las nuevas secciones de recomendaciones de gestión pública */
.gap-analysis-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-top: 20px;
    padding: 25px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.gap-analysis-section h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gap-analysis-section h4 {
    color: #f8f9fa;
    font-size: 1.2rem;
    margin: 20px 0 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border-left: 4px solid #ffd700;
}

.gap-analysis-section ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.gap-analysis-section li {
    background: rgba(255, 255, 255, 0.15);
    margin: 8px 0;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 3px solid #ffd700;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.gap-analysis-section li:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(5px);
}

.gap-analysis-section li::before {
    content: "✓";
    color: #ffd700;
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.1rem;
}

/* Estilos para secciones de recomendaciones específicas */
.result-section h3 {
    position: relative;
    padding-left: 30px;
}

.result-section h3[data-section="linea-tematica"]::before {
    content: "🎯";
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

.result-section h3[data-section="perfil-cargo"]::before {
    content: "💼";
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

.result-section h3[data-section="areas-especializacion"]::before {
    content: "🎓";
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* Indicadores visuales para diferentes tipos de recomendaciones */
.recomendacion-cargo {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.recomendacion-linea {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.recomendacion-especializacion {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.3);
}

/* Animaciones para las nuevas secciones */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.gap-analysis-section {
    animation: slideInUp 0.6s ease-out;
}

.recomendacion-cargo, .recomendacion-linea, .recomendacion-especializacion {
    animation: slideInUp 0.4s ease-out;
}