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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header h1 i {
    color: #4CAF50;
    margin-right: 15px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.upload-section {
    margin-bottom: 40px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: end;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1.1em;
}

label i {
    margin-right: 8px;
    color: #667eea;
}

input[type="text"], input[type="file"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

.file-info {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    display: none;
}

.file-info.show {
    display: block;
}

.file-help {
    margin-top: 8px;
}

.file-help small {
    color: #6c757d;
    font-style: italic;
}

.files-preview {
    margin-top: 15px;
}

.files-preview.show {
    display: block;
}

.file-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.file-preview-item:hover {
    background: #e9ecef;
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-preview-info i {
    color: #28a745;
    font-size: 1.2em;
}

.file-preview-details {
    display: flex;
    flex-direction: column;
}

.file-preview-name {
    font-weight: 600;
    color: #495057;
}

.file-preview-size {
    font-size: 0.9em;
    color: #6c757d;
}

.file-preview-table {
    font-size: 0.9em;
    color: #667eea;
    font-weight: 500;
}

.file-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.file-remove-btn:hover {
    background: #c82333;
}

.dataset-info {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 5px;
    padding: 15px;
    margin-top: 8px;
}

.dataset-info p {
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
}

.dataset-info small {
    color: #6c757d;
}

.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    justify-content: center;
    margin-top: 20px;
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    font-size: 14px;
    padding: 8px 15px;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #5a6268;
}

.datasets-list {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.datasets-list.hidden {
    display: none;
}

.datasets-list h3 {
    margin-bottom: 15px;
    color: #495057;
}

#datasetsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.dataset-item {
    background: white;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dataset-item:hover {
    background: #667eea;
    color: white;
}

.progress-section {
    margin: 30px 0;
    text-align: center;
}

.progress-section.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

#progressText {
    color: #6c757d;
    font-style: italic;
}

.result-section {
    margin: 30px 0;
}

.result-section.hidden {
    display: none;
}

.result-content {
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.result-content.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.result-content.error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.results-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 4px solid #667eea;
}

.results-summary p {
    margin: 5px 0;
}

.success-count {
    color: #28a745;
    font-weight: bold;
}

.error-count {
    color: #dc3545;
    font-weight: bold;
}

.success-section, .error-section {
    margin: 20px 0;
}

.success-section h4 {
    color: #28a745;
    margin-bottom: 15px;
}

.error-section h4 {
    color: #dc3545;
    margin-bottom: 15px;
}

.results-grid {
    display: grid;
    gap: 15px;
}

.result-item {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.result-item.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.result-item.error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.result-header i {
    font-size: 1.2em;
}

.result-details p {
    margin: 5px 0;
    font-size: 0.95em;
}

.result-details code {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.error-message {
    font-style: italic;
    font-weight: 500;
}

.info-section {
    margin-top: 50px;
}

.info-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #495057;
}

.info-section h2 i {
    color: #667eea;
    margin-right: 10px;
}

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

.info-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.info-card h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.info-card ul, .info-card ol {
    padding-left: 20px;
}

.info-card li {
    margin-bottom: 5px;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    padding: 20px 0;
}

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

.container > * {
    animation: fadeIn 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    main {
        padding: 25px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Estados de elementos ocultos */
.hidden {
    display: none !important;
}