/* CSS Variables for theme */
:root {
    --text-color: #333;
    --background-color: #f8f9fa;
    --header-background: #fff;
    --shadow-color: rgba(0,0,0,0.1);
    --hero-gradient-start: #f5f9ff;
    --hero-gradient-end: #e0edff;
    --card-background: #fdfdfd;
    --card-border: #eee;
    --footer-background: #333;
    --footer-text-color: #fff;
    --primary-color: #0066ff;
    --primary-hover-color: #004ecc;
    --image-placeholder-background: #eee;
    --image-placeholder-color: #999;
}

body.dark-mode {
    --text-color: #f8f9fa;
    --background-color: #212529;
    --header-background: #343a40;
    --shadow-color: rgba(255,255,255,0.1);
    --hero-gradient-start: #2b3035;
    --hero-gradient-end: #343a40;
    --card-background: #495057;
    --card-border: #6c757d;
    --footer-background: #212529;
    --footer-text-color: #f8f9fa;
    /* Primary colors can remain the same or be adjusted for dark mode contrast */
    --primary-color: #66b0ff;
    --primary-hover-color: #4da6ff;
    --image-placeholder-background: #6c757d;
    --image-placeholder-color: #dee2e6;
}

/* 기본 스타일 초기화 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}
a { text-decoration: none; color: inherit; }

/* 헤더 */
header {
    background: var(--header-background);
    padding: 1rem 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.logo { font-size: 1.5rem; font-weight: bold; color: var(--primary-color); }
nav ul { display: flex; list-style: none; }
nav ul li { margin-left: 2rem; font-weight: 500; }

/* Theme Toggle Button */
.theme-toggle-button {
    background: var(--primary-color);
    color: var(--footer-text-color); /* Using footer text color for contrast */
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease, color 0.3s ease;
}

.theme-toggle-button:hover {
    background: var(--primary-hover-color);
}

/* 히어로 섹션 */
.hero {
    padding: 150px 10% 80px;
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    text-align: center;
    transition: background 0.3s ease;
}
.hero h1 { font-size: 3rem; margin-bottom: 1.5rem; color: var(--text-color); }
.hero p { font-size: 1.2rem; color: var(--text-color); margin-bottom: 2rem; }
.btn-main {
    background: var(--primary-color);
    color: var(--footer-text-color);
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    display: inline-block;
    transition: 0.3s;
}
.btn-main:hover { background: var(--primary-hover-color); transform: translateY(-3px); }

/* 특징 섹션 */
.features { padding: 80px 10%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.feature-card {
    padding: 40px;
    background: var(--card-background);
    border-radius: 20px;
    border: 1px solid var(--card-border);
    text-align: center;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover { box-shadow: 0 10px 30px var(--shadow-color); }
.feature-card h3 { margin: 20px 0; color: var(--primary-color); }

/* 공추첨게임 섹션 */
.lottery-game {
    padding: 80px 10%;
    text-align: center;
    background-color: var(--background-color);
    transition: background-color 0.3s ease;
}

.lottery-game h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.lottery-game p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.lottery-controls {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.lottery-controls label {
    font-weight: bold;
    color: var(--text-color);
}

.lottery-controls input[type="number"] {
    padding: 10px 15px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background-color: var(--card-background);
    color: var(--text-color);
    width: 80px;
    text-align: center;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.lottery-controls input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.lottery-results {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    min-height: 80px; /* Ensure space for results */
    align-items: center;
}

.lottery-ball {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: var(--footer-text-color);
    font-size: 1.8rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

/* 상세 설명 섹션 */
.details {
    padding: 80px 10%;
    background: var(--background-color);
    transition: background-color 0.3s ease;
}
.details-content { display: flex; align-items: center; justify-content: space-between; gap: 50px; }
.details-text { flex: 1; }
.details-image {
    flex: 1;
    background: var(--image-placeholder-background);
    height: 300px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--image-placeholder-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 푸터 */
footer {
    background: var(--footer-background);
    color: var(--footer-text-color);
    padding: 40px 10%;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.footer-info { font-size: 0.9rem; opacity: 0.7; }

/* 반응형 */
@media (max-width: 768px) {
    .features { grid-template-columns: 1fr; }
    .details-content { flex-direction: column; }
    .hero h1 { font-size: 2rem; }
    .lottery-controls { flex-direction: column; }
}
