:root {
  --bg-color: #f8f9fa;
  --container-bg: #ffffff;
  --text-color: #212529;
  --h1-color: #1a1a1a;
  --primary-color: #4267b2;
  --secondary-color: #4caf50;
  --card-hover: #f1f3f5;
  --border-color: #e9ecef;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --header-bg: #ffffff;
}

[data-theme="dark"] {
  --bg-color: #121212;
  --container-bg: #1e1e1e;
  --text-color: #e0e0e0;
  --h1-color: #ffffff;
  --primary-color: #3b82f6;
  --secondary-color: #10b981;
  --card-hover: #2a2a2a;
  --border-color: #333333;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --header-bg: #1e1e1e;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s;
  min-height: 100vh;
  line-height: 1.6;
}

/* Header */
.main-header {
  background-color: var(--header-bg);
  padding: 10px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.header-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 800;
}

.header-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Container */
.container {
  max-width: 800px;
  margin: 30px auto;
  padding: 0 20px;
  min-height: calc(100vh - 250px);
}

.view {
  animation: fadeIn 0.4s ease;
}

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

.hidden { display: none !important; }

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 40px 0;
}

.hero-section h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--h1-color);
  line-height: 1.2;
}

.hero-section p {
  font-size: 1.15rem;
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
}

/* Content Box */
.content-box {
  background-color: var(--card-hover);
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 30px;
  font-size: 0.95rem;
  border-left: 5px solid var(--primary-color);
}

.content-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* Info Content */
.info-content {
  text-align: left;
  background-color: var(--container-bg);
  padding: 30px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.info-content h3 {
  margin-top: 25px;
  color: var(--primary-color);
}

.info-content ul {
  padding-left: 20px;
}

.info-content li {
  margin-bottom: 10px;
}

/* Home View - Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.tool-card {
  background-color: var(--container-bg);
  padding: 30px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.tool-card:hover {
  transform: translateY(-5px);
  background-color: var(--card-hover);
}

.card-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
}

.btn-text {
    margin-top: auto;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

/* Animal Test Styles */
.upload-area {
  margin: 20px auto;
  border: 2px dashed var(--primary-color);
  border-radius: 20px;
  padding: 40px;
  cursor: pointer;
  background-color: var(--container-bg);
  transition: border-color 0.2s;
}

.upload-area:hover {
    border-color: var(--secondary-color);
}

.image-preview-container img {
  max-width: 100%;
  max-height: 350px;
  border-radius: 12px;
}

.label-container div {
  background-color: var(--container-bg);
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

/* Lotto Styles */
.lotto-numbers {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 40px 0;
}

.lotto-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lotto-number {
  width: 45px;
  height: 45px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  animation: ballPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.lotto-number.bonus { background-color: var(--secondary-color); }

@keyframes ballPop {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.secondary-btn {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 18px 40px;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  transition: transform 0.2s;
}

.secondary-btn:active {
    transform: scale(0.98);
}

/* Footer */
.main-footer {
  background-color: var(--header-bg);
  padding: 50px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 80px;
  text-align: center;
}

.footer-nav { margin-bottom: 15px; }

.footer-nav a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
  margin: 0 15px;
  font-weight: 500;
}

.footer-nav a:hover { color: var(--primary-color); }

.footer-email {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 10px;
}

/* Contact & Comments */
.contact-section, .comments-section {
    margin-top: 60px;
}

.contact-section h3, .comments-section h3 {
  margin-bottom: 20px;
  color: var(--h1-color);
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--container-bg);
  color: var(--text-color);
  box-sizing: border-box;
  margin-bottom: 12px;
  font-size: 1rem;
}

.submit-btn {
  width: 100%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
}

@media (max-width: 600px) {
  .hero-section h1 { font-size: 2rem; }
  .header-nav { display: none; }
  .card-grid { grid-template-columns: 1fr; }
}
