/* ═══════════════════════════════════════════════════════════════
   Resync.club — Warranty Check System
   Premium Dark UI
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1a1a25;
  --bg-input: #1e1e2a;
  --bg-input-focus: #22222e;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(99, 102, 241, 0.4);

  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.08);
  --success-border: rgba(16, 185, 129, 0.2);

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.08);
  --danger-border: rgba(239, 68, 68, 0.2);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.08);
  --warning-border: rgba(245, 158, 11, 0.2);

  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.08);
  --info-border: rgba(59, 130, 246, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  
  /* Hide scrollbar for IE, Edge and Firefox */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
body::-webkit-scrollbar {
  display: none;
}

/* ─── Background Effects ───────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout ───────────────────────────────────────────────────── */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  min-height: 100vh;
}

/* ─── Header ───────────────────────────────────────────────────── */
.app-header {
  text-align: center;
  margin-bottom: 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-name span {
  color: var(--accent-light);
}

.app-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
}

/* ─── Search Card ──────────────────────────────────────────────── */
.search-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  transition: border-color 0.3s ease;
}

.search-card:focus-within {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.input-group {
  display: flex;
  gap: 12px;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
  transition: color 0.3s ease;
}

.key-input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  outline: none;
  transition: all 0.3s ease;
}

.key-input::placeholder {
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

.key-input:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-accent);
}

.key-input:focus ~ .input-icon {
  color: var(--accent-light);
}

.btn-check {
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-check::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-check:hover::before {
  opacity: 1;
}

.btn-check:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-check:active {
  transform: translateY(0);
}

.btn-check:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-check.loading {
  pointer-events: none;
}

.btn-check.loading .btn-text {
  opacity: 0;
}

.btn-check .spinner {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.btn-check.loading .spinner {
  display: flex;
}

.spinner-dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  margin: 0 3px;
  animation: spinnerBounce 1.2s infinite ease-in-out;
}

.spinner-dot:nth-child(2) { animation-delay: 0.1s; }
.spinner-dot:nth-child(3) { animation-delay: 0.2s; }

@keyframes spinnerBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── Results Container ────────────────────────────────────────── */
.results-container {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
  animation: slideUp 0.5s ease;
}

.results-container.visible {
  display: grid;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Step Progress ────────────────────────────────────────────── */
.steps-tracker {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.step-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step-item .step-icon {
  font-size: 0.85rem;
}

.step-item.active {
  background: var(--bg-card);
  color: var(--accent-light);
}

.step-item.done {
  color: var(--success);
}

.step-item.failed {
  color: var(--danger);
}

/* ─── Result Cards ─────────────────────────────────────────────── */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  animation: fadeInCard 0.4s ease forwards;
  opacity: 0;
  height: 100%;
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInCard {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
}

.card-title .icon {
  font-size: 1.1rem;
}

/* ─── Status Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

/* ─── Info Rows ────────────────────────────────────────────────── */
.info-grid {
  display: grid;
  gap: 10px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.info-label {
  color: var(--text-secondary);
  font-weight: 400;
}

.info-value {
  color: var(--text-primary);
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.info-value.text {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
}

/* ─── Profile Card ─────────────────────────────────────────────── */
.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--border-medium);
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.profile-id {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Warranty Timer ───────────────────────────────────────────── */
.warranty-timer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.timer-ring {
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
}

.timer-ring svg {
  transform: rotate(-90deg);
  width: 44px;
  height: 44px;
}

.timer-ring .ring-bg {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 3;
}

.timer-ring .ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease;
}

.timer-ring .ring-fill.low {
  stroke: var(--warning);
}

.timer-ring .ring-fill.expired {
  stroke: var(--danger);
}

.timer-text {
  flex: 1;
}

.timer-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.timer-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

/* ─── Verdict Card ─────────────────────────────────────────────── */
.verdict-card {
  border-width: 2px;
  grid-column: 1 / -1;
}

.verdict-card.eligible {
  border-color: var(--success-border);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.03) 100%);
}

.verdict-card.not-eligible {
  border-color: var(--border-subtle);
}

.verdict-card.error {
  border-color: var(--danger-border);
}

.verdict-message {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.verdict-reason {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
}

.btn-claim {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--success), #059669);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-claim:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-claim:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Replacement Success ──────────────────────────────────────── */
.replacement-card {
  border: 2px solid var(--success-border);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.04) 100%);
}

.replacement-account {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px dashed var(--success-border);
}

.replacement-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
  margin-bottom: 8px;
  font-weight: 600;
}

.replacement-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.5;
  user-select: all;
  padding: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  cursor: text;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-copy.copied {
  color: var(--success);
  border-color: var(--success-border);
}

/* ─── Error State ──────────────────────────────────────────────── */
.error-card {
  background: var(--bg-card);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  animation: shake 0.4s ease;
  grid-column: 1 / -1;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.error-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.error-message {
  font-size: 0.9rem;
  color: var(--danger);
  font-weight: 500;
}

.error-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ─── Footer ───────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 40px 0 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-link-red {
  color: var(--danger);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
}

.footer-link-red:hover {
  text-decoration: underline;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.footer-link-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #5865F2;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(88, 101, 242, 0.1);
}

.footer-link-discord:hover {
  background: rgba(88, 101, 242, 0.2);
  transform: translateY(-1px);
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .results-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .app-container {
    padding: 24px 16px 60px;
  }

  .app-title {
    font-size: 1.5rem;
  }

  .results-container {
    grid-template-columns: 1fr;
  }

  .input-group {
    flex-direction: column;
  }

  .btn-check {
    width: 100%;
  }

  .search-card {
    padding: 20px;
  }

  .result-card {
    padding: 18px;
  }

  .step-item .step-label {
    display: none;
  }

  .step-item .step-icon {
    font-size: 1.1rem;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
