/* === Body & Container === */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f0f2f5 0%, #e1e5ea 100%);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  width: 95%;
  margin: 40px auto;
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  position: relative;
}

/* === Navigation Tabs === */
.nav-tabs {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 2px solid #e9ecef;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px 12px 0 0;
  padding: 10px 20px 0;
}

.nav-tab {
  padding: 15px 30px;
  margin-right: 10px;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 600;
  color: #495057;
  transition: all 0.3s ease;
  position: relative;
  bottom: -2px;
}

.nav-tab:hover {
  background: #007bff;
  color: #fff;
  transform: translateY(-2px);
}

.nav-tab.active {
  background: #007bff;
  color: #fff;
  border-bottom: 2px solid #007bff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Heading === */
h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
  font-weight: 700;
  position: relative;
  padding-bottom: 20px;
  font-size: 2.2em;
}

h2:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(to right, #007bff, #0056b3);
  border-radius: 4px;
}

/* === Form Elements === */
form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
  font-size: 1.1em;
}

form input,
form textarea,
form select {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 2px solid #e9ecef;
  font-size: 16px;
  transition: all 0.3s;
  background: #f8f9fa;
}

form input:focus,
form textarea:focus,
form select:focus {
  border-color: #007bff;
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  transform: translateY(-2px);
}

/* === Small Text === */
small {
  color: #6c757d;
  /* display: block; */
  margin-top: -15px;
  margin-bottom: 15px;
  font-size: 0.9em;
}

/* === Function Input Areas === */
.function-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.function-panel {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #e9ecef;
}

.function-panel h3 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
  font-size: 1.3em;
}

/* === Buttons === */
.button-group {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 30px;
}

button {
  padding: 15px 30px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  font-weight: 600;
  letter-spacing: 0.5px;
  min-width: 140px;
}

button#processBtn,
button#analyzeFunctionsBtn,
button#analyzeMultiFunctionsBtn {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
}

button#processBtn:hover,
button#analyzeFunctionsBtn:hover,
button#analyzeMultiFunctionsBtn:hover {
  background: linear-gradient(135deg, #0056b3, #004085);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 123, 255, 0.4);
}

button#processBtn:active,
button#analyzeFunctionsBtn:active,
button#analyzeMultiFunctionsBtn:active {
  transform: translateY(-1px);
}

button#resetBtn,
button#resetFunctionBtn,
button#resetMultiFunctionBtn {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: #fff;
  box-shadow: 0 6px 15px rgba(108, 117, 125, 0.3);
}

button#resetBtn:hover,
button#resetFunctionBtn:hover,
button#resetMultiFunctionBtn:hover {
  background: linear-gradient(135deg, #495057, #343a40);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(108, 117, 125, 0.4);
}

button#exportAllDataBtn {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
  box-shadow: 0 6px 15px rgba(40, 167, 69, 0.3);
}

button#exportAllDataBtn:hover {
  background: linear-gradient(135deg, #218838, #1e7e34);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

/* Copy Button */
.copy-btn {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
}

.copy-btn:hover {
  background: linear-gradient(135deg, #495057, #343a40);
  transform: translateY(-2px);
}

.copy-btn.copied {
  background: linear-gradient(135deg, #28a745, #20c997);
}

/* === Results Sections === */
.results-section {
  margin-top: 40px;
  padding: 25px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px;
  border: 2px solid #e9ecef;
  position: relative;
}

.results-section h3 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 2px solid #28a745;
  padding-bottom: 10px;
  font-size: 1.4em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-actions {
  display: flex;
  gap: 10px;
}

.section-copy-btn {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.section-copy-btn:hover {
  background: linear-gradient(135deg, #138496, #117a8b);
  transform: translateY(-2px);
}

.approximation-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.approximation-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #007bff;
  position: relative;
}

.approximation-card.success {
  border-left-color: #28a745;
}

.approximation-card.error {
  border-left-color: #dc3545;
}

.approximation-card h4 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 1.1em;
}

.function-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.comparison-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #ff6b6b;
}

/* === Charts Container === */
#chartContainer,
#functionCharts,
#functionComparison,
#multiFunctionCharts,
#multiFunctionComparison {
  margin-top: 40px;
  width: 100%;
}

#chartContainer h4,
#functionCharts h4,
#functionComparison h4,
#multiFunctionCharts h4,
#multiFunctionComparison h4 {
  text-align: center;
  margin-top: 50px;
  font-weight: 700;
  color: #2c3e50;
  font-size: 1.4em;
  padding-bottom: 10px;
  border-bottom: 2px solid #e9ecef;
}

canvas {
  display: block;
  width: 100% !important;
  height: 450px !important;
  margin: 20px auto;
  border-radius: 12px;
  background: #fafafa;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
}

#chartExplanation,
#functionAnalysis {
  margin-top: 30px;
  font-size: 16px;
  color: #555;
  line-height: 1.7;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 20px 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  width: 100%;
  box-sizing: border-box;
  border-left: 5px solid #007bff;
}

/* === Enhanced Loading Overlay === */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.8));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  padding: 50px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.spinner {
  width: 80px;
  height: 80px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: #007bff;
  animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
  margin-bottom: 25px;
}

.loading-text {
  color: white;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 15px;
}

.loading-subtext {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-align: center;
  max-width: 300px;
  line-height: 1.5;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* === Input Container Transitions === */
.input-container {
  transition: all 0.4s ease;
  overflow: hidden;
}

/* === Success Message === */
.success-message {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
  padding: 18px 20px;
  border-radius: 10px;
  margin-top: 20px;
  display: none;
  border-left: 5px solid #28a745;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

/* === Error Message === */
.error-message {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  color: #721c24;
  padding: 18px 20px;
  border-radius: 10px;
  margin-top: 20px;
  display: none;
  border-left: 5px solid #dc3545;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
}

/* === Data Preview === */
.data-preview {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 2px dashed #dee2e6;
  display: none;
}

.data-preview h4 {
  margin-top: 0;
  color: #495057;
}

.data-preview pre {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  max-height: 200px;
  overflow-y: auto;
}

/* === Function Results === */
.function-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.stat-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-top: 4px solid #007bff;
}

.stat-value {
  font-size: 1.8em;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 5px;
}

.stat-label {
  color: #666;
  font-size: 0.9em;
}

/* === Button Loading Spinner === */
.btn-loading .loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: button-spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes button-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Multi-Function Analysis Styles */
.analysis-options {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  border: 2px solid #e9ecef;
}

.analysis-options h4 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.options-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.options-grid label:hover {
  background: #e3f2fd;
  transform: translateY(-2px);
}

.options-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.comparison-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.comparison-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 15px 0;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

.stat-item .stat-label {
  font-weight: 600;
  color: #495057;
}

.stat-item .stat-value {
  font-weight: bold;
  color: #007bff;
}

/* Enhanced chart styles */
.chart-wrapper {
  position: relative;
  height: 400px;
  margin: 20px 0;
}

.chart-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  border-left: 4px solid #007bff;
}

.chart-card h4 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 10px;
}

/* Enhanced Multi-Function Analysis Styles */
.approximations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  margin-top: 20px;
}

.function-approximations {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-left: 5px solid #007bff;
  overflow: hidden;
}

.function-approximations h4 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 12px;
  font-size: 1.3em;
  word-wrap: break-word;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.approximation-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.approximation-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #007bff;
  overflow: hidden;
  word-wrap: break-word;
  height: fit-content;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.approximation-card.best-fit {
  border-left: 4px solid #28a745;
  background: linear-gradient(135deg, #f8fff8, #e8f5e8);
  grid-column: 1 / -1;
}

.approximation-card h5 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 1.1em;
  font-weight: 600;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 8px;
  word-wrap: break-word;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.approximation-card p {
  margin: 8px 0;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.approximation-card strong {
  color: #495057;
  font-weight: 600;
}

.approximation-card.excellent {
  border-left: 4px solid #28a745;
}

.approximation-card.good {
  border-left: 4px solid #007bff;
}

.approximation-card.moderate {
  border-left: 4px solid #ffc107;
}

.approximation-card.poor {
  border-left: 4px solid #dc3545;
}

.approximation-card.error {
  border-left: 4px solid #6c757d;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.quality-excellent {
  color: #28a745;
  font-weight: bold;
  background: rgba(40, 167, 69, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.quality-good {
  color: #007bff;
  font-weight: bold;
  background: rgba(0, 123, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.quality-moderate {
  color: #ffc107;
  font-weight: bold;
  background: rgba(255, 193, 7, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.quality-poor {
  color: #dc3545;
  font-weight: bold;
  background: rgba(220, 53, 69, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Equation styling */
.equation-container {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid #6c757d;
  margin: 10px 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  word-break: break-all;
  overflow-wrap: break-word;
}

.coefficients-container {
  background: #e3f2fd;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.85em;
  margin: 8px 0;
  max-height: 80px;
  overflow-y: auto;
}

/* Scrollable content for long equations */
.scrollable-content {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 5px;
}

.scrollable-content::-webkit-scrollbar {
  width: 6px;
}

.scrollable-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.scrollable-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Responsive design */
@media (max-width: 768px) {
  .approximation-methods {
    grid-template-columns: 1fr;
  }

  .function-approximations {
    padding: 15px;
  }

  .approximation-card {
    padding: 15px;
  }

  .equation-container {
    font-size: 0.85em;
    padding: 10px;
  }
}

/* Badge for best fit */
.best-fit-badge {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: bold;
  display: inline-block;
  margin-left: 10px;
}

/* Compact layout for coefficients */
.compact-coefficients {
  font-family: 'Courier New', monospace;
  font-size: 0.8em;
  background: #f8f9fa;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #e9ecef;
  margin: 5px 0;
  max-height: 60px;
  overflow-y: auto;
}

/* Card header actions */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.card-title {
  margin: 0;
  color: #2c3e50;
  font-size: 1.1em;
}

.card-actions {
  display: flex;
  gap: 8px;
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #28a745;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  transform: translateX(150%);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

.toast.error {
  background: #dc3545;
}

.toast.info {
  background: #17a2b8;
}

/* Add these styles to your existing CSS */

/* Polynomial and Fourier Options */
.polynomial-options,
.fourier-options {
  margin-top: 20px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border: 2px solid #e9ecef;
}

.polynomial-options h4,
.fourier-options h4 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 2px solid #007bff;
  padding-bottom: 8px;
  font-size: 1.2em;
}

.degree-inputs,
.terms-input {
  margin-top: 10px;
}

.degree-inputs label,
.terms-input label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
}

.degree-inputs input,
.terms-input input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s;
}

.degree-inputs input:focus,
.terms-input input:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.degree-inputs small,
.terms-input small {
  color: #6c757d;
  font-size: 0.85em;
  margin-top: 5px;
  display: block;
}

/* Enhanced approximation cards */
.approximation-card .degree-badge {
  background: linear-gradient(135deg, #6f42c1, #e83e8c);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: bold;
  margin-left: 8px;
}

.approximation-card .terms-badge {
  background: linear-gradient(135deg, #20c997, #17a2b8);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: bold;
  margin-left: 8px;
}

/* Machine Learning Tab Styles */
.ml-section {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.ml-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  border-bottom: 2px solid #3498db;
  padding-bottom: 8px;
}

.ml-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.ml-option {
  display: flex;
  flex-direction: column;
}

.ml-option label {
  font-weight: 600;
  margin-bottom: 5px;
  color: #495057;
}

.ml-option input[type="range"] {
  width: 100%;
  margin: 8px 0;
}

.ml-action-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-right: 10px;
}

.ml-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ml-action-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Hyperparameter Options */
.hyperparameter-options {
  background: #e8f4fd;
  border: 1px solid #b8daff;
  border-radius: 6px;
  padding: 15px;
  margin: 15px 0;
}

.hyperparameter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.param-group {
  display: flex;
  flex-direction: column;
}

.param-group label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #495057;
}

/* Preview and Results */
.ml-preview, .ml-results {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  margin: 15px 0;
  max-height: 300px;
  overflow-y: auto;
}

.ml-preview h4, .ml-results h4 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.ml-preview pre {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Export Buttons */
.export-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.export-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.export-btn:hover {
  background: #218838;
  transform: translateY(-1px);
}

.export-btn:nth-child(2) {
  background: #17a2b8;
}

.export-btn:nth-child(2):hover {
  background: #138496;
}

.export-btn:nth-child(3) {
  background: #ffc107;
  color: #212529;
}

.export-btn:nth-child(3):hover {
  background: #e0a800;
}

/* Visualization Container */
.ml-visualization {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

/* Results Cards */
.result-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin: 10px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-card h5 {
  color: #2c3e50;
  margin-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 5px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.metric-item {
  text-align: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
}

.metric-value {
  font-size: 18px;
  font-weight: bold;
  color: #3498db;
}

.metric-label {
  font-size: 12px;
  color: #6c757d;
  margin-top: 5px;
}

/* Charts */
.ml-chart-container {
  position: relative;
  height: 300px;
  margin: 20px 0;
}

/* Loading States */
.ml-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #6c757d;
}

.ml-loading .loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ml-options-grid {
    grid-template-columns: 1fr;
  }
  
  .hyperparameter-grid {
    grid-template-columns: 1fr;
  }
  
  .export-buttons {
    flex-direction: column;
  }
  
  .ml-action-btn {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* Animation for results */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ml-preview, .ml-results, .result-card {
  animation: fadeIn 0.3s ease-in-out;
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-ready {
  background: #28a745;
}

.status-processing {
  background: #ffc107;
}

.status-error {
  background: #dc3545;
}

/* Tooltip for ML options */
.ml-tooltip {
  position: relative;
  display: inline-block;
  margin-left: 5px;
  cursor: help;
}

.ml-tooltip .tooltip-text {
  visibility: hidden;
  width: 200px;
  background: #333;
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
}

.ml-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Data Visualization Tab Styles */
#data-visualization .container-fluid {
  padding: 0;
  margin: 0;
}

#data-visualization .row {
  margin: 0;
  gap: 0;
}

#data-visualization .col-md-4,
#data-visualization .col-md-8 {
  padding: 20px;
}

/* Control Panel */
.control-panel {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  height: fit-content;
  position: sticky;
  top: 20px;
}

.control-panel h3 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 2px solid #007bff;
  padding-bottom: 12px;
  font-size: 1.4em;
  text-align: center;
}

/* Form Sections */
.form-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #dee2e6;
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.form-section h4 {
  color: #495057;
  font-size: 1.1em;
  margin-bottom: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.form-section h4::before {
  content: counter(section-counter);
  counter-increment: section-counter;
  background: #007bff;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  margin-right: 10px;
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
  font-size: 0.95em;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #fff;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  transform: translateY(-1px);
}

.form-control[readonly] {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

/* Input Sections */
.input-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  margin-top: 15px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 100px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

/* File Input */
input[type="file"].form-control {
  padding: 10px;
  background: #f8f9fa;
}

/* Small Text */
.form-text {
  color: #6c757d;
  font-size: 0.85em;
  margin-top: 5px;
  display: block;
}

/* Button Group */
.button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 25px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0056b3, #004085);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 123, 255, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #495057, #343a40);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(108, 117, 125, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #218838, #1e7e34);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(40, 167, 69, 0.4);
}

.btn-outline-primary,
.btn-outline-secondary {
  background: transparent;
  border: 2px solid;
  padding: 8px 16px;
  font-size: 12px;
}

.btn-outline-primary {
  border-color: #007bff;
  color: #007bff;
}

.btn-outline-primary:hover {
  background: #007bff;
  color: white;
}

.btn-outline-secondary {
  border-color: #6c757d;
  color: #6c757d;
}

.btn-outline-secondary:hover {
  background: #6c757d;
  color: white;
}

/* Button Loading State */
.btn-loading {
  display: none;
}

.btn-loading .loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: button-spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes button-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Alert Messages */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-top: 20px;
  border-left: 4px solid;
  display: none;
}

.alert-success {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
  border-left-color: #28a745;
}

.alert-danger {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  color: #721c24;
  border-left-color: #dc3545;
}

.alert-info {
  background: linear-gradient(135deg, #d1ecf1, #bee5eb);
  color: #0c5460;
  border-left-color: #17a2b8;
}

.alert-warning {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: #856404;
  border-left-color: #ffc107;
}

/* Visualization Area */
.visualization-area {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 2px solid #e9ecef;
  min-height: 600px;
}

/* Data Preview Section */
.data-preview-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  margin-bottom: 25px;
}

.data-preview-section h4 {
  color: #2c3e50;
  margin-bottom: 15px;
  border-bottom: 2px solid #007bff;
  padding-bottom: 8px;
  font-size: 1.2em;
}

.preview-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Preview Table */
#previewTable {
  background: white;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  max-height: 200px;
  overflow: auto;
}

#previewTable table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

#previewTable th,
#previewTable td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

#previewTable th {
  background: #e9ecef;
  font-weight: 600;
  color: #495057;
}

#previewTable tr:hover {
  background: #f8f9fa;
}

/* Data Stats */
.data-stats {
  background: white;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f8f9fa;
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-label {
  font-weight: 600;
  color: #495057;
  font-size: 0.9em;
}

.stat-value {
  font-weight: bold;
  color: #007bff;
  font-size: 0.9em;
}

/* Visualization Tabs */
.viz-tabs {
  margin-top: 20px;
}

.nav-tabs {
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 20px;
}

.nav-item {
  margin-bottom: -2px;
}

.nav-link {
  padding: 12px 24px;
  border: none;
  border-bottom: 2px solid transparent;
  color: #6c757d;
  font-weight: 600;
  transition: all 0.3s ease;
  background: transparent;
}

.nav-link:hover {
  color: #007bff;
  border-bottom-color: #007bff;
}

.nav-link.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background: transparent;
}

.tab-content {
  padding: 0;
}

.tab-pane {
  animation: fadeIn 0.5s ease;
}

/* Chart Containers */
.chart-container,
.plot-container {
  background: #fafafa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 20px;
  position: relative;
}

#2dChartCanvas,
#distributionChart {
  width: 100% !important;
  height: 400px !important;
  display: block;
}

/* 3D Plot Container */
#3dPlot {
  width: 100%;
  height: 500px;
  background: #fafafa;
  border-radius: 6px;
}

.plot-controls {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: center;
}

/* Explanation Section */
.explanation {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #007bff;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #495057;
}

/* Analysis Results */
.analysis-results h5 {
  color: #2c3e50;
  margin: 20px 0 15px 0;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 8px;
  font-size: 1.1em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card .value {
  font-size: 1.8em;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 5px;
}

.stat-card .label {
  color: #6c757d;
  font-size: 0.9em;
}

/* Data Table */
.data-table-container {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: auto;
  max-height: 300px;
}

.data-table-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table-container th,
.data-table-container td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.data-table-container th {
  background: #e9ecef;
  font-weight: 600;
  color: #495057;
  position: sticky;
  top: 0;
}

.data-table-container tr:hover {
  background: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
  #data-visualization .col-md-4,
  #data-visualization .col-md-8 {
    padding: 15px;
  }
  
  .control-panel {
    position: static;
    margin-bottom: 20px;
  }
  
  .preview-content {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .btn {
    min-width: auto;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  #2dChartCanvas,
  #distributionChart {
    height: 300px !important;
  }
  
  #3dPlot {
    height: 400px;
  }
}

@media (max-width: 480px) {
  .control-panel,
  .visualization-area {
    padding: 15px;
  }
  
  .form-section h4 {
    font-size: 1em;
  }
  
  .nav-link {
    padding: 10px 15px;
    font-size: 0.9em;
  }
  
  #2dChartCanvas,
  #distributionChart {
    height: 250px !important;
  }
  
  #3dPlot {
    height: 350px;
  }
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Counter reset for section numbers */
#visualizationForm {
  counter-reset: section-counter;
}

/* Custom scrollbar */
.preview-content::-webkit-scrollbar,
.data-table-container::-webkit-scrollbar,
#previewTable::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.preview-content::-webkit-scrollbar-track,
.data-table-container::-webkit-scrollbar-track,
#previewTable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb,
.data-table-container::-webkit-scrollbar-thumb,
#previewTable::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb:hover,
.data-table-container::-webkit-scrollbar-thumb:hover,
#previewTable::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Visualization Specific Styles */
.chart-container {
  position: relative;
  height: 400px;
  margin: 20px 0;
  background: white;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  padding: 15px;
}

.plot-container {
  height: 500px;
  background: white;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  margin: 20px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.stat-card {
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.data-preview-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid #007bff;
}

.control-panel {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.visualization-area {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plot-controls {
  margin-top: 15px;
  text-align: center;
}

.btn-loading {
  display: none;
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chart-container {
      height: 300px;
  }
  
  .plot-container {
      height: 400px;
  }
  
  .stats-grid {
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      gap: 10px;
  }
}

/* Tab styles */
.nav-tabs .nav-link {
  border: none;
  border-radius: 8px 8px 0 0;
  margin-right: 5px;
  padding: 12px 20px;
  font-weight: 600;
  color: #6c757d;
  transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
  background: #007bff;
  color: white;
  border: none;
}

.nav-tabs .nav-link:hover {
  border: none;
  background: #e9ecef;
}

.tab-content {
  background: white;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 20px;
}

/* Custom Tab System */
.custom-tab-nav {
  display: flex;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 8px 8px 0 0;
  padding: 10px 10px 0;
  border-bottom: 2px solid #dee2e6;
}

.custom-tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 5px;
  border-radius: 4px 4px 0 0;
}

.custom-tab-btn:hover {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
}

.custom-tab-btn.active {
  background: #007bff;
  color: white;
  border-bottom-color: #007bff;
}

.custom-tab-content {
  background: white;
  border-radius: 0 0 8px 8px;
  min-height: 500px;
}

.custom-tab-pane {
  display: none;
  padding: 20px;
  animation: fadeIn 0.5s ease;
}

.custom-tab-pane.active {
  display: block;
}

/* Chart Download Buttons */
.chart-download-buttons {
  margin-top: 20px;
  text-align: center;
}

.chart-download-buttons .btn {
  margin: 0 5px;
}

/* Plot Controls */
.plot-controls {
  margin-top: 15px;
  text-align: center;
}

.plot-controls .btn {
  margin: 0 5px;
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.stat-card {
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Data Table */
.data-table-container {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: auto;
  max-height: 300px;
  margin-top: 15px;
}

.data-table-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table-container th,
.data-table-container td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.data-table-container th {
  background: #e9ecef;
  font-weight: 600;
  color: #495057;
  position: sticky;
  top: 0;
}

.data-table-container tr:hover {
  background: #f8f9fa;
}

/* Alert close button */
.alert {
  position: relative;
  padding: 15px 40px 15px 20px;
}

.close-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}

.close-btn:hover {
  opacity: 1;
}

/* Alert close button */
.alert {
  position: relative;
  padding: 15px 40px 15px 20px;
}

.close-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}

.close-btn:hover {
  opacity: 1;
}

/* File Type Display */
.file-type-display {
  display: none;
  padding: 8px 12px;
  background: #e8f4fd;
  border: 1px solid #b8daff;
  border-radius: 4px;
  margin-top: 8px;
  font-size: 14px;
  color: #004085;
}

.file-type-display.active {
  display: block;
}

/* Data Preview Section */
.data-preview-section {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.data-preview-section.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.stat-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 1px solid #e9ecef;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Table */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  background-color: transparent;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid #dee2e6;
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid #dee2e6;
  background: #f8f9fa;
  font-weight: 600;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.075);
}

/* === Welcome Message === */
.welcome-message {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.welcome-message h3 {
  margin: 0;
  font-size: 1.5em;
  font-weight: 600;
}

.welcome-message p {
  margin: 10px 0 0 0;
  opacity: 0.9;
  font-size: 1.1em;
}

/* === User Info Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
  text-align: center;
  margin-bottom: 25px;
  position: relative;
}

.modal-header h3 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.modal-header p {
  color: #6c757d;
}

.user-info-table {
  width: 100%;
  border-collapse: collapse;
}

.user-info-table td {
  padding: 10px 5px;
  vertical-align: top;
}

.user-info-table label {
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
  padding-right: 15px;
}

.user-info-table input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s;
}

.user-info-table input:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-actions {
  text-align: center;
  margin-top: 25px;
}

.submit-btn {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.submit-btn:hover {
  background: linear-gradient(135deg, #0056b3, #004085);
  transform: translateY(-2px);
}

.modal-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  color: #6c757d;
  font-size: 0.9em;
}

/* === All Users Section === */
.user-info-display {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 25px;
  margin-top: 40px;
  border: 2px solid #e9ecef;
}

.user-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #007bff;
  padding-bottom: 15px;
}

.user-info-header h4 {
  margin: 0;
  color: #2c3e50;
}

.refresh-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.refresh-btn:hover {
  background: #495057;
}

.tracking-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 25px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tracking-table th {
  background: #e9ecef;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
}

.tracking-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #f8f9fa;
}

.tracking-table .table-section-header {
  background: #007bff;
  color: white;
  text-align: center;
  font-size: 1.1em;
}

.tracking-table .no-data {
  text-align: center;
  color: #6c757d;
  font-style: italic;
}

/* === User Usage Modal Styles === */
.usage-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.usage-stat {
  text-align: center;
  padding: 15px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
  display: block;
  font-size: 0.9em;
  color: #6c757d;
  margin-bottom: 5px;
  font-weight: 600;
}

.stat-value {
  display: block;
  font-size: 1.2em;
  color: #007bff;
  font-weight: bold;
}

.tab-usage-section {
  margin-bottom: 25px;
}

.tab-usage-section h4 {
  color: #2c3e50;
  border-bottom: 2px solid #007bff;
  padding-bottom: 8px;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.usage-table th {
  background: #e9ecef;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
}

.usage-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #f8f9fa;
}

.usage-table tr:hover {
  background: #f8f9fa;
}

/* === Close Modal Button === */
.close-modal-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6c757d;
  padding: 5px;
  border-radius: 4px;
}

.close-modal-btn:hover {
  background: #f8f9fa;
  color: #495057;
}

/* === View Usage Button === */
.view-usage-btn {
  background: #17a2b8;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s;
}

.view-usage-btn:hover {
  background: #138496;
  transform: translateY(-1px);
}

/* === Responsive Design === */
@media (max-width: 768px) {
  .container {
    padding: 20px;
    margin: 20px auto;
    width: 90%;
  }
  
  .header-with-menu {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mobile-menu-btn {
    display: block;
    align-self: flex-end;
    margin-bottom: 15px;
  }
  
  .nav-menu:not(.mobile-open) {
    display: none;
  }
  
  .nav-tabs {
    flex-direction: column;
    padding: 0;
    border-radius: 8px;
  }
  
  .nav-tab {
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
  }
  
  .nav-tab:last-child {
    border-bottom: none;
  }
  
  .user-info-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .user-info-table {
    display: block;
  }
  
  .user-info-table tr {
    display: block;
    margin-bottom: 15px;
  }
  
  .user-info-table td {
    display: block;
    padding: 5px 0;
  }
  
  .modal-content {
    padding: 20px;
  }
  
  .usage-summary {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    margin: 10px;
    width: calc(100% - 20px);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px;
    margin: 10px auto;
  }
  
  h2 {
    font-size: 1.5em;
    text-align: center;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  button {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* Need to add these styles */
.sheet-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 15px 0; }
.data-preview { margin: 15px 0; }
.table-container { max-height: 400px; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { border: 1px solid #ddd; padding: 8px; text-align: left; }
.data-table th { background-color: #f5f5f5; }
.text-samples { margin: 15px 0; }
.samples-container { display: flex; flex-wrap: wrap; gap: 5px; }
.text-sample { background: #f0f0f0; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
