:root {
  /* Light mode (default) */
  --primary-color: #ff6b6b;
  --secondary-color: #4ecdc4;
  --bg-color: #f7f9fc;
  --container-bg: #ffffff;
  --text-color: #2d3436;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --glow-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
  --dot-color: #cbd5e0;
}

[data-theme="dark"] {
  --primary-color: #ff8e8e;
  --secondary-color: #5ce6dc;
  --bg-color: #1a1b1e;
  --container-bg: #2d3436;
  --text-color: #f7f9fc;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --glow-shadow: 0 0 25px rgba(255, 107, 107, 0.6);
  --dot-color: #4a5568;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans KR', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
  background-image: radial-gradient(var(--dot-color) 0.5px, transparent 0.5px);
  background-size: 20px 20px;
}

.theme-toggle-container {
  position: fixed;
  top: 20px;
  right: 20px;
}

.icon-button {
  background: var(--container-bg);
  border: none;
  font-size: 1.5rem;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
}

.icon-button:hover {
  transform: scale(1.1);
}

.container {
  width: 90%;
  max-width: 600px;
  padding: 40px;
  background: var(--container-bg);
  border-radius: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, background-color 0.3s ease;
  margin: 20px;
}

.hero-text {
  font-size: 3rem;
  margin-bottom: 2rem;
  font-weight: 700;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glow-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.glow-button:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: var(--glow-shadow);
}

.glow-button:active {
  transform: scale(0.95);
}

.image-wrapper {
  margin-top: 2rem;
  width: 100%;
  max-width: 100%;
  min-height: 200px;
  aspect-ratio: 3 / 2; /* Maintain a nice shape */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: var(--shadow);
  background: rgba(128, 128, 128, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.image-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This keeps it inside without overflow */
  border-radius: 16px;
}

.error-text {
  color: #e53e3e;
  font-weight: 700;
  font-size: 1.5rem;
  animation: shake 0.5s ease-in-out;
  padding: 20px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

@media (max-width: 480px) {
  .hero-text {
    font-size: 2rem;
  }
  .container {
    padding: 20px;
  }
}
