/* Dataset AI Analyzer Styles */
.dataset-analyzer-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.dataset-analyzer-container h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.2em;
    font-weight: 600;
}

.dataset-analyzer-container > p {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* Form Styles */
#dataset-analyzer-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
}

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

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

/* Select2 Customization */
.select2-container--default .select2-selection--single {
    height: 50px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px;
    padding-left: 15px;
    padding-right: 40px;
    color: #2c3e50;
    font-size: 16px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #7f8c8d;
    font-style: italic;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px;
    width: 30px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #7f8c8d transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    width: 0;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #7f8c8d transparent;
    border-width: 0 4px 5px 4px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.select2-dropdown {
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #3498db;
    color: white;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #f8f9fa;
    color: #2c3e50;
}

.select2-container--default .select2-results__option {
    padding: 10px 15px;
    font-size: 14px;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Hide original select */
#dataset-select {
    display: none;
}

#dataset-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#question {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
    line-height: 1.5;
}

#question:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#question.invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.analyze-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analyze-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.analyze-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading Styles */
.loading {
    text-align: center;
    padding: 40px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

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

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

.loading p {
    color: #7f8c8d;
    font-size: 1.1em;
    margin: 0;
}

/* Result Styles */
.result-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    border-left: 5px solid #27ae60;
}

.result-container h3 {
    color: #27ae60;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

#ai-response {
    line-height: 1.7;
    color: #2c3e50;
    font-size: 1.1em;
}

#ai-response h4 {
    color: #34495e;
    margin-top: 20px;
    margin-bottom: 10px;
}

#ai-response p {
    margin-bottom: 15px;
}

#ai-response pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9em;
    border: 1px solid #e9ecef;
}

#ai-response code {
    background: #f1f2f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Error Styles */
.error-container {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    color: #c53030;
}

.error-container p {
    margin: 0;
    font-weight: 500;
}

/* Dataset Info Styles */
.dataset-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid #e9ecef;
}

.dataset-description {
    color: #495057;
    margin-bottom: 15px;
    font-style: italic;
}

.dataset-links {
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.official-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.official-link:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    color: white;
    text-decoration: none;
}

.link-icon {
    margin-right: 6px;
    font-size: 1.1em;
}

.example-questions h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1em;
}

.example-questions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.example-questions li {
    padding: 5px 0;
    color: #6c757d;
    font-size: 0.9em;
    border-bottom: 1px solid #e9ecef;
}

.example-questions li:last-child {
    border-bottom: none;
}

/* Preguntas Seleccionables Mejoradas */
.clickable-question {
    cursor: pointer;
    padding: 10px 15px !important;
    margin: 6px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
    line-height: 1.4;
}

.clickable-question:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
    transform: translateX(8px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.clickable-question.selected {
    background-color: #2196f3;
    color: white;
    border-color: #1976d2;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.question-icon {
    font-size: 16px;
    opacity: 0.8;
    flex-shrink: 0;
}

.more-questions-btn {
    cursor: pointer;
    padding: 10px 15px;
    margin: 6px 0;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    text-align: center;
    color: #856404;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9em;
}

.more-questions-btn:hover {
    background: #ffeaa7;
    border-color: #fdcb6e;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(253, 203, 110, 0.3);
}

/* Modal de Preguntas */
.questions-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    color: #2c3e50;
    background: #e9ecef;
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-questions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-question {
    padding: 12px 18px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    font-size: 0.95em;
    line-height: 1.5;
}

.modal-question:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
    transform: translateX(8px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dataset-analyzer-container {
        padding: 15px;
    }
    
    .dataset-analyzer-container h2 {
        font-size: 1.8em;
    }
    
    #dataset-analyzer-form {
        padding: 20px;
    }
    
    .analyze-btn {
        font-size: 16px;
        padding: 12px 20px;
    }
    
    .result-container,
    .loading {
        padding: 20px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .clickable-question {
        padding: 8px 12px !important;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .dataset-analyzer-container {
        padding: 10px;
    }
    
    #dataset-analyzer-form {
        padding: 15px;
    }
    
    .form-group label {
        font-size: 1em;
    }
    
    #dataset-select,
    #question {
        font-size: 14px;
        padding: 10px;
    }
    
    .modal-content {
        width: 98%;
        margin: 10px;
    }
    
    .modal-header h3 {
        font-size: 1.1em;
    }
    
    .clickable-question {
        padding: 6px 10px !important;
        font-size: 0.85em;
    }
} 