/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f0f2f5; /* Light grey background */
    color: #333;
}

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

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #0d6efd; /* Blue accent */
}
.app-header h1 { color: #212529; margin-bottom: 5px; }
.app-header p { color: #6c757d; font-size: 1.1em; }

/* Cards */
.card {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}
.card h2, .card h3 { margin-top: 0; color: #0d6efd; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.card h3 { color: #1976D2; font-size: 1.2em; }
.card h4 { color: #333; margin-bottom: 5px; }
.card i { margin-right: 8px; color: #0d6efd; }
.card h3 i { color: #1976D2; }

/* Data Input Section */
.data-input-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; align-items: start; }
.input-area label.file-label { display: inline-block; padding: 10px 20px; background-color: #6c757d; color: white; border: none; border-radius: 4px; cursor: pointer; transition: background-color 0.3s ease; font-weight: 500; margin-bottom: 10px; }
.input-area label.file-label:hover { background-color: #5a6268; }
.input-area input[type="file"] { display: none; }
.file-name-display { margin-left: 15px; font-style: italic; color: #555; }
.format-hint { display: block; font-size: 0.85em; color: #6c757d; margin-top: 5px; }
.info-area { background-color: #e7f3fe; border-left: 4px solid #0d6efd; padding: 20px; border-radius: 5px; }
.info-area ul { padding-left: 20px; margin-top: 5px; margin-bottom: 10px; font-size: 0.95em; }
.info-area small { font-size: 0.85em; color: #444;}

/* Status Message */
.status-message { margin-top: 15px; padding: 10px; border-radius: 4px; font-weight: bold; text-align: center; }
.status-message:empty { display: none; }
.status-message.error { color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; }
.status-message.success { color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb; }
.status-message.info { color: #0c5460; background-color: #d1ecf1; border: 1px solid #bee5eb; }

/* Variable Selection */
.variable-selection-section .selector-container { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.variable-selector { display: flex; flex-direction: column; flex-grow: 1; }
.variable-selector label { margin-bottom: 5px; font-weight: 500; font-size: 0.9em; }
.variable-selector select { padding: 10px; border: 1px solid #ced4da; border-radius: 4px; min-width: 150px; }
#calculateButton { padding: 10px 20px; background-color: #0d6efd; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; font-weight: 500; transition: background-color 0.3s ease; }
#calculateButton:hover { background-color: #0b5ed7; }
#calculateButton:disabled { background-color: #adb5bd; cursor: not-allowed; }

/* Results Section */
.results-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 25px; align-items: start; }

/* Results Table */
#resultsTableCard .table-container { overflow-x: auto; margin-bottom: 15px; }
#resultsTableCard table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
#resultsTableCard th, #resultsTableCard td { border: 1px solid #dee2e6; padding: 10px 12px; text-align: left; vertical-align: middle; }
#resultsTableCard th { background-color: #f8f9fa; font-weight: 600; }
#resultsTableCard tbody tr:nth-child(even) { background-color: #fdfdfe; }
#resultsTableCard td:nth-child(2), /* Coefficient */
#resultsTableCard td:nth-child(3) { /* p-value */ text-align: right; font-family: monospace; }

/* Estilos para la celda de interpretación */
#resultsTableCard .interpretation-cell {
    font-weight: 500;
    font-size: 0.9em;
}
#resultsTableCard .interpretation-cell.significant {
    background-color: #d1e7dd;
    color: #0f5132;
}
#resultsTableCard .interpretation-cell.not-significant {
    background-color: #f8d7da;
    color: #842029;
}

#downloadCsvButton { display: inline-block; margin-top: 10px; padding: 8px 15px; background-color: #198754; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; transition: background-color 0.3s ease; }
#downloadCsvButton:hover { background-color: #157347; }

/* Scatter Plot */
.chart-title-control { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.chart-title-control label { font-weight: 500; white-space: nowrap;}
.chart-title-control input[type="text"] { flex-grow: 1; padding: 8px; border: 1px solid #ced4da; border-radius: 4px; }
#updateChartTitleButton { padding: 8px 10px; background: none; border: 1px solid #ced4da; border-radius: 4px; cursor: pointer; color: #6c757d; }
#updateChartTitleButton:hover { background-color: #e9ecef;}
.chart-container { position: relative; height: 400px; width: 100%; margin-bottom: 15px; border: 1px solid #eee; }
#scatterChart { max-width: 100%; max-height: 100%; }
.chart-export-buttons { display: flex; gap: 10px; justify-content: center; }
.chart-export-buttons button { padding: 8px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; transition: background-color 0.3s ease; color: white; }
#exportPdfButton { background-color: #dc3545; } #exportPdfButton:hover { background-color: #bb2d3b; }
#exportJpegButton { background-color: #ffc107; color: #333; } #exportJpegButton:hover { background-color: #e0a800; }

/* Info Section */
.info-section h2 { color: #212529; border: none; text-align: center; margin-bottom: 0;}
.info-section .subtitle { text-align: center; color: #6c757d; margin-top: 0; margin-bottom: 20px; font-size: 1.1em; }
.info-columns { display: grid; grid-template-columns: 1fr 1.5fr; gap: 25px; align-items: start; }
.info-col-general { background-color: #eef2f7; border-left: 4px solid #6c757d;}
.info-col-general h3 { color: #444; } .info-col-general ul { padding-left: 20px; margin-bottom: 20px; }
.info-col-specific { display: flex; flex-direction: column; gap: 15px; }
.method-card { padding: 15px; } .method-card p { margin-bottom: 5px;} .method-card small { color: #6c757d; font-size: 0.85em; }

/* Utility */
.hidden { display: none !important; }

/* Responsive Adjustments */
@media (max-width: 992px) { .results-section, .info-columns { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .data-input-section { grid-template-columns: 1fr; } .variable-selection-section .selector-container { flex-direction: column; align-items: stretch; } }