/* ============================================================
   APPLE LIQUID GLASS — Premium Glassmorphism Stylesheet
   ============================================================
   Crafted for depth, light refraction, and frosted-glass realism.
   Pure vanilla CSS · No frameworks · No compromises.
   ============================================================ */

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

/* ──────────────────────────────────────────────────────────────
   1. DESIGN TOKENS (CSS Custom Properties)
   ────────────────────────────────────────────────────────────── */

:root {
  /* ── Palette ── */
  --color-base:        #06080f;
  --color-surface:     #0b0e1a;
  --color-surface-alt: #0f0f1e;
  --color-primary:     #4a6cf7;
  --color-accent:      #6b8cff;
  --color-secondary:   #2d4abd;
  --color-success:     #34d399;
  --color-error:       #f87171;
  --color-text:        #e4e7ef;
  --color-text-muted:  #7a82a0;
  --color-text-dim:    #4e5572;
  --color-border:      rgba(255, 255, 255, 0.08);
  --color-border-hover:rgba(255, 255, 255, 0.14);
  --color-glass-bg:    rgba(15, 15, 30, 0.60);
  --color-glass-bg-alt:rgba(18, 18, 38, 0.55);
  --color-glass-light: rgba(255, 255, 255, 0.03);
  --color-glow:        rgba(74, 108, 247, 0.18);
  --color-glow-strong: rgba(74, 108, 247, 0.35);
  --color-selection-bg:#4a6cf7;
  --color-selection-fg:#ffffff;

  /* ── Typography ── */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:  'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  --text-xs:    0.75rem;
  --text-sm:    0.8125rem;
  --text-base:  0.9375rem;
  --text-lg:    1.125rem;
  --text-xl:    1.375rem;
  --text-2xl:   1.75rem;
  --text-3xl:   2.5rem;
  --text-4xl:   3.25rem;

  /* ── Spacing ── */
  --space-xs:   0.375rem;
  --space-sm:   0.625rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4.5rem;

  /* ── Radii ── */
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-full:9999px;

  /* ── Depth ── */
  --shadow-card:
    0 4px 24px rgba(0, 0, 0, 0.45),
    0 1px 3px  rgba(0, 0, 0, 0.30),
    0 0 80px -20px var(--color-glow);
  --shadow-card-hover:
    0 8px 40px rgba(0, 0, 0, 0.50),
    0 2px 6px  rgba(0, 0, 0, 0.35),
    0 0 120px -20px var(--color-glow-strong);
  --shadow-btn:
    0 2px 16px rgba(74, 108, 247, 0.30),
    0 1px 3px  rgba(0, 0, 0, 0.20);
  --shadow-btn-hover:
    0 4px 28px rgba(74, 108, 247, 0.45),
    0 2px 6px  rgba(0, 0, 0, 0.25);
  --shadow-input-focus:
    0 0 0 3px rgba(74, 108, 247, 0.20),
    0 0 24px  rgba(74, 108, 247, 0.10);
  --shadow-navbar:
    0 1px 0 var(--color-border),
    0 4px 30px rgba(0, 0, 0, 0.35);

  /* ── Transitions ── */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:  150ms;
  --duration-base:  250ms;
  --duration-slow:  400ms;
  --duration-enter: 500ms;

  /* ── Layout ── */
  --container-max:  580px;
  --navbar-height:  56px;
}


/* ──────────────────────────────────────────────────────────────
   2. RESET & BASE
   ────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-base);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Animated floating orbs ── */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(100px);
  opacity: 0.45;
}

body::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(74, 108, 247, 0.25) 0%, transparent 70%);
  top: -180px;
  right: -120px;
  animation: float 18s ease-in-out infinite;
}

body::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(107, 140, 255, 0.18) 0%, rgba(45, 74, 189, 0.12) 40%, transparent 70%);
  bottom: -100px;
  left: -160px;
  animation: float 22s ease-in-out infinite reverse;
}

/* ── Selection ── */
::selection {
  background: var(--color-selection-bg);
  color: var(--color-selection-fg);
}

::-moz-selection {
  background: var(--color-selection-bg);
  color: var(--color-selection-fg);
}

/* ── Links ── */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

a:hover {
  color: var(--color-primary);
}

/* ── Lists ── */
ul, ol {
  list-style: none;
}

/* ── Images ── */
img, svg {
  display: block;
  max-width: 100%;
}


/* ──────────────────────────────────────────────────────────────
   3. CUSTOM SCROLLBAR
   ────────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(74, 108, 247, 0.25);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 108, 247, 0.40);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 108, 247, 0.25) transparent;
}


/* ──────────────────────────────────────────────────────────────
   4. CONTAINER
   ────────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
  position: relative;
  z-index: 1;
}


/* ──────────────────────────────────────────────────────────────
   5. NAVBAR
   ────────────────────────────────────────────────────────────── */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: rgba(6, 8, 15, 0.70);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-navbar);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-text);
  letter-spacing: -0.01em;
  user-select: none;
}

.navbar-brand svg,
.navbar-brand img {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}


/* ──────────────────────────────────────────────────────────────
   6. BUTTONS
   ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--duration-fast) var(--ease-out-expo),
    box-shadow var(--duration-base) ease,
    background var(--duration-base) ease,
    border-color var(--duration-base) ease,
    color var(--duration-fast) ease;
}

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

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* ── Primary ── */
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  box-shadow: var(--shadow-btn);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--duration-base) ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-btn-hover);
  animation: pulseGlow 2s ease-in-out infinite;
}

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

.btn-primary:active {
  transform: translateY(0) scale(0.965);
  animation: none;
}

/* ── Ghost (Navbar) ── */
.btn-ghost {
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-ghost:active {
  background: rgba(255, 255, 255, 0.06);
}

/* ── Copy ── */
.btn-copy {
  color: var(--color-accent);
  background: transparent;
  border: 1.5px solid rgba(74, 108, 247, 0.30);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition:
    transform var(--duration-fast) var(--ease-out-expo),
    border-color var(--duration-base) ease,
    color var(--duration-base) ease,
    background var(--duration-base) ease,
    box-shadow var(--duration-base) ease;
}

.btn-copy:hover {
  border-color: var(--color-accent);
  background: rgba(74, 108, 247, 0.08);
  box-shadow: 0 0 16px rgba(74, 108, 247, 0.12);
}

.btn-copy.copied {
  color: var(--color-success);
  border-color: rgba(52, 211, 153, 0.40);
  background: rgba(52, 211, 153, 0.08);
}

.btn-copy.copied:hover {
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.12);
}

/* ── Button group ── */
.btn-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}


/* ──────────────────────────────────────────────────────────────
   7. HERO SECTION
   ────────────────────────────────────────────────────────────── */

.hero {
  padding-top: calc(var(--navbar-height) + var(--space-3xl));
  padding-bottom: var(--space-xl);
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  animation: fadeSlideDown var(--duration-enter) var(--ease-out-expo) both;
}

.gradient-text {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-accent)  40%,
    #a78bfa            70%,
    var(--color-primary) 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}

.hero-subtitle {
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--color-text-muted);
  max-width: 440px;
  margin-inline: auto;
  line-height: 1.55;
  animation: fadeSlideUp var(--duration-enter) var(--ease-out-expo) 120ms both;
}


/* ──────────────────────────────────────────────────────────────
   8. TOOL SECTION
   ────────────────────────────────────────────────────────────── */

.tool-section {
  padding-bottom: var(--space-3xl);
  position: relative;
  z-index: 1;
}


/* ──────────────────────────────────────────────────────────────
   9. GLASS CARD — The centrepiece
   ────────────────────────────────────────────────────────────── */

.glass-card {
  position: relative;
  background: var(--color-glass-bg);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  overflow: hidden;
  transition:
    box-shadow var(--duration-slow) ease,
    border-color var(--duration-slow) ease,
    transform var(--duration-slow) var(--ease-out-expo);
}

/* ── Animated prismatic border (mask technique) ── */
.glass-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from 0deg at 50% 50%,
    rgba(74, 108, 247, 0.0)   0deg,
    rgba(74, 108, 247, 0.30)  60deg,
    rgba(107, 140, 255, 0.20) 120deg,
    rgba(167, 139, 250, 0.15) 180deg,
    rgba(107, 140, 255, 0.20) 240deg,
    rgba(74, 108, 247, 0.30)  300deg,
    rgba(74, 108, 247, 0.0)   360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--duration-slow) ease;
  pointer-events: none;
  z-index: 1;
  animation: shimmer 8s linear infinite;
}

/* ── Light refraction highlight at top ── */
.glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 20%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.08) 80%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

.glass-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border-hover);
}

.glass-card:hover::before {
  opacity: 1;
}

/* ── Card header ── */
.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 3;
}

.card-header svg,
.card-header img {
  width: 22px;
  height: 22px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.card-header h2,
.card-header h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--color-text);
}

/* ── Card body ── */
.card-body {
  position: relative;
  z-index: 3;
}


/* ──────────────────────────────────────────────────────────────
   10. FORM INPUTS
   ────────────────────────────────────────────────────────────── */

.input-group {
  margin-bottom: var(--space-lg);
}

.input-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.01em;
}

.input-field {
  width: 100%;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  resize: vertical;
  min-height: 100px;
  outline: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    border-color var(--duration-base) ease,
    box-shadow var(--duration-base) ease,
    background var(--duration-base) ease;
}

.input-field::placeholder {
  color: var(--color-text-dim);
}

.input-field:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.input-field:focus {
  border-color: rgba(74, 108, 247, 0.50);
  background: rgba(74, 108, 247, 0.04);
  box-shadow: var(--shadow-input-focus);
}

/* Reset autofill for dark theme */
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface) inset !important;
  -webkit-text-fill-color: var(--color-text) !important;
  caret-color: var(--color-text);
}


/* ──────────────────────────────────────────────────────────────
   11. RESULT AREA
   ────────────────────────────────────────────────────────────── */

.result-area {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transform: translateY(-8px);
  transition:
    max-height var(--duration-slow) var(--ease-out-expo),
    opacity   var(--duration-slow) var(--ease-out-expo),
    margin    var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo);
}

.result-area.visible {
  max-height: 600px;
  opacity: 1;
  margin-top: var(--space-lg);
  transform: translateY(0);
}

.result-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-success);
  margin-bottom: var(--space-sm);
}

.result-header svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.result-header.error-state {
  color: var(--color-error);
}

.result-content {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  word-break: break-all;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  position: relative;
  /* Inner shadow for depth */
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

.result-content + .btn-copy {
  margin-top: var(--space-sm);
}


/* ──────────────────────────────────────────────────────────────
   12. LOADING SPINNER
   ────────────────────────────────────────────────────────────── */

.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
}


/* ──────────────────────────────────────────────────────────────
   13. MODAL
   ────────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--duration-base) ease,
    visibility var(--duration-base) ease;
}

.modal.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: rgba(12, 14, 26, 0.85);
  backdrop-filter: blur(30px) saturate(1.3);
  -webkit-backdrop-filter: blur(30px) saturate(1.3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 120px -30px var(--color-glow);
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  transition:
    transform var(--duration-slow) var(--ease-spring),
    opacity var(--duration-slow) ease;
}

/* ── Light refraction on modal ── */
.modal-content::after {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12) 30%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.12) 70%,
    transparent
  );
  pointer-events: none;
  z-index: 1;
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.modal-header h2,
.modal-header h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.modal-body {
  padding: var(--space-lg) var(--space-xl);
  overflow-y: auto;
  flex: 1;
}


/* ──────────────────────────────────────────────────────────────
   14. HISTORY ITEMS
   ────────────────────────────────────────────────────────────── */

.history-item {
  position: relative;
  background: var(--color-glass-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  cursor: default;
  transition:
    transform var(--duration-base) var(--ease-out-expo),
    border-color var(--duration-base) ease,
    background var(--duration-base) ease,
    box-shadow var(--duration-base) ease;
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-item:hover {
  transform: translateX(4px);
  border-color: var(--color-border-hover);
  background: rgba(20, 22, 42, 0.65);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.history-item .history-cookie {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  word-break: break-all;
  line-height: 1.5;
  margin-top: var(--space-xs);
}

.history-item .history-time {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  margin-top: var(--space-xs);
}

.history-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--color-text-dim);
  font-size: var(--text-sm);
}

.history-empty svg {
  width: 48px;
  height: 48px;
  margin-inline: auto;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}


/* ──────────────────────────────────────────────────────────────
   15. FOOTER
   ────────────────────────────────────────────────────────────── */

.footer {
  position: relative;
  z-index: 1;
  padding: var(--space-xl) 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  border-top: 1px solid var(--color-border);
}

.footer a {
  color: var(--color-text-muted);
  transition: color var(--duration-fast) ease;
}

.footer a:hover {
  color: var(--color-accent);
}


/* ──────────────────────────────────────────────────────────────
   16. UTILITY CLASSES
   ────────────────────────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

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


/* ──────────────────────────────────────────────────────────────
   17. KEYFRAME ANIMATIONS
   ────────────────────────────────────────────────────────────── */

@keyframes fadeSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -40px) scale(1.05);
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  75% {
    transform: translate(15px, 35px) scale(1.02);
  }
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: var(--shadow-btn);
  }
  50% {
    box-shadow:
      0 4px 32px rgba(74, 108, 247, 0.50),
      0 0 60px -10px rgba(107, 140, 255, 0.25);
  }
}

@keyframes glassRefract {
  0%, 100% {
    opacity: 0.5;
    transform: translateX(-20%);
  }
  50% {
    opacity: 1;
    transform: translateX(20%);
  }
}

@keyframes entrancePop {
  0% {
    opacity: 0;
    transform: scale(0.90) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}


/* ──────────────────────────────────────────────────────────────
   18. GLASS-CARD INNER SHADOW & DEPTH LAYERS
   ────────────────────────────────────────────────────────────── */

/*
 * Additional depth via an inset radial highlight that simulates
 * light being refracted through the glass surface.
 */
.glass-card > .card-body::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 60%;
  background: radial-gradient(
    ellipse at center,
    rgba(107, 140, 255, 0.04) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  animation: glassRefract 12s ease-in-out infinite;
}

.glass-card > .card-body {
  position: relative;
}

/* Soft inner shadow for depth */
.glass-card > .card-body::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  pointer-events: none;
  z-index: 0;
}

/* All interactive children above depth layers */
.glass-card .input-group,
.glass-card .btn-group,
.glass-card .result-area,
.glass-card .card-header {
  position: relative;
  z-index: 3;
}


/* ──────────────────────────────────────────────────────────────
   19. EXTRA POLISH — Focus-visible, Reduced Motion
   ────────────────────────────────────────────────────────────── */

/* ── Focus-visible ring for keyboard navigation ── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline-offset: 3px;
}

/* ── Respect prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body::before,
  body::after {
    animation: none;
  }

  .hero-title,
  .hero-subtitle {
    animation: none;
    opacity: 1;
  }

  .glass-card::before {
    animation: none;
    opacity: 0.4;
  }
}


/* ──────────────────────────────────────────────────────────────
   20. RESPONSIVE — TABLET (≤ 768px)
   ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  :root {
    --text-4xl: 2.25rem;
    --text-3xl: 1.75rem;
    --space-3xl: 3rem;
  }

  .navbar {
    padding: 0 var(--space-lg);
  }

  .hero {
    padding-top: calc(var(--navbar-height) + var(--space-2xl));
    padding-bottom: var(--space-lg);
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

  .glass-card {
    padding: var(--space-lg);
    border-radius: 20px;
  }

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

  .btn-group .btn {
    width: 100%;
  }

  .modal-content {
    width: 95%;
    max-height: 85vh;
    border-radius: 20px;
  }

  .modal-header,
  .modal-body {
    padding: var(--space-md) var(--space-lg);
  }

  body::before {
    width: 400px;
    height: 400px;
  }

  body::after {
    width: 350px;
    height: 350px;
  }
}


/* ──────────────────────────────────────────────────────────────
   21. RESPONSIVE — MOBILE (≤ 480px)
   ────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  :root {
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-xl:  1.125rem;
    --space-3xl: 2rem;
    --container-max: 100%;
  }

  .container {
    padding-inline: var(--space-md);
  }

  .navbar {
    padding: 0 var(--space-md);
  }

  .navbar-brand {
    font-size: var(--text-base);
  }

  /* Hide text labels on mobile nav buttons, keep icons */
  .btn-ghost .btn-label {
    display: none;
  }

  .hero-title {
    font-size: var(--text-2xl);
    letter-spacing: -0.02em;
  }

  .hero-subtitle {
    font-size: var(--text-sm);
  }

  .glass-card {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }

  .card-header h2,
  .card-header h3 {
    font-size: var(--text-lg);
  }

  .input-field {
    font-size: var(--text-xs);
    min-height: 80px;
    padding: var(--space-sm);
  }

  .modal-content {
    width: 96%;
    border-radius: var(--radius-md);
  }

  .modal-header,
  .modal-body {
    padding: var(--space-md);
  }

  body::before,
  body::after {
    opacity: 0.25;
  }
}


/* ──────────────────────────────────────────────────────────────
   22. DARK BACKGROUND GRADIENT (applied to body)
   ────────────────────────────────────────────────────────────── */

body {
  background:
    radial-gradient(
      ellipse 60% 50% at 50% 0%,
      rgba(15, 19, 42, 0.80) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 80% 60% at 80% 100%,
      rgba(10, 14, 35, 0.50) 0%,
      transparent 60%
    ),
    linear-gradient(
      180deg,
      #06080f 0%,
      #080c18 30%,
      #0a0e1f 60%,
      #06080f 100%
    );
  background-attachment: fixed;
}


/* ──────────────────────────────────────────────────────────────
   23. SECOND GLASS LAYER — Nested panels (optional usage)
   ────────────────────────────────────────────────────────────── */

.glass-panel {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}


/* ──────────────────────────────────────────────────────────────
   24. STATUS BADGES (optional for history items)
   ────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.badge-success {
  color: var(--color-success);
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.20);
}

.badge-error {
  color: var(--color-error);
  background: rgba(248, 113, 113, 0.10);
  border: 1px solid rgba(248, 113, 113, 0.20);
}


/* ──────────────────────────────────────────────────────────────
   25. TOOLTIP (bonus micro-interaction)
   ────────────────────────────────────────────────────────────── */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-text);
  background: rgba(15, 15, 30, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 5px 10px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity var(--duration-fast) ease,
    transform var(--duration-fast) ease;
  z-index: 9999;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ──────────────────────────────────────────────────────────────
   26. PRINT STYLES
   ────────────────────────────────────────────────────────────── */

@media print {
  body::before,
  body::after,
  .navbar,
  .modal,
  .btn-copy,
  .footer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .glass-card {
    background: #fff;
    backdrop-filter: none;
    border: 1px solid #ddd;
    box-shadow: none;
  }

  .glass-card::before,
  .glass-card::after {
    display: none;
  }

  .result-area.visible {
    max-height: none;
  }

  .result-content {
    background: #f5f5f5;
    color: #111;
    border: 1px solid #ccc;
    box-shadow: none;
  }
}


/* ──────────────────────────────────────────────────────────────
   25. HERO BADGE
   ────────────────────────────────────────────────────────────── */

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: rgba(74, 108, 247, 0.08);
  border: 1px solid rgba(74, 108, 247, 0.2);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  margin-bottom: var(--space-lg);
  animation: fadeSlideDown var(--duration-enter) var(--ease-out-expo) both;
}

.hero-badge svg {
  opacity: 0.8;
}


/* ──────────────────────────────────────────────────────────────
   26. INPUT HINT
   ────────────────────────────────────────────────────────────── */

.input-hint {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  margin-top: var(--space-xs);
  padding-left: 2px;
  opacity: 0.7;
  transition: opacity var(--duration-fast) ease;
}

.input-field:focus ~ .input-hint {
  opacity: 1;
  color: var(--color-text-muted);
}


/* ──────────────────────────────────────────────────────────────
   27. FEATURES GRID
   ────────────────────────────────────────────────────────────── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  animation: fadeSlideUp var(--duration-enter) var(--ease-out-expo) 0.3s both;
}

.feature-card {
  background: var(--color-glass-bg);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  transition:
    transform var(--duration-base) var(--ease-out-expo),
    border-color var(--duration-base) ease,
    box-shadow var(--duration-base) ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-hover);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 40px -10px var(--color-glow);
}

.feature-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(74, 108, 247, 0.1);
  color: var(--color-primary);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.feature-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
}

@media (max-width: 480px) {
  .features-grid {
    margin-top: var(--space-lg);
  }

  .feature-card {
    padding: var(--space-md);
  }
}


/* ──────────────────────────────────────────────────────────────
   28. NAV CONTAINER
   ────────────────────────────────────────────────────────────── */

.nav-container {
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}


/* ──────────────────────────────────────────────────────────────
   EOF — Apple Liquid Glass
   ────────────────────────────────────────────────────────────── */
