/* ============================================
   Internal Link Architect Pro - Premium Styles
   ============================================ */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@700;800&display=swap');

/* ============================================
   CSS Variables - Design System
   ============================================ */
:root {
  /* Colors - HSL for easy adjustments */
  --primary: hsl(240, 70%, 60%);
  --primary-light: hsl(240, 70%, 70%);
  --primary-dark: hsl(240, 70%, 50%);
  --secondary: hsl(280, 65%, 55%);
  --secondary-light: hsl(280, 65%, 65%);

  --background: hsl(220, 15%, 10%);
  --surface: hsl(220, 15%, 15%);
  --surface-glass: hsla(220, 15%, 25%, 0.4);

  --text-primary: hsl(0, 0%, 95%);
  --text-secondary: hsl(0, 0%, 70%);
  --text-muted: hsl(0, 0%, 50%);

  --success: hsl(142, 71%, 45%);
  --warning: hsl(38, 92%, 50%);
  --error: hsl(0, 84%, 60%);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  --gradient-bg: linear-gradient(135deg,
      hsl(240, 30%, 8%) 0%,
      hsl(260, 30%, 12%) 50%,
      hsl(240, 30%, 8%) 100%);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, hsla(240, 70%, 60%, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, hsla(280, 65%, 55%, 0.1) 0%, transparent 50%);
  animation: bgPulse 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes bgPulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 0.8;
  }
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

p {
  margin-bottom: var(--spacing-sm);
}

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  position: relative;
  z-index: 1;
}

main.container {
  padding-top: 0;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-lg) 0;
  margin-bottom: 0;
}

.hero h1 {
  margin-bottom: var(--spacing-md);
  animation: slideDown 0.6s ease-out;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--spacing-lg);
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.hero-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-md);
  background: var(--surface-glass);
  border: 1px solid hsla(240, 70%, 60%, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-light);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.8s ease-out 0.4s both;
}

.badge-beta {
  background: hsla(38, 92%, 50%, 0.1);
  border-color: hsla(38, 92%, 50%, 0.4);
  color: var(--warning);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

/* ============================================
   Glass Card
   ============================================ */
.glass-card {
  background: var(--surface-glass);
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.6s ease-out 0.3s both;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* ============================================
   Form Styles
   ============================================ */
.input-group {
  margin-bottom: var(--spacing-lg);
}

.input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.input-group input[type="url"],
.input-group input[type="text"] {
  width: 100%;
  padding: var(--spacing-md);
  background: hsla(220, 15%, 20%, 0.6);
  border: 2px solid hsla(0, 0%, 100%, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: hsla(220, 15%, 25%, 0.8);
  box-shadow: 0 0 0 3px hsla(240, 70%, 60%, 0.2);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

/* Slider Styles */
.slider-container {
  margin-top: var(--spacing-md);
}

.slider-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.slider-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-light);
  min-width: 60px;
  text-align: center;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: hsla(220, 15%, 20%, 0.6);
  border-radius: var(--radius-full);
  outline: none;
  transition: background var(--transition-base);
}

input[type="range"]:hover {
  background: hsla(220, 15%, 25%, 0.8);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--gradient-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-base);
}

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

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--gradient-primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-base);
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.1);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-block;
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: 1.125rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

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

.btn-secondary {
  background: hsla(0, 0%, 100%, 0.1);
  color: var(--text-primary);
  border: 1px solid hsla(0, 0%, 100%, 0.2);
}

.btn-secondary:hover {
  background: hsla(0, 0%, 100%, 0.15);
  border-color: var(--primary-light);
}

.btn-full {
  width: 100%;
}

/* ============================================
   Processing Animation
   ============================================ */
.processing {
  display: none;
  text-align: center;
  padding: var(--spacing-xl);
  animation: fadeIn var(--transition-slow);
}

.processing.active {
  display: block;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid hsla(0, 0%, 100%, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto var(--spacing-md);
  animation: spin 1s linear infinite;
}

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

.processing-text {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* ============================================
   Results Section
   ============================================ */
.results {
  display: none;
  margin-top: var(--spacing-xl);
  animation: slideUp var(--transition-slow);
}

.results.active {
  display: block;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.results-header h2 {
  color: var(--text-primary);
}

.output-container {
  background: hsla(220, 15%, 8%, 0.6);
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  max-height: 500px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.output-container::-webkit-scrollbar {
  width: 8px;
}

.output-container::-webkit-scrollbar-track {
  background: hsla(0, 0%, 0%, 0.2);
  border-radius: var(--radius-sm);
}

.output-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: var(--radius-sm);
}

.output-container code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============================================
   Stats Display
   ============================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.stat-card {
  background: hsla(220, 15%, 20%, 0.4);
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-light);
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: var(--spacing-xs);
}

.mt-2 {
  margin-top: var(--spacing-sm);
}

.mt-3 {
  margin-top: var(--spacing-md);
}

.mt-4 {
  margin-top: var(--spacing-lg);
}

.mb-1 {
  margin-bottom: var(--spacing-xs);
}

.mb-2 {
  margin-bottom: var(--spacing-sm);
}

.mb-3 {
  margin-bottom: var(--spacing-md);
}

.mb-4 {
  margin-bottom: var(--spacing-lg);
}

.hidden {
  display: none !important;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  .container {
    padding: var(--spacing-md);
  }

  .hero {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .glass-card {
    padding: var(--spacing-lg);
  }

  .results-header {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: flex-start;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Footer Styles
   ============================================ */
footer {
  margin-top: var(--spacing-2xl);
  padding: var(--spacing-xl) 0;
  border-top: 1px solid hsla(0, 0%, 100%, 0.05);
  position: relative;
  z-index: 1;
}

.container-footer {
  padding-top: 0;
  padding-bottom: 0;
}

.footer-content {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-content p {
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
}

.footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.footer-divider {
  opacity: 0.3;
}

.footer-meta a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  border-bottom: 1px solid transparent;
}

.footer-meta a:hover {
  color: white;
  border-bottom-color: var(--primary-light);
}

@media (max-width: 768px) {
  .footer-meta {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .footer-divider {
    display: none;
  }
}

.beta-text {
  font-size: 0.75rem;
  color: var(--warning);
  opacity: 0.8;
  font-weight: 600;
  margin-left: 4px;
}