/* === Component Styles === */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.25s ease, filter 0.25s ease;
  font-family: inherit;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.42), inset 0 1px 0 rgba(255,255,255,0.20);
}

.btn-primary:hover {
  filter: brightness(1.10) saturate(1.10);
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(168, 85, 247, 0.55), inset 0 1px 0 rgba(255,255,255,0.22);
}

.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-ghost {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04));
  transform: translateY(-1px);
}

/* Inputs */
.input, input[type="text"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  background: rgba(7, 4, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.25s ease;
  font-variant-numeric: tabular-nums;
}

.input::placeholder, input::placeholder, textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.input:focus, input:focus, select:focus, textarea:focus {
  border-color: rgba(168, 85, 247, 0.7);
  background: rgba(7, 4, 28, 0.75);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.20), 0 0 18px rgba(168, 85, 247, 0.20);
}

/* Number spinner hidden */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(168,85,247,.55), rgba(99,102,241,.35));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #c7d2fe);
  border: 2px solid rgba(168,85,247,.8);
  box-shadow: 0 4px 12px rgba(168,85,247,.45);
  cursor: pointer;
}

/* Select */
select.input {
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.7) 50%),
                    linear-gradient(135deg, rgba(255,255,255,0.7) 50%, transparent 50%);
  background-position: calc(14px) 50%, calc(8px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-left: 34px;
}

select.input option { background: #0b0b12; color: #fff; }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  font-size: 13px;
  font-weight: 600;
  color: rgba(244, 244, 255, 0.75);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  font-family: inherit;
}

.pill:hover {
  border-color: rgba(168, 85, 247, 0.45);
  color: #fff;
  transform: translateY(-1px);
}

.pill.active {
  background: var(--accent-gradient);
  border-color: rgba(255, 255, 255, 0.30);
  color: #fff;
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.45), inset 0 1px 0 rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

/* Badges */
.badge {
  font-size: 11px;
  padding: 6px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
}

@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0.3; } }
.blink { animation: blink 1.5s infinite; }

/* Mini buttons (table actions) */
.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}

.btn-mini:hover {
  background: linear-gradient(180deg, rgba(168,85,247,0.18), rgba(99,102,241,0.10));
  border-color: rgba(168,85,247,0.40);
  transform: translateY(-1px);
}

/* Progress bars */
.progress-track {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99,102,241,0.9), rgba(168,85,247,0.9));
  width: 0%;
  transition: width 0.3s ease;
}

/* Forecast strip */
.forecast-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  cursor: grab;
  padding-bottom: 8px;
}

.forecast-strip:active { cursor: grabbing; }
.forecast-strip > * { flex-shrink: 0; scroll-snap-align: start; }
.forecast-strip::-webkit-scrollbar { height: 8px; }
.forecast-strip::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
.forecast-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 999px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  z-index: 9999;
  padding: 12px 20px;
  background: var(--accent-gradient);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45), 0 0 24px rgba(168,85,247,0.4);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s var(--ease-bouncy);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
