@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&display=swap');
:root {
    --bg-dark: #1a1c20;
    --bg-light: #25282e;
    --bg-lighter: #31353d;
    --primary: #00aaff;
    --primary-light: #66d9ff;
    --secondary: #2d323b;
    --text-light: #f0f0f0;
    --text-dark: #a0a0a0;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --border-color: #444851;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --font-family: 'Poppins', sans-serif;
    --font-title: 'Orbitron', 'Poppins', sans-serif;
    /* Colores para el fondo degradado */
    --bg-radial-1: #23243a;
    --bg-radial-2: #1a1c20;
    --bg-radial-3: #2a2e4d;
    --bg-radial-4: #00334e;
    --bg-radial-5: #2e1a3a;
    --bg-radial-6: #1a2e2a;
}

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

html {
    scroll-behavior: smooth;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-family);
    /* Fondo degradado radial oscuro con toques de color */
    background: radial-gradient(ellipse at 60% 20%, var(--bg-radial-1) 0%, var(--bg-radial-2) 40%, var(--bg-radial-3) 60%, var(--bg-radial-4) 80%, var(--bg-radial-5) 95%, var(--bg-radial-6) 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-light);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1 0 auto;
}

h1,
h2,
h3 {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 1rem;
}

h1 {
    font-family: var(--font-title);
    font-size: 2.1rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}

h2 i,
h3 i {
    margin-right: 0.75rem;
    color: var(--primary-light);
}

h3 {
    font-size: 1.4rem;
    color: var(--primary-light);
}

.controls-section {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.input-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.input-group input[type="number"],
.input-group textarea {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
}

/* NUEVOS ESTILOS: Dropzone */
#csv-dropzone {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    background-color: var(--bg-dark);
}

#csv-dropzone.dragover {
    background-color: var(--bg-lighter);
    border-color: var(--primary);
}

#csv-dropzone p {
    margin: 0;
    color: var(--text-dark);
    pointer-events: none;
}

#csv-dropzone p i {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

#csv-file-input {
    display: none;
}

#file-name {
    margin-top: 1rem;
    font-style: italic;
    color: var(--primary-light);
}

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

.analyze-button-container {
    text-align: center;
    margin-top: 2rem;
}

.analyze-button {
    background: linear-gradient(90deg, var(--primary), #0077b3);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0, 170, 255, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.analyze-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 170, 255, 0.4);
}

.analyze-button i {
    margin-right: 0.5rem;
}

#dashboard {
    display: none;
    animation: fadeIn 0.8s ease-in-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--primary);
}

.card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.card h4 i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.card .value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-light);
}

.card .details {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.card .fail-rate {
    color: var(--danger-light);
    font-weight: 600;
}

.card .pass-rate {
    color: var(--success-light);
    font-weight: 600;
}

.diag-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.diag-card {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 5px solid var(--warning);
}

.diag-card ul {
    list-style: none;
    padding-left: 0;
}

.diag-card li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.diag-card li::before {
    content: '⚠️';
    position: absolute;
    left: 0;
    color: var(--warning);
}

.diag-card li strong {
    color: var(--primary-light);
    display: block;
}

#stats-messages p {
    margin: 0 0 0.5rem 0;
}

#stats-messages strong {
    color: var(--primary-light);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-container {
    position: relative;
    height: 700px;
    min-height: 400px;
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    padding-bottom: 70px; /* Adjusted for export button */
}

.export-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 20;
}

.export-btn:hover {
    background-color: var(--primary);
    color: white;
}

.table-container {
    background-color: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-controls input,
.filter-controls select {
    padding: 0.5rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
}

.table-wrapper {
    max-height: 600px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    position: sticky;
    top: 0;
    background-color: var(--bg-lighter);
    z-index: 10;
}

th,
td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

th {
    font-weight: 600;
    color: var(--primary-light);
}

tbody tr:nth-child(even) {
    background-color: var(--secondary);
}

tbody tr:hover {
    background-color: var(--bg-lighter);
}

tbody tr.highlighted {
    background-color: var(--primary) !important;
    color: white;
}

.status-cell {
    font-weight: 600;
    text-align: center;
    border-radius: 15px;
    padding: 0.3rem 0.6rem;
    display: inline-block;
    min-width: 80px;
    font-size: 0.9em;
}

.status-pass {
    color: #fff;
    background-color: rgba(40, 167, 69, 0.7);
}

.status-fail {
    color: #fff;
    background-color: rgba(220, 53, 69, 0.7);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-lighter);
}

@media (max-width: 900px) {

    .input-grid,
    .diag-grid {
        grid-template-columns: 1fr;
    }
}

.footer {
    background: var(--bg-lighter);
    color: var(--text-dark);
    text-align: center;
    padding: 1.2rem 0 1.2rem 0;
    font-size: 1rem;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--border-color);
    margin-top: 2.5rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    flex-shrink: 0;
    position: relative;
    bottom: 0;
    left: 0;
    width: 100%;
}

.footer p {
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}