:root {
    /* Default (Dark) Theme Colors using oklch */
    --bg-color: oklch(15% 0.02 250);
    --card-bg: oklch(25% 0.03 250 / 0.8);
    --accent-primary: oklch(70% 0.15 250);
    --accent-glow: oklch(70% 0.25 250 / 0.4);
    --text-main: oklch(95% 0.01 250);
    --text-muted: oklch(75% 0.02 250);
    --border-color: oklch(100% 0 0 / 0.1);
    
    /* Lotto Ball Colors (Traditional but modern shades) */
    --ball-1: oklch(75% 0.15 60);  /* Yellow */
    --ball-11: oklch(65% 0.18 240); /* Blue */
    --ball-21: oklch(60% 0.2 20);   /* Red */
    --ball-31: oklch(60% 0.05 250); /* Gray */
    --ball-41: oklch(65% 0.18 140); /* Green */

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow-deep: 0 10px 30px -10px oklch(0% 0 0 / 0.5), 0 4px 10px -5px oklch(0% 0 0 / 0.3);
    --shadow-lifted: 0 20px 40px -15px oklch(0% 0 0 / 0.6);
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg-color: oklch(98% 0.01 250);
    --card-bg: oklch(100% 0 0 / 0.9);
    --accent-primary: oklch(60% 0.15 250);
    --accent-glow: oklch(60% 0.2 250 / 0.2);
    --text-main: oklch(20% 0.02 250);
    --text-muted: oklch(45% 0.02 250);
    --border-color: oklch(0% 0 0 / 0.08);
    --shadow-deep: 0 10px 30px -10px oklch(0% 0 0 / 0.1), 0 4px 10px -5px oklch(0% 0 0 / 0.05);
    --shadow-lifted: 0 20px 40px -15px oklch(0% 0 0 / 0.15);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Noise Texture Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 1rem 2rem;
    position: relative;
}

.theme-switch-wrapper {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

.theme-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-deep);
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.hero-title span {
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Main Container */
#app-container {
    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem 4rem;
}

/* Zodiac Section */
.zodiac-section {
    margin-bottom: 2.5rem;
    padding: 0.5rem 0;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.zodiac-nav-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-deep);
    flex-shrink: 0;
}

.nav-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

[data-theme="dark"] .nav-btn:hover {
    color: var(--bg-color);
}

.zodiac-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scroll-snap-type: x mandatory;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    flex: 1;
}

.zodiac-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.zodiac-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 90px;
    scroll-snap-align: start;
    box-shadow: var(--shadow-deep);
}

.zodiac-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 20px -5px var(--accent-glow);
}

.zodiac-item.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -5px var(--accent-glow);
}

.zodiac-emoji {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.zodiac-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.zodiac-years {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    white-space: nowrap;
}

.zodiac-item.active .zodiac-name,
.zodiac-item.active .zodiac-years {
    color: oklch(100% 0 0);
}

[data-theme="dark"] .zodiac-item.active .zodiac-name,
[data-theme="dark"] .zodiac-item.active .zodiac-years {
    color: var(--bg-color);
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.primary-btn {
    background-color: var(--accent-primary);
    color: oklch(100% 0 0);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 0 0 var(--accent-glow);
}

[data-theme="dark"] .primary-btn {
    color: var(--bg-color);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px var(--accent-glow);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    container-type: inline-size;
}

.loading-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    font-style: italic;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive Grid for Large Screens */
@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Lotto Set Component Styles */
lotto-set {
    display: block;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-deep);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

lotto-set:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lifted);
}

.set-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
}

.set-index {
    background: var(--border-color);
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
}

.balls-container {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Lotto Ball Component Styles */
lotto-ball {
    --ball-size: clamp(35px, 8cqw, 50px);
    width: var(--ball-size);
    height: var(--ball-size);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 900;
    font-size: calc(var(--ball-size) * 0.45);
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    box-shadow: inset -4px -4px 8px rgba(0,0,0,0.3), 0 4px 10px rgba(0,0,0,0.3);
}

lotto-ball::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 30%;
    height: 30%;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    filter: blur(2px);
}

/* Ball Colors based on value */
lotto-ball[value^="0"], lotto-ball[value="10"] { background-color: var(--ball-1); }
lotto-ball[value^="1"]:not([value="10"]), lotto-ball[value="20"] { background-color: var(--ball-11); }
lotto-ball[value^="2"]:not([value="20"]), lotto-ball[value="30"] { background-color: var(--ball-21); }
lotto-ball[value^="3"]:not([value="30"]), lotto-ball[value="40"] { background-color: var(--ball-31); }
lotto-ball[value^="4"] { background-color: var(--ball-41); }
