
:root {
    --bg-color: #f0f0f0;
    --container-bg-color: #fff;
    --text-color: #000;
    --number-bg-color: #eee;
    --button-bg-color: #4CAF50;
    --button-text-color: white;
}

body.dark-mode {
    --bg-color: #121212;
    --container-bg-color: #1e1e1e;
    --text-color: #fff;
    --number-bg-color: #333;
    --button-bg-color: #5a5a5a;
    --button-text-color: #fff;
}


body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    width: 100%;
    background-color: var(--container-bg-color);
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--button-bg-color);
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--button-bg-color);
}

/* Main Container */
.container {
    background-color: var(--container-bg-color);
    padding: 3rem 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    text-align: center;
    margin-top: 2rem;
    max-width: 600px;
    width: 90%;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
}

body.dark-mode .subtitle {
    color: #aaa;
}

/* Content Sections */
.content-section, .content-page {
    max-width: 800px;
    width: 90%;
    margin: 3rem auto;
    padding: 0 1rem;
}

.content-section article {
    margin-bottom: 2rem;
    background-color: var(--container-bg-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

h2 {
    color: var(--button-bg-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    margin-top: auto;
    padding: 2rem;
    text-align: center;
    width: 100%;
    background-color: var(--container-bg-color);
    font-size: 0.9rem;
    color: #888;
}

footer a {
    color: var(--button-bg-color);
    text-decoration: none;
}

/* Toggle Button Position */
#theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    margin: 0;
    z-index: 100;
    background-color: var(--container-bg-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

h1 {
    margin-top: 0;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.numbers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 2rem 0;
}

.num-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--number-bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: inset 0 -2px 5px rgba(0,0,0,0.1);
    border: 3px solid transparent;
}

/* Hot Number Effect */
.number.hot {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    border-color: #ff6b6b;
    color: #c92a2a;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
}

/* Cold Number Effect */
.number.cold {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    border-color: #74c0fc;
    color: #1864ab;
    box-shadow: 0 0 15px rgba(116, 192, 252, 0.4);
}

.stat-badge {
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.8;
    height: 1.2em; /* Reserve space */
}

#generate {
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

#generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

#generate:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Legend Section */
.legend-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

body.dark-mode .legend-container {
    border-top-color: rgba(255,255,255,0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.hot {
    background: linear-gradient(135deg, #ff9a9e 0%, #ff6b6b 100%);
    box-shadow: 0 0 5px rgba(255, 107, 107, 0.4);
}

.dot.cold {
    background: linear-gradient(135deg, #a1c4fd 0%, #74c0fc 100%);
    box-shadow: 0 0 5px rgba(116, 192, 252, 0.4);
}

.legend-desc {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}

/* Historical Analysis Section */
.history-analysis {
    width: 100%;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(0,0,0,0.1);
    text-align: left;
    animation: fadeIn 0.5s ease-out;
}

body.dark-mode .history-analysis {
    border-top-color: rgba(255,255,255,0.1);
}

.history-analysis.hidden {
    display: none;
}

.history-analysis h3 {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-align: center;
    opacity: 0.8;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-color);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.history-info {
    display: flex;
    flex-direction: column;
}

.history-round {
    font-weight: bold;
    color: var(--text-color);
}

.history-date {
    font-size: 0.75rem;
    color: #888;
}

.rank-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    min-width: 60px;
    text-align: center;
}

.rank-1 { background: linear-gradient(135deg, #FFD700, #FDB931); color: #8a6d0b; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
.rank-2 { background: linear-gradient(135deg, #E0E0E0, #BDBDBD); color: #555; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #b87333); }
.rank-4 { background-color: #4CAF50; }
.rank-5 { background-color: #2196F3; }
.rank-fail { background-color: #9e9e9e; }

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

.number.small {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

.search-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

#drwNoInput {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    width: 150px;
}

.lotto-result {
    margin-top: 1.5rem;
    text-align: center;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 10px;
}

.lotto-result.hidden {
    display: none;
}

.bonus-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
    font-weight: bold;
}

.number.bonus {
    border: 2px solid var(--button-bg-color);
}

