
:root {
    /* Color Palette - Light Mode */
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #2b2d42;
    --text-muted: #8d99ae;
    --border-color: #e9ecef;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 1px 8px rgba(0, 0, 0, 0.02);

    /* Lotto Colors */
    --lotto-1: #fbc02d; /* 1-10 */
    --lotto-11: #1976d2; /* 11-20 */
    --lotto-21: #e53935; /* 21-30 */
    --lotto-31: #757575; /* 31-40 */
    --lotto-41: #43a047; /* 41-45 */
}

body.dark-mode {
    --primary-color: #4895ef;
    --background-color: #0b0d17;
    --card-bg: #1a1c2e;
    --text-color: #edf2f4;
    --text-muted: #94a3b8;
    --border-color: #2d3748;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 1px 8px rgba(0, 0, 0, 0.2);
}

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        --primary-color: #4895ef;
        --background-color: #0b0d17;
        --card-bg: #1a1c2e;
        --text-color: #edf2f4;
        --text-muted: #94a3b8;
        --border-color: #2d3748;
        --shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 1px 8px rgba(0, 0, 0, 0.2);
    }
}

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

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    transition: all 0.3s ease;
    min-height: 100vh;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#theme-toggle-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.6rem;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

#theme-toggle-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

main {
    flex-grow: 1;
}

.card {
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    text-align: center;
}

.card-header {
    margin-bottom: 2rem;
}

.card-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.lotto-numbers-container {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin: 2.5rem 0;
    min-height: 60px;
    align-items: center;
}

.placeholder-text {
    color: var(--text-muted);
    font-style: italic;
    font-size: 1rem;
}

.lotto-ball {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: inset -4px -4px 8px rgba(0,0,0,0.2), 0 4px 10px rgba(0,0,0,0.1);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
    background: radial-gradient(circle at 30% 30%, #ffffff33, #00000033);
}

@keyframes popIn {
    from { transform: scale(0) rotate(-180deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

/* Ball colors by range */
.ball-1-10 { background-color: var(--lotto-1); }
.ball-11-20 { background-color: var(--lotto-11); }
.ball-21-30 { background-color: var(--lotto-21); }
.ball-31-40 { background-color: var(--lotto-31); }
.ball-41-45 { background-color: var(--lotto-41); }

.generate-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 auto;
    box-shadow: 0 8px 16px rgba(67, 97, 238, 0.3);
}

.generate-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(67, 97, 238, 0.4);
}

.generate-button:active {
    transform: translateY(-1px);
}

.history-section {
    margin-top: 2rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding: 0 0.5rem;
}

.section-title h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

.text-btn:hover {
    color: var(--primary-color);
}

.history-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.history-balls {
    display: flex;
    gap: 0.5rem;
}

.history-ball {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.history-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.empty-history {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .app-container { padding: 1rem; }
    .card { padding: 1.5rem; }
    .lotto-ball { width: 42px; height: 42px; font-size: 1.1rem; }
    .card-header h2 { font-size: 1.5rem; }
    header h1 { font-size: 1.3rem; }
}
