/**
 * Base styles and resets
 */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
}

html {
  /* Prevent iOS/Android rubber-band white flash */
  overscroll-behavior: none;
  background: #06101c;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  overscroll-behavior: none;
  background: radial-gradient(
      1100px 760px at 10% -5%,
      rgba(92, 167, 255, 0.2),
      transparent 44%
    ),
    radial-gradient(900px 680px at 105% 8%, rgba(55, 192, 242, 0.16), transparent 42%),
    radial-gradient(900px 700px at 50% 115%, rgba(74, 222, 128, 0.07), transparent 34%),
    linear-gradient(180deg, #06101c 0%, #0b1321 100%);
  background-attachment: fixed;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

::selection {
  background: rgba(92, 167, 255, 0.35);
}

.hidden {
  display: none !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.26);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

/* Loading state */
.loading-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  gap: 10px;
}

/* Empty state */
.empty {
  padding: 52px 18px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  font-size: 44px;
  margin-bottom: 14px;
  opacity: 0.8;
}

.empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 13px;
  color: var(--muted);
  max-width: 320px;
  margin: 0 auto;
}

/* ===========================
   Mobile / Touch baseline
   =========================== */

/* Prevent iOS form zoom */
@media (max-width: 480px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Touch-friendly tap targets */
button,
.btn,
[role="button"],
.tab,
.card,
.source-row {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Smooth scrolling in lists */
.list-container,
.sources-list {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
