/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --bg: #f8f9fa;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
}

.navbar h1 {
    font-size: 1.5rem;
    color: var(--dark);
    font-weight: 600;
}

.nav-info span {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon {
    font-size: 1.8rem;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    resize: vertical;
}

/* Upload Zone */
.upload-zone {
    border: 3px dashed #d0d0d0;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: #f0f8ff;
}

.upload-zone.drag-over {
    border-color: var(--success);
    background: #e8f8f5;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* File List */
.file-list {
    margin-top: 1.5rem;
}

.file-list h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

#fileItems {
    list-style: none;
}

#fileItems li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* Estilos para items editables de archivos */
.file-item-editable {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 1rem;
    align-items: center;
}

.file-order {
    display: flex;
    align-items: center;
}

.order-input {
    width: 50px;
    padding: 0.4rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    background: white;
}

.order-input:focus {
    outline: none;
    border-color: var(--primary);
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.name-input {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    background: white;
    width: 100%;
}

.name-input:focus {
    outline: none;
    border-color: var(--primary);
}

.file-original {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.file-name {
    font-weight: 500;
}

.file-size {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-large {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.2rem;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--light);
    border-radius: 15px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    color: var(--dark);
    font-weight: 500;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-detail {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Charts */
.chart-container {
    margin-bottom: 2rem;
}

.chart {
    width: 100%;
    min-height: 400px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.results-table th {
    background: var(--dark);
    color: white;
    font-weight: 600;
}

.results-table tr:hover {
    background: var(--light);
}

.quality-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.quality-excelente {
    background: #d4edda;
    color: #155724;
}

.quality-buena {
    background: #d1ecf1;
    color: #0c5460;
}

.quality-aceptable {
    background: #fff3cd;
    color: #856404;
}

.quality-pobre {
    background: #f8d7da;
    color: #721c24;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Evaluation Cards */
.evaluation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.evaluation-card {
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 3px solid;
    transition: transform 0.3s, box-shadow 0.3s;
}

.evaluation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.eval-optimo {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #27ae60;
    color: #155724;
}

.eval-aceptable {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    border-color: #f39c12;
    color: #856404;
}

.eval-fuera {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #e74c3c;
    color: #721c24;
}

.eval-na {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    border-color: #6c757d;
    color: #383d41;
}

.eval-emoji {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.eval-param {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.eval-status {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eval-description {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.info-item {
    padding: 0.75rem;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.info-card .card-title {
    color: white;
}

.info-card .info-item {
    background: rgba(255, 255, 255, 0.2);
    border-left-color: white;
    color: white;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
}

/* Punto Navigation */
.punto-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.punto-selector {
    text-align: center;
    flex-grow: 1;
}

.punto-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.punto-order-badge {
    background: linear-gradient(135deg, var(--primary), #3498db);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.punto-title {
    text-align: left;
}

.punto-title strong {
    font-size: 1.3rem;
    color: var(--dark);
    display: block;
}

.punto-filename {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

/* Parameters Grid */
.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.param-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.param-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.param-name {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.param-description {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.param-eval {
    margin-top: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Quality Summary */
.quality-summary {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.quality-badge-large {
    padding: 1.5rem 2rem;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    min-width: 200px;
}

.quality-details {
    flex-grow: 1;
}

.quality-details p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

/* Interpretation */
.interpretation {
    line-height: 1.8;
}

.interp-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
}

.interp-section h3 {
    margin: 0 0 0.75rem 0;
    color: var(--dark);
    font-size: 1.1rem;
}

.interp-section p {
    margin: 0.5rem 0;
}

/* Uniformidad Grid */
.uniformidad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.uniformidad-card {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-left-width: 5px;
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.3s;
}

.uniformidad-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.uniformidad-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.uniformidad-emoji {
    font-size: 1.5rem;
}

.uniformidad-cv {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.uniformidad-status {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table Improvements */
.file-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results-table tbody tr {
    transition: all 0.2s;
}

.results-table tbody tr:hover {
    background: #e8f4f8;
    transform: scale(1.01);
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .navbar h1 {
        font-size: 1.2rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .evaluation-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal de Editor de Niveles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--dark);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.btn-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Editor de Niveles */
.editor-niveles {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nivel-control {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.nivel-label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.nivel-display {
    text-align: center;
    margin-bottom: 1rem;
}

.nivel-valor {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.nivel-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.btn-ajuste {
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ajuste:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.btn-ajuste:active {
    transform: scale(0.95);
}

.info-ajuste {
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    text-align: center;
}

.info-ajuste small {
    color: #856404;
}

.preview-niveles {
    padding: 1.5rem;
    background: #e8f4f8;
    border-radius: 8px;
    border: 2px solid var(--primary);
}

.preview-niveles h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.preview-item {
    background: white;
    padding: 0.8rem;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.preview-label {
    display: block;
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.preview-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}
/* Selección de Parámetros */
.parameter-selection {
    display: grid;
    gap: 1.5rem;
}

.param-category {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.param-category h3 {
    color: var(--dark);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.checkbox-group {
    display: grid;
    gap: 0.8rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: rgba(52, 152, 219, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label span {
    font-size: 0.95rem;
    color: #2c3e50;
    user-select: none;
}

.param-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}
