@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;700&display=swap');

:root {
  --background-color: #f0f2f5;
  --container-bg: #ffffff;
  --title-color: #333;
  --text-color: #555;
  --button-bg: #4a90e2;
  --button-hover-bg: #357abd;
  --ball-color-1: #fbc400;
  --ball-color-2: #69c8f2;
  --ball-color-3: #ff7272;
  --ball-color-4: #aaa;
  --ball-color-5: #b0d840;
  --bg-gradient: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
}

body.dark {
  --background-color: #1a1a1a;
  --container-bg: #2d2d2d;
  --title-color: #e0e0e0;
  --text-color: #b0b0b0;
  --button-bg: #3a7bd5;
  --button-hover-bg: #2a5298;
  --bg-gradient: linear-gradient(120deg, #2d3436 0%, #000000 100%);
}

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

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--background-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  overflow-y: auto;
  background-image: var(--bg-gradient);
  transition: background 0.3s ease, color 0.3s ease;
  padding: 2rem 0;
}

.container {
  background: var(--container-bg);
  padding: 2rem 3rem;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 500px;
  width: 90%;
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  margin: auto;
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.3s ease;
  line-height: 1;
}

.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

body.dark .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.container:hover {
  transform: translateY(-5px);
}

h1 {
  color: var(--title-color);
  margin-bottom: 1rem;
  font-size: 2.5rem;
  font-weight: 700;
}

p {
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

#generate-btn {
  background: var(--button-bg);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#generate-btn:hover {
  background: var(--button-hover-bg);
  transform: translateY(-2px);
}

#generate-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

lotto-numbers {
  display: block;
  margin-top: 2rem;
}

.contact-section, .comments-section {
  margin-top: 3rem;
  padding-top: 1rem;
}

.contact-section hr, .comments-section hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

body.dark .contact-section hr, body.dark .comments-section hr {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--title-color);
}

.form-group {
  margin-bottom: 1rem;
}

.contact-section input,
.contact-section textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: var(--container-bg);
  color: var(--text-color);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.contact-section input:focus,
.contact-section textarea:focus {
  outline: none;
  border-color: var(--button-bg);
}

.contact-section textarea {
  height: 100px;
  resize: vertical;
}

#submit-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  width: 100%;
}

#submit-btn:hover {
  background: #218838;
  transform: translateY(-2px);
}

body.dark .contact-section input,
body.dark .contact-section textarea {
  border-color: #444;
}

.lotto-ball {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.5s ease-in-out, scaleUp 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  transform-origin: center;
}

/* Ball Colors */
.lotto-ball:nth-child(1) { background: var(--ball-color-1); }
.lotto-ball:nth-child(2) { background: var(--ball-color-2); }
.lotto-ball:nth-child(3) { background: var(--ball-color-3); }
.lotto-ball:nth-child(4) { background: var(--ball-color-4); }
.lotto-ball:nth-child(5) { background: var(--ball-color-5); }
.lotto-ball:nth-child(6) { background: var(--ball-color-1); }


@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleUp {
  from {
    transform: scale(0.5);
  }
  to {
    transform: scale(1);
  }
}
