:root {
  --bg-color: #f0f2f5;
  --container-bg: white;
  --text-color: #333;
  --ball-placeholder-bg: #ddd;
  --ball-placeholder-text: #999;
  --shadow: rgba(0,0,0,0.1);
  --btn-bg: #4a90e2;
  --btn-hover: #357abd;
  --input-bg: #ffffff;
  --input-border: #ddd;
  --divider: #eee;
  --nav-bg: #ffffff;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --container-bg: #2d2d2d;
  --text-color: #f0f0f0;
  --ball-placeholder-bg: #444;
  --ball-placeholder-text: #777;
  --shadow: rgba(0,0,0,0.3);
  --btn-bg: #357abd;
  --btn-hover: #4a90e2;
  --input-bg: #3d3d3d;
  --input-border: #555;
  --divider: #444;
  --nav-bg: #2d2d2d;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
  display: block; /* Flex 제거 (Nav 때문) */
}

/* Navbar */
.navbar {
  background-color: var(--nav-bg);
  box-shadow: 0 2px 10px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s;
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--btn-bg);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-menu a:hover {
  color: var(--btn-bg);
}

/* Main Container */
.main-content {
  margin-top: 3rem;
  margin-bottom: 5rem;
}

.container {
  position: relative;
  text-align: center;
  background: var(--container-bg);
  padding: 3rem 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 25px var(--shadow);
  width: 90%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

#theme-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background-color 0.2s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#theme-btn:hover {
  background-color: var(--bg-color);
}

h1 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--ball-placeholder-text);
  margin-bottom: 2rem;
}

.lotto-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.ball {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: bold;
  font-size: 1.3rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}

.ball:hover {
  transform: scale(1.15);
}

.placeholder {
  background-color: var(--ball-placeholder-bg);
  color: var(--ball-placeholder-text);
}

/* 로또 공 색상 규격 */
.ball-10 { background-color: #fbc400; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.ball-20 { background-color: #69c8f2; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.ball-30 { background-color: #ff7272; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.ball-40 { background-color: #aaaaaa; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.ball-45 { background-color: #b0d840; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

#generate-btn {
  background-color: var(--btn-bg);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

#generate-btn:hover {
  background-color: var(--btn-hover);
}

#generate-btn:active {
  transform: scale(0.97);
}

.buy-btn {
  display: inline-block;
  margin-top: 1rem;
  background-color: #ff9f43;
  color: white;
  text-decoration: none;
  padding: 15px 40px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 12px;
  transition: background-color 0.2s, transform 0.1s;
  margin-left: 10px;
}

.buy-btn:hover {
  background-color: #ee5253;
}

.buy-btn:active {
  transform: scale(0.97);
}

/* Info Section */
.info-section {
  text-align: left;
  line-height: 1.8;
}

.info-section article {
  margin-bottom: 2rem;
}

.info-section h2 {
  font-size: 1.5rem;
  color: var(--btn-bg);
  margin-bottom: 1rem;
}

.divider {
  border: 0;
  height: 1px;
  background: var(--divider);
  margin: 3rem 0;
}

/* Contact Section */
.contact-section h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.contact-section p {
  color: var(--ball-placeholder-text);
  margin-bottom: 2rem;
}

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

.form-group input, 
.form-group textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background-color: var(--input-bg);
  color: var(--text-color);
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group textarea:focus {
  border-color: var(--btn-bg);
}

.form-group textarea {
  height: 120px;
  resize: vertical;
}

.submit-btn {
  width: 100%;
  background-color: var(--btn-bg);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.submit-btn:hover {
  opacity: 0.9;
}

.btn-home {
  display: inline-block;
  margin-top: 2rem;
  padding: 10px 20px;
  background-color: var(--btn-bg);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.btn-home:hover {
  opacity: 0.9;
}

/* Legal Content */
.legal-content {
  text-align: left;
}

.legal-content h1 {
  text-align: center;
  margin-bottom: 2rem;
}

/* Footer */
.footer {
  background-color: var(--nav-bg);
  padding: 3rem 1.5rem;
  margin-top: 5rem;
  box-shadow: 0 -2px 10px var(--shadow);
  transition: background-color 0.3s;
}

.footer-container {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  padding: 0;
}

.footer-links a {
  text-decoration: none;
  color: var(--ball-placeholder-text);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--btn-bg);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  .nav-menu {
    display: none; /* 단순화를 위해 모바일 메뉴는 생략 */
  }
  .container {
    padding: 2rem 1.5rem;
  }
  .ball {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
}
