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

:root {
  /* Color Palette */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --secondary-dark: #db2777;
  --accent: #14b8a6;
  --accent-dark: #0d9488;

  /* Neutrals */
  --bg-gradient-start: #0f172a;
  --bg-gradient-end: #1e293b;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

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

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-blur: blur(12px);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Animated background effect */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  animation: rotate 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 2rem 2rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  animation: fadeInUp 0.8s ease-out;
}

.hero .tagline {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-weight: 500;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero .cta {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow);
  transition: all 0.3s ease;
  animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.hero .cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(99, 102, 241, 0.5);
}

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

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

/* Main Content */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.5rem 3rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Glassmorphism Cards */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  animation: fadeIn 0.6s ease-out;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.card p {
  margin: 0.5rem 0 1.5rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Textarea */
textarea {
  width: 100%;
  min-height: 150px;
  margin: 0 0 1.5rem 0;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  resize: vertical;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea::placeholder {
  color: var(--text-muted);
}

/* Buttons */
button {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 0.4rem 0.5rem 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

button:active {
  transform: translateY(0);
}

#copyBtn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

#copyBtn:hover {
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

#clearBtn {
  background: linear-gradient(135deg, #64748b, #475569);
}

#clearBtn:hover {
  box-shadow: 0 6px 20px rgba(100, 116, 139, 0.4);
}

/* Search Input */
input[type="search"] {
  width: 100%;
  font-size: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input[type="search"]::placeholder {
  color: var(--text-muted);
}

/* Snippet Items */
#snippetsList {
  width: 100%;
}

.snippet-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.25rem;
  padding-right: 3.5rem;
  margin-bottom: 1rem;
  text-align: left;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  position: relative;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  animation: slideIn 0.3s ease-out;
  cursor: pointer;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

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

.snippet-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-light);
  transform: translateX(4px);
}

.snippet-item button {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  min-width: auto;
  margin: 0;
}

.snippet-item button:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

/* Transform Tools */
.transform-tools {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}

.transform-tools p {
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.transform-tools button {
  min-width: 140px;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.transform-tools button:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Footer */
footer {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

/* Language Switcher */
#langSwitcher {
  margin: 1rem auto 0;
  display: inline-block;
  font-size: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

#langSwitcher:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
}

#langSwitcher:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1.25rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(100px);
}

#toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 1.5rem 1.5rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero .tagline {
    font-size: 1.1rem;
  }

  .card {
    padding: 1.75rem;
    border-radius: 16px;
  }

  button {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    min-width: 120px;
  }

  .transform-tools button {
    min-width: 110px;
    font-size: 0.9rem;
  }

  #toast {
    left: 20px;
    right: 20px;
    bottom: 20px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .card {
    padding: 1.5rem;
  }

  button {
    width: 100%;
    margin: 0 0 0.5rem 0;
  }

  .transform-tools button {
    width: 100%;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}