/* ==========================================
   ZENN URL SHORTENER - PURE LIQUID GLASS (ANIMATED)
   ========================================== */

:root {
  --bg-dark: #050811;
  --bg-input: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.15);
  --border-hover: rgba(255, 255, 255, 0.3);
  
  --cyan-primary: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.25);
  --blue-accent: #0072ff;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Outfit', sans-serif;
  
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;

  /* Custom Easing for Fluid UI */
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Lights */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--cyan-primary);
  top: -100px;
  left: -100px;
  animation: floatOrb 10s ease-in-out infinite alternate;
}

.orb-2 {
  width: 550px;
  height: 550px;
  background: var(--blue-accent);
  bottom: -150px;
  right: -100px;
  animation: floatOrb 12s ease-in-out infinite alternate-reverse;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Layout */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-header {
  padding: 30px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition-bounce);
}

.logo-link:hover {
  transform: scale(1.05);
}

.logo-icon {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-primary);
  transition: var(--transition-smooth);
}

.logo-link:hover .logo-icon {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px var(--cyan-glow);
  transform: rotate(-5deg);
}

.logo-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 1px;
}

.highlight {
  color: var(--cyan-primary);
}

.content-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0 60px;
}

.view-section {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideUpFade 0.8s var(--transition-bounce) forwards;
}

/* Pure Glass Card */
.glass-card {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: var(--transition-smooth);
}

/* Hero Section */
.hero-text-block {
  text-align: center;
  margin-bottom: 30px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #a5f3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

/* Form Controls */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: var(--transition-bounce);
}

.input-group:focus-within {
  transform: scale(1.01);
}

.input-icon {
  position: absolute;
  left: 18px;
  top: 19px;
  color: var(--text-dark);
  pointer-events: none;
  transition: var(--transition-bounce);
}

.input-group:focus-within .input-icon {
  color: var(--cyan-primary);
  transform: scale(1.1);
}

input[type="url"] {
  width: 100%;
  padding: 18px 18px 18px 52px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1.05rem;
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition-smooth);
}

input[type="url"]:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--cyan-primary);
  box-shadow: 0 0 20px var(--cyan-glow);
}

/* Flat Vibrant Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 24px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: var(--transition-bounce);
  text-decoration: none;
}

.primary-btn {
  background: linear-gradient(135deg, var(--cyan-primary), var(--blue-accent));
  color: #030712;
  box-shadow: 0 8px 20px var(--cyan-glow);
}

.primary-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 240, 255, 0.5);
}

.primary-btn:active, .secondary-btn:active {
  transform: translateY(1px) scale(0.97);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  white-space: nowrap;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--cyan-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--cyan-glow);
}

.inline-btn {
  margin-top: 20px;
  padding: 14px 28px;
}

/* Result Card */
.result-card {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-glass);
  transform-origin: top;
  animation: expandDown 0.5s var(--transition-bounce) forwards;
}

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  animation: pulseLight 2s infinite;
}

.result-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-body {
  display: flex;
  gap: 12px;
}

#short-url-output {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: var(--cyan-primary);
  font-family: monospace;
  font-size: 1rem;
  width: 100%;
  transition: var(--transition-smooth);
}

#short-url-output:focus {
  border-color: var(--cyan-primary);
  background: rgba(0, 0, 0, 0.4);
}

/* Feature Pills (Staggered Animation) */
.feature-pills {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 8px 16px;
  border-radius: 30px;
  opacity: 0;
  animation: slideUpFade 0.6s var(--transition-bounce) forwards;
  transition: var(--transition-bounce);
}

.pill:hover {
  transform: translateY(-3px) scale(1.05);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.pill:nth-child(1) { animation-delay: 0.1s; }
.pill:nth-child(2) { animation-delay: 0.2s; }
.pill:nth-child(3) { animation-delay: 0.3s; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-primary);
  box-shadow: 0 0 8px var(--cyan-primary);
}

/* Gateway View */
.gateway-card {
  text-align: center;
}

.gateway-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--border-glass);
  padding: 8px 18px;
  border-radius: 30px;
  margin-bottom: 24px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan-primary);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--cyan-primary);
  animation: pulseLight 1.5s infinite;
}

.gateway-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  margin-bottom: 12px;
}

.gateway-description {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 35px;
}

.countdown-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 35px;
}

.countdown-circle {
  position: relative;
  width: 90px;
  height: 90px;
}

.countdown-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 3;
}

.circle-fill {
  fill: none;
  stroke: var(--cyan-primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear;
}

.timer-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
}

.continue-btn {
  width: 100%;
}

/* Error Toast */
.error-toast {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 0.9rem;
  text-align: left;
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* Entrance Loading Overlay */
.entrance-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  backdrop-filter: blur(10px);
}

.brand-logo-symbol {
  color: var(--cyan-primary);
  margin-bottom: 16px;
  animation: pulseLight 2s infinite;
}

.brand-text {
  font-family: var(--font-heading);
  letter-spacing: 5px;
  font-size: 1.75rem;
  margin-bottom: 30px;
}

.loading-bar-container {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.loading-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--cyan-primary);
  box-shadow: 0 0 15px var(--cyan-primary);
  animation: fillProgress 1.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.loading-status {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--text-dark);
}

/* Main Footer */
.main-footer {
  text-align: center;
  padding: 24px 0;
  font-size: 0.85rem;
  color: var(--text-dark);
}

.social-links {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.cyber-tiktok {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition-bounce);
}

.cyber-tiktok:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 20px rgba(0, 240, 255, 0.15);
}

.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */
@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.05); }
}

@keyframes slideUpFade {
  0% { opacity: 0; transform: translateY(25px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes expandDown {
  0% { opacity: 0; transform: translateY(-15px) scaleY(0.95); }
  100% { opacity: 1; transform: translateY(0) scaleY(1); }
}

@keyframes pulseLight {
  0% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 15px currentColor; }
  100% { transform: scale(1); opacity: 0.7; }
}

@keyframes fillProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@media (max-width: 640px) {
  .hero-title { font-size: 1.85rem; }
  .glass-card { padding: 30px 24px; }
  .result-body { flex-direction: column; }
  #short-url-output { text-align: center; }
  .secondary-btn { width: 100%; }
}

/* ==========================================
   SYSTEM THEME DETECTION (TRUE LIGHT GLASS)
   ========================================== */
@media (prefers-color-scheme: light) {
  :root {
    --bg-dark: #f0f4f8; 
    --bg-input: rgba(255, 255, 255, 0.6);
    --border-glass: rgba(255, 255, 255, 0.6); 
    --border-hover: rgba(0, 114, 255, 0.4);
    
    --cyan-primary: #005bb5;
    --cyan-glow: rgba(0, 91, 181, 0.2);
    --blue-accent: #0ea5e9;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dark: #64748b;
  }

  .ambient-bg { opacity: 0.8; }
  .orb-1 { background: rgba(0, 195, 255, 0.4); }
  .orb-2 { background: rgba(0, 114, 255, 0.3); }

  .glass-card {
    background: rgba(255, 255, 255, 0.4); 
    border: 1px solid rgba(255, 255, 255, 0.8); 
    box-shadow: 0 10px 40px 0 rgba(31, 38, 135, 0.08); 
  }

  .hero-title {
    background: linear-gradient(180deg, #0f172a 0%, #005bb5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  input[type="url"] {
    background: rgba(255, 255, 255, 0.5);
  }

  input[type="url"]:focus {
    background: rgba(255, 255, 255, 0.9);
  }

  .primary-btn {
    color: #ffffff;
  }

  .secondary-btn, .pill, .cyber-tiktok {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-main);
  }

  .secondary-btn:hover, .cyber-tiktok:hover, .pill:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--cyan-primary);
  }

  #short-url-output {
    background: rgba(255, 255, 255, 0.5);
  }
  
  #short-url-output:focus {
    background: rgba(255, 255, 255, 0.9);
  }

  .circle-bg {
    stroke: rgba(0, 0, 0, 0.08);
  }

  .grid-overlay {
    background-image: 
      linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  }
}
