/* DataPulse Studio - UI Components, Controls & Widget Styles */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--gradient-neon);
  color: #070913;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 242, 254, 0.4);
}

.btn-danger {
  background: rgba(255, 75, 114, 0.15);
  color: var(--accent-pink);
  border-color: rgba(255, 75, 114, 0.3);
}

.btn-danger:hover {
  background: var(--accent-pink);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 75, 114, 0.4);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

/* Metric / Stat Cards */
.stat-card {
  background: rgba(18, 26, 52, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 60px; height: 60px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  opacity: 0.12;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.stat-subtext {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  margin-top: 4px;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-value-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.form-select, .form-input {
  width: 100%;
  background: rgba(13, 18, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.6rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-select:focus, .form-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

/* Custom Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.8);
  transition: var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Table Styles */
.table-container {
  overflow-x: auto;
  max-height: 420px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.custom-table th {
  background: #0d1224;
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  color: var(--accent-cyan);
  font-family: var(--font-heading);
  font-weight: 600;
  border-bottom: 2px solid rgba(0, 242, 254, 0.2);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  white-space: nowrap;
}

.custom-table tbody tr:hover {
  background: rgba(0, 242, 254, 0.04);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-cyan { background: rgba(0, 242, 254, 0.15); color: var(--accent-cyan); }
.badge-purple { background: rgba(138, 43, 226, 0.15); color: #c084fc; }
.badge-emerald { background: rgba(0, 245, 160, 0.15); color: var(--accent-emerald); }
.badge-pink { background: rgba(255, 75, 114, 0.15); color: var(--accent-pink); }
.badge-amber { background: rgba(255, 183, 3, 0.15); color: var(--accent-amber); }

/* Correlation Matrix Grid */
.matrix-container {
  overflow-x: auto;
  padding: 1rem 0;
}

.matrix-grid {
  display: inline-grid;
  gap: 4px;
}

.matrix-cell {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  transition: var(--transition-fast);
  cursor: pointer;
}

.matrix-cell:hover {
  transform: scale(1.15);
  z-index: 5;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
}

/* Confusion Matrix Display */
.confusion-matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.cm-cell {
  background: rgba(13, 18, 36, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.cm-cell.highlight {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
}

.cm-val {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

.cm-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Dropzone Upload */
.upload-dropzone {
  border: 2px dashed rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 242, 254, 0.02);
  transition: var(--transition-smooth);
}

.upload-dropzone:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.06);
}

.upload-dropzone svg {
  width: 44px;
  height: 44px;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

/* Pulse Training Indicator */
.pulse-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 rgba(0, 245, 160, 0.7);
  animation: pulseAnim 1.5s infinite;
}

@keyframes pulseAnim {
  0% { box-shadow: 0 0 0 0 rgba(0, 245, 160, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(0, 245, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 245, 160, 0); }
}

/* Canvas Container */
.chart-box {
  position: relative;
  width: 100%;
  height: 320px;
}

.canvas-boundary {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-sm);
  background: #080c18;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
