/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #ffd700;
    --accent-hover: #ffb700;
}

[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: rgba(0, 0, 0, 0.03);
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --accent: #ffc107;
    --accent-hover: #e0a800;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: #000;
    padding: 8px 16px;
    z-index: 9999;
    text-decoration: none;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* Breadcrumb */
.breadcrumb {
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 15px 20px;
    font-size: 0.85rem;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb li:not(:last-child)::after {
    content: ">";
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text-secondary);
}

/* Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--accent);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover,
.theme-toggle:focus {
    transform: scale(1.1);
    outline: 2px solid var(--accent);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 15px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.hero .subtitle {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 40px;
    max-width: 600px;
}

.numbers-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
    min-height: 100px;
    align-items: center;
}

.number-ball {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 -5px 10px rgba(0, 0, 0, 0.2),
        inset 0 5px 10px rgba(255, 255, 255, 0.2);
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
    transform: scale(0);
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.number-ball.range-1-10 { background: linear-gradient(145deg, #ffd700, #ffb700); color: #333; }
.number-ball.range-11-20 { background: linear-gradient(145deg, #4dabf7, #339af0); }
.number-ball.range-21-30 { background: linear-gradient(145deg, #ff6b6b, #ee5a5a); }
.number-ball.range-31-40 { background: linear-gradient(145deg, #868e96, #6c757d); }
.number-ball.range-41-45 { background: linear-gradient(145deg, #51cf66, #40c057); }
.number-ball.bonus {
    background: linear-gradient(145deg, #be4bdb, #9c36b5);
    border: 3px solid var(--accent);
}

.placeholder {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.generate-btn {
    padding: 18px 50px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #1a1a2e;
    background: linear-gradient(145deg, #ffd700, #ffb700);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.generate-btn:hover,
.generate-btn:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
    outline: none;
}

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

.divider {
    width: 2px;
    height: 50px;
    background: rgba(255, 215, 0, 0.5);
    margin: 0 5px;
}

.bonus-label {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 8px;
}

/* History */
.history {
    margin-top: 50px;
    width: 100%;
    max-width: 500px;
}

.history h3 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1rem;
}

.history-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.history-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
}

.history-number.range-1-10 { background: #ffd700; color: #333; }
.history-number.range-11-20 { background: #4dabf7; }
.history-number.range-21-30 { background: #ff6b6b; }
.history-number.range-31-40 { background: #868e96; }
.history-number.range-41-45 { background: #51cf66; }
.history-number.bonus { background: #be4bdb; }

.history-divider {
    color: var(--accent);
    margin: 0 3px;
}

/* Section Styles */
section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

section h2 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    text-align: center;
    margin-bottom: 50px;
    color: var(--accent);
}

/* Info Section */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.info-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
    border: 1px solid rgba(255,215,0,0.1);
}

.info-card h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-card p, .info-card li {
    color: var(--text-secondary);
    line-height: 1.8;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.info-card li::before {
    content: "\2022";
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Statistics Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(255,215,0,0.1);
}

.stat-number {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: bold;
    color: var(--accent);
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Tips Section */
.tips-content {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 40px;
    border: 1px solid rgba(255,215,0,0.1);
}

.tip-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tip-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tip-item h4 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.tip-item p {
    color: var(--text-secondary);
}

/* FAQ Section */
.faq-item {
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,215,0,0.1);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
}

.faq-question::after {
    content: "+";
    font-size: 1.5rem;
    color: var(--accent);
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: 15px;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-question:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 20px 20px;
    color: var(--text-secondary);
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    align-items: center;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.about-features {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
}

.about-features h3 {
    color: var(--accent);
    margin-bottom: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-text {
    color: var(--text-secondary);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 60px 20px 30px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-section p, .footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer-section a:hover,
.footer-section a:focus {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Legal Pages */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 20px 60px;
}

.legal-content h1 {
    color: var(--accent);
    margin-bottom: 30px;
}

.legal-content h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin: 30px 0 15px;
    text-align: left;
}

.legal-content p, .legal-content li {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

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

.legal-content a {
    color: var(--accent);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn:focus {
    outline: 2px solid var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .number-ball {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }

    .breadcrumb {
        margin-top: 70px;
    }

    .tips-content {
        padding: 25px;
    }
}

/* Page specific */
.page-hidden {
    display: none;
}

/* Print styles */
@media print {
    header, footer, .generate-btn, .theme-toggle, .mobile-menu-btn {
        display: none;
    }
    body {
        background: white;
        color: black;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}
