/* ==========================================================================
   Design System & CSS Custom Properties
   ========================================================================== */
:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Color Palette */
  --bg-dark: #080a10;
  --bg-card: rgba(16, 20, 34, 0.72);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-hover: rgba(24, 30, 52, 0.85);

  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  /* Accent & Gradients */
  --primary-indigo: #6366f1;
  --primary-cyan: #06b6d4;
  --primary-blue: #3b82f6;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #06b6d4 100%);
  --primary-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #2563eb 50%, #0891b2 100%);

  /* Warning / Expiring Domain */
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.1);
  --amber-border: rgba(245, 158, 11, 0.28);

  /* Success / Active Domain */
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.1);
  --emerald-border: rgba(16, 185, 129, 0.32);

  /* Shadow & Glow */
  --glow-indigo: rgba(99, 102, 241, 0.35);
  --glow-cyan: rgba(6, 182, 212, 0.25);
  --card-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition-fast: 160ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 260ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  min-height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  padding: 1.5rem;
}

/* ==========================================================================
   Ambient Background Effects
   ========================================================================== */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 520px;
  height: 520px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.45), rgba(79, 70, 229, 0.05));
}

.orb-2 {
  width: 580px;
  height: 580px;
  bottom: -160px;
  right: -100px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.35), rgba(59, 130, 246, 0.05));
  animation-duration: 22s;
  animation-direction: alternate-reverse;
}

.orb-3 {
  width: 380px;
  height: 380px;
  top: 40%;
  left: 55%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0));
  animation-duration: 15s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, -20px) scale(0.95); }
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   Layout & Container
   ========================================================================== */
.page-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 760px;
  margin: auto;
}

.redirect-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
  overflow: hidden;
}

.redirect-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-gradient);
  opacity: 0.9;
}

/* ==========================================================================
   Header & Status Bar
   ========================================================================== */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 14px var(--glow-indigo);
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--amber-400);
  box-shadow: 0 0 10px var(--amber-400);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}

/* ==========================================================================
   Announcement Hero
   ========================================================================== */
.announcement {
  text-align: left;
}

.headline {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.22;
  color: #ffffff;
  margin-bottom: 0.65rem;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subline {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ==========================================================================
   Domain Transition Visualizer
   ========================================================================== */
.migration-display {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
}

.domain-box {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.domain-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.domain-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-subtle);
}

.domain-name {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  word-break: break-all;
}

.domain-status-note {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

/* Old Domain Styling */
.old-domain {
  background: rgba(245, 158, 11, 0.03);
  border: 1px dashed var(--amber-border);
}

.old-domain .domain-name {
  color: #e2e8f0;
  text-decoration: line-through 1.5px rgba(245, 158, 11, 0.7);
}

.expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  background: var(--amber-bg);
  color: var(--amber-400);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-full);
}

/* Transfer Arrow */
.migration-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 48px;
}

.arrow-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, rgba(245, 158, 11, 0.3), rgba(6, 182, 212, 0.5));
  z-index: 1;
}

.arrow-badge {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #151b2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
  animation: pulseArrow 2.5s infinite;
}

@keyframes pulseArrow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); box-shadow: 0 0 20px rgba(6, 182, 212, 0.5); }
}

/* New Domain Styling */
.new-domain {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.06) 100%);
  border: 1px solid var(--emerald-border);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.new-domain .domain-name {
  color: #38bdf8;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.active-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  background: var(--emerald-bg);
  color: var(--emerald-400);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Warning Alert Callout
   ========================================================================== */
.warning-callout {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.03) 100%);
  border-left: 4px solid var(--amber-500);
  border-top: 1px solid rgba(245, 158, 11, 0.15);
  border-right: 1px solid rgba(245, 158, 11, 0.15);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
}

.warning-icon-wrapper {
  color: var(--amber-400);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.warning-content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.warning-title {
  color: #fef3c7;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.warning-text {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.warning-text code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--amber-400);
}

/* ==========================================================================
   Redirect Action Center & Timer
   ========================================================================== */
.redirect-action-center {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(13, 17, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
}

.timer-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.circular-progress {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
  width: 76px;
  height: 76px;
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
}

.ring-fill {
  fill: none;
  stroke: url(#ringGradient);
  stroke: var(--primary-cyan);
  stroke-linecap: round;
  stroke-dasharray: 201; /* 2 * PI * 32 ≈ 201 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.15s linear, stroke 0.3s ease;
}

.circular-progress.paused .ring-fill {
  stroke: var(--amber-400);
}

.countdown-number {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
}

.timer-text-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.timer-caption {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
}

.timer-target-link {
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.timer-target-link a {
  font-family: var(--font-mono);
  color: #38bdf8;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast), text-decoration var(--transition-fast);
}

.timer-target-link a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.button-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  outline: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.45);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 18px var(--glow-indigo);
  flex: 1 1 200px;
}

.btn-primary:hover {
  background: var(--primary-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--glow-indigo);
}

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

.btn-icon {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn-primary:hover .btn-icon {
  transform: translateX(3px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn-secondary.is-paused {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--amber-border);
  color: var(--amber-400);
}

.btn-tertiary {
  background: transparent;
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.07);
}

.btn-tertiary:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-msg {
  font-size: 0.82rem;
  color: var(--text-subtle);
}

.footer-path-info {
  font-size: 0.8rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.path-badge {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-muted);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  z-index: 999;
}

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

.toast svg {
  color: var(--emerald-400);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 680px) {
  body {
    padding: 1rem;
  }

  .redirect-card {
    padding: 1.75rem 1.25rem;
    gap: 1.5rem;
    border-radius: var(--radius-lg);
  }

  .headline {
    font-size: 1.65rem;
  }

  .migration-display {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1rem;
  }

  .migration-arrow {
    width: 100%;
    height: 32px;
  }

  .arrow-line {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, rgba(245, 158, 11, 0.3), rgba(6, 182, 212, 0.5));
  }

  .arrow-badge {
    transform: rotate(90deg);
  }

  @keyframes pulseArrow {
    0%, 100% { transform: rotate(90deg) scale(1); }
    50% { transform: rotate(90deg) scale(1.12); box-shadow: 0 0 20px rgba(6, 182, 212, 0.5); }
  }

  .timer-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .button-group {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .card-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .glow-orb,
  .pulse-dot,
  .arrow-badge,
  .ring-fill {
    animation: none !important;
    transition: none !important;
  }
}
