@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --dark-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-light: 0 8px 32px rgba(102, 126, 234, 0.15);
  --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.1);
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --border-radius: 20px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 80%,
      rgba(120, 119, 198, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 119, 198, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 40%,
      rgba(120, 219, 255, 0.2) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: -1;
}

/* Header Styles */
.header {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  color: white;
  padding: 2rem 0;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1s ease-out;
}

.header p {
  font-size: 1.2rem;
  opacity: 0.9;
  font-weight: 400;
  animation: fadeInUp 1s ease-out 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#prediction-model-selector:focus {
  color: black;
}
#prediction-model-selector:focus option {
  border: 4px solid black;
}

/* Container Styles */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Card Styles */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  animation: slideInUp 0.8s ease-out;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-heavy);
  border-color: rgba(255, 255, 255, 0.3);
}

.card:hover::before {
  transform: scaleX(1);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h3 i {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Metric Styles */
.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.metric:hover {
  padding-left: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border-bottom: 1px solid transparent;
}

.metric:last-child {
  border-bottom: none;
}

.metric-label {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.metric-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Status Indicator Styles */
.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
  animation: pulse 2s infinite;
}

.status-online {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 0 20px rgba(79, 172, 254, 0.5);
}

.status-offline {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  box-shadow: 0 0 20px rgba(250, 112, 154, 0.5);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Upload Area Styles */
.upload-area {
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  padding: 3rem 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.upload-area::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  transition: var(--transition);
  transform: translate(-50%, -50%);
}

.upload-area:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

.upload-area:hover::before {
  width: 100%;
  height: 100%;
}

.upload-area.dragover {
  border-color: #4facfe;
  background: rgba(79, 172, 254, 0.1);
  transform: scale(1.05);
}

.upload-area p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  margin: 0;
}

.upload-area i {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

/* Button Styles */
.btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  margin: 0.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: var(--transition);
}

.btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.btn:hover::before {
  left: 100%;
}

.btn:disabled {
  background: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-danger {
  background: var(--secondary-gradient);
}

.btn-success {
  background: var(--success-gradient);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--primary-gradient);
}

/* Hyperparameter Controls */
.hyperparameter-controls {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
}

.preset-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  transition: var(--transition);
}

.preset-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(102, 126, 234, 0.6);
  transform: translateY(-1px);
}

.hyperparameter-group {
  margin-bottom: 1.5rem;
}

.hyperparameter-group:last-child {
  margin-bottom: 0;
}

.hyperparameter-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.hyperparameter-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.9rem;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.hyperparameter-input:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.8);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.hyperparameter-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.hyperparameter-help {
  display: block;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-style: italic;
}

/* Prediction Result Styles */
.prediction-result {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-top: 2rem;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.confidence-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 12px;
  border-radius: 20px;
  overflow: hidden;
  margin-top: 1rem;
  position: relative;
}

.confidence-fill {
  background: var(--success-gradient);
  height: 100%;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
  position: relative;
}

.confidence-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 350px;
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  padding: 1rem;
  backdrop-filter: blur(10px);
}

#model-version-selector:focus option {
  color: black;
}

/* Alert Styles */
.alert {
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  border: 1px solid;
  backdrop-filter: blur(10px);
  animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: rgba(79, 172, 254, 0.15);
  border-color: rgba(79, 172, 254, 0.3);
  color: #13538b;
}

.alert-error {
  background: rgba(250, 112, 154, 0.15);
  border-color: rgba(250, 112, 154, 0.3);
  color: #fa709a;
}

.alert-info {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
}

/* Loading Spinner */
.loading {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

/* File List Styles */
.file-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.file-item {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  border-radius: 10px;
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(10px);
}

.file-item:last-child {
  border-bottom: none;
}

/* Tab Styles */
.tab-container {
  margin-bottom: 3rem;
  animation: fadeInUp 1s ease-out 0.5s both;
}

.tabs {
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: 60px;
  padding: 0.5rem;
  border: 1px solid var(--glass-border);
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab {
  padding: 1rem 2rem;
  cursor: pointer;
  border-radius: 40px;
  transition: var(--transition);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
}

.tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

.tab:hover {
  color: white;
  transform: translateY(-2px);
}

.tab:hover::before {
  opacity: 0.3;
}

.tab.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-light);
  transform: translateY(-2px);
}

.tab-content {
  padding: 2rem 0;
}

/* Model Version Management Styles */
.version-badge {
  background: var(--primary-gradient);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.version-badge.latest {
  background: var(--success-gradient);
}

.version-badge.original {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.latest-indicator {
  background: var(--warning-gradient);
  color: white;
  padding: 0.1rem 0.3rem;
  border-radius: 0.3rem;
  font-size: 0.7rem;
  margin-left: 0.5rem;
}

.original-indicator {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.1rem 0.3rem;
  border-radius: 0.3rem;
  font-size: 0.7rem;
  margin-left: 0.5rem;
}

.latest-model {
  background: rgba(79, 172, 254, 0.1);
}

.original-model {
  background: rgba(102, 126, 234, 0.1);
}

.current-model-card {
  background: var(--glass-bg);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
}

.model-version {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.version-label {
  font-weight: 600;
  margin-right: 0.5rem;
}

.version-value {
  background: var(--primary-gradient);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
}

.latest-badge {
  background: var(--success-gradient);
  color: white;
  padding: 0.1rem 0.3rem;
  border-radius: 0.3rem;
  font-size: 0.7rem;
  margin-left: 0.5rem;
}

.model-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
}

.detail-label {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.detail-value {
  font-weight: 600;
  color: white;
}

.performance-metric {
  background: var(--success-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Metric cells in model versions table */
.metric-cell {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  padding: 1rem !important;
}

.metric-cell:hover {
  color: #4facfe;
  transition: color 0.3s ease;
}

.model-selector-container {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
}

.model-selector-container label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.model-selector-container select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.model-selector-help {
  display: block;
  margin-top: 0.3rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .container {
    padding: 2rem 1rem;
  }

  .tabs {
    flex-direction: column;
    border-radius: var(--border-radius);
  }

  .tab {
    text-align: center;
    border-radius: 10px;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-gradient);
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-gradient);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-heavy);
  transition: var(--transition);
  z-index: 1000;
}

.fab:hover {
  transform: scale(1.1) rotate(180deg);
  box-shadow: 0 25px 50px rgba(102, 126, 234, 0.3);
}

/* Dataset Visualization Styles */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-light);
}

.metric-card h4 {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recommendations-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.recommendations-section h4 {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recommendation-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.recommendation-item i {
  color: #4facfe;
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.text-success {
  color: #4facfe !important;
}

.text-error {
  color: #f5576c !important;
}

.text-warning {
  color: #fee140 !important;
}
