:root {
  --primary-accent: #6366f1; /* Indigo 500 */
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --secondary-accent: #ec4899; /* Pink 500 */
  --bg-color: #f3f4f6;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --danger-color: #ef4444;
  --success-color: #10b981;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  background-image: radial-gradient(
      at 0% 0%,
      rgba(99, 102, 241, 0.15) 0px,
      transparent 50%
    ),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Loading Screen */
/* Landing Page */
#landingPage {
  position: fixed;
  inset: 0;
  background: var(--primary-gradient);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.landing-content {
  text-align: center;
  color: white;
  animation: fadeIn 1s ease-out;
}

#landingLogo {
  width: 140px;
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  animation: float 3s ease-in-out infinite;
}

.landing-title {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: -1px;
}

.landing-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  font-weight: 400;
  margin: 0;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Main Layout */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Card Styles with Glassmorphism */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 2rem;
}

header {
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.025em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Input Area */
.input-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
  background: white;
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
  border: 2px solid transparent;
}

.input-wrapper:focus-within {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  border-color: var(--primary-accent);
}

textarea {
  width: 100%;
  min-height: 200px;
  border: none;
  resize: vertical;
  padding: 1rem;
  font-family: inherit;
  font-size: 1.1rem;
  color: var(--text-primary);
  background: transparent;
  outline: none;
  line-height: 1.6;
}

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

.char-counter {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  pointer-events: none;
}

/* Controls */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  gap: 1rem;
}

.btn-group {
  display: flex;
  gap: 0.75rem;
}

button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--text-secondary);
  border-color: #e5e7eb;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: var(--text-primary);
}

.icon {
  width: 18px;
  height: 18px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

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

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.stat-icon-bg {
  padding: 0.5rem;
  background: #eff6ff;
  border-radius: 0.5rem;
  color: var(--primary-accent);
  display: grid;
  place-items: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

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

/* Responsive */
@media (max-width: 768px) {
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

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

  button {
    justify-content: center;
  }

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

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
