/* Root variables for theme colors */
:root {
  --bg-start: #a7c7e7;
  --bg-end: #dcedc1;
  --container-bg: rgba(255, 255, 255, 0.95);
  --text-color: #1f2937;
  --input-bg: #f9fafb;
  --input-border: #e5e7eb;
  --input-focus: #3b82f6;
  --button-bg-start: #3b82f6;
  --button-bg-end: #1d4ed8;
  --border-gradient: linear-gradient(45deg, #3b82f6, #1d4ed8);
}

/* Dark mode variables */
[data-theme="dark"] {
  --bg-start: #1e293b;
  --bg-end: #475569;
  --container-bg: rgba(30, 41, 59, 0.95);
  --text-color: #e2e8f0;
  --input-bg: #2d3748;
  --input-border: #4b5563;
  --input-focus: #60a5fa;
  --button-bg-start: #60a5fa;
  --button-bg-end: #2563eb;
  --border-gradient: linear-gradient(45deg, #60a5fa, #2563eb);
}

/* General body styling with animated gradient background */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  background-size: 400%;
  animation: gradient 15s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  color: var(--text-color);
  transition: all 0.3s ease;
}

/* Animated gradient background */
@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Heading styling */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  text-align: center;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Container with decorative border */
#container {
  background: var(--container-bg);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  max-width: 400px;
  width: 90%;
  border: 3px solid;
  border-image: var(--border-gradient) 1;
}

/* Input styling with centered placeholder */
#text-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid var(--input-border);
  border-radius: 12px;
  margin-bottom: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: var(--input-bg);
  color: var(--text-color);
  text-align: center;
}

#text-input::placeholder {
  text-align: center;
  color: #6b7280;
}

#text-input:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Button styling with gradient and hover animation */
#check-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(to right, var(--button-bg-start), var(--button-bg-end));
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#check-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#check-btn:active {
  transform: translateY(0);
}

/* Result message styling with fade-in animation */
#result {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
  text-align: center;
  animation: fadeIn 0.5s ease-in-out;
}

/* Fade-in animation for result */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toggle button styling */
#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(to right, var(--button-bg-start), var(--button-bg-end));
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#theme-toggle:active {
  transform: translateY(0);
}

/* Responsive design for smaller screens */
@media (max-width: 480px) {
  #container {
    padding: 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  #text-input,
  #check-btn,
  #theme-toggle {
    font-size: 14px;
  }

  #result {
    font-size: 16px;
  }

  #theme-toggle {
    top: 10px;
    right: 10px;
    padding: 8px 16px;
  }
}