:root {
    --sidebar-width: 240px;
    --banner-height: 150px;
    --primary-color: #4A90E2;
    --light-gray: #f4f4f9;
    --dark-gray: #333;
    --text-color: #444;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.banner-container {
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    height: var(--banner-height);
    flex-shrink: 0;
}

.page-body-container {
    display: flex;
    flex-grow: 1;
    overflow: hidden; /* Keep horizontal overflow hidden */
}

.sidebar {
    background-color: #fff;
    padding: 20px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    width: var(--sidebar-width);
    flex-shrink: 0;
    box-sizing: border-box;
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    text-align: center;
    margin-bottom: 30px;
}

.main-nav ul { list-style: none; padding: 0; margin: 0; }
.main-nav li { margin-bottom: 15px; }
.main-nav a {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: bold;
    font-size: 1.1em;
    padding: 10px 15px;
    display: block;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}
.main-nav a:hover { background-color: var(--primary-color); color: white; }

.content-area {
    padding: 20px;
    overflow-y: auto; /* Allow vertical scrolling */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex-grow: 1;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.title-container { text-align: center; margin-bottom: 10px; /* Reduced margin */ }
.intro-text { max-width: 600px; text-align: center; margin-bottom: 20px; font-size: 1.1em; color: #555; }
h1 { font-size: 2em; color: var(--primary-color); margin: 0; }
h2 { font-size: 1.5em; color: #555; margin: 0; }

#generate, #regenerate {
    padding: 12px 25px;
    font-size: 18px;
    cursor: pointer;
    margin-bottom: 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s, opacity 0.3s;
}
#generate:hover, #regenerate:hover { background-color: #45a049; }
#regenerate:disabled { background-color: #a5d6a7; cursor: not-allowed; opacity: 0.7; }

#result {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}
.lotto-set {
    display: flex;
    margin-bottom: 15px; /* Reverted */
    padding: 15px; /* Reverted */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: white;
    flex-wrap: wrap;
    justify-content: center;
}
.lotto-number {
    width: 50px; /* Reverted */
    height: 50px; /* Reverted */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px; /* Reverted */
    font-weight: bold;
    font-size: 1.4em; /* Reverted */
    color: #fff;
    background-color: rgba(0, 0, 0, 0.2);
}
.lotto-set:last-child .lotto-number:last-child { margin-right: 0; }
#regenerate-notice { font-size: 0.9em; color: #777; margin-bottom: 10px; }

/* Colors */
.color-1 { background-color: #D32F2F; } .color-2 { background-color: #388E3C; } .color-3 { background-color: #1976D2; } .color-4 { background-color: #FBC02D; } .color-5 { background-color: #8E24AA; }
.color-4 .lotto-number { color: #000; background-color: rgba(255, 255, 255, 0.5); }

.lotto-number.blue-ball {
    background-color: #4A90E2; /* Blue color for the special ball */
    margin-left: 10px; /* Add extra space before the blue ball */
}

.blue-ball-placeholder {
    margin-left: 10px;
    background-color: rgba(0, 0, 0, 0.1);
}

.lotto-set-separator {
    display: flex;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    margin: 0 10px;
}

/* Content page styles (for articles) */
.content-container { 
    width: 100%; 
    max-width: 800px; 
    background-color: #fff; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.05); 
    box-sizing: border-box;
}
.content-container h1 { border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }
.content-container p, .content-container li { line-height: 1.8; color: var(--text-color); }
.content-container ul { padding-left: 20px; }

.lottery-rules-table {
    margin-bottom: 30px;
}

.rules-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9em;
}

.rules-table th, .rules-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.rules-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.rules-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.rules-table tr:hover {
    background-color: #f1f1f1;
}

.main-footer {
    width: 100%;
    background-color: var(--dark-gray);
    color: #fff;
    padding: 20px 0;
    text-align: center;
    margin-top: auto; /* Push footer to bottom of scrolling content */
}
.footer-content { width: 90%; max-width: 1200px; margin: 0 auto; }
.footer-links a { color: #fff; text-decoration: none; margin: 0 15px; transition: color 0.3s; }
.footer-links a:hover { color: var(--primary-color); }
.footer-content p { margin-top: 15px; font-size: 0.9em; color: #ccc; }

/* UI Switchers */
.lang-switcher, .mode-switcher {
    margin-bottom: 20px;
    text-align: center;
}

#lang-select, #mode-select {
    padding: 8px;
    width: 100%;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    font-weight: bold;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        display: flex;
        flex-direction: column;
        height: auto; /* Allow body to grow with content */
        padding-bottom: 60px; /* Adjust based on sidebar height */
    }
    .page-body-container {
        flex-direction: column;
        flex-grow: 1;
    }
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-right: none;
        border-top: 1px solid #ddd;
        padding: 5px 0;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        height: 60px;
        overflow-y: hidden;
        width: 100%;
        z-index: 1000;
        background: #fff;
    }
    .content-area {
        padding: 15px;
        overflow-y: visible; /* Allow content to flow */
    }
    .main-footer {
        display: block; /* Re-show the footer */
        padding: 5px 0; /* Reduced padding for compact footer */
    }
    .footer-content p {
        margin-top: 5px; /* Reduced margin */
        font-size: 0.7em; /* Reduced font size */
    }
    .banner-container {
        font-size: 1.5em; /* Smaller banner text on mobile */
        height: 50px; /* Smaller banner on mobile */
    }
    .sidebar .logo {
        display: none;
    }
    .main-nav ul {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-around;
        width: 100%;
    }
    .main-nav li {
        margin: 0;
    }
    .main-nav a {
        padding: 8px 10px;
        font-size: 0.8em;
    }
    .intro-text { /* Added for 768px breakpoint */
        margin-bottom: 10px;
    }
    .lotto-set {
        margin-bottom: 8px; /* Reduced margin */
        padding: 8px; /* Reduced padding */
    }
    .lotto-number {
        width: 40px;
        height: 40px;
        font-size: 1.1em;
        margin-right: 8px;
        margin-bottom: 8px;
    }
    .content-container {
        overflow-y: visible;
        height: auto;
    }
}

@media (max-width: 600px) {
    body {
        padding-bottom: 55px;
    }
    .sidebar {
        height: 55px;
    }
    .banner-container {
        font-size: 1em; /* Even smaller banner text on very small screens */
        height: 40px; /* Even smaller banner on very small screens */
    }
    .content-area {
        padding: 10px;
    }
    h1 { font-size: 1.5em; }
    h2 { font-size: 1.1em; }
    .intro-text { /* Added for 600px breakpoint */
        margin-bottom: 5px;
    }
    .lotto-set {
        margin-bottom: 5px; /* Even more reduced margin */
        padding: 5px; /* Even more reduced padding */
    }
    .lotto-number {
        width: 35px;
        height: 35px;
        font-size: 1em;
        margin-right: 5px;
        margin-bottom: 5px;
    }
    .main-nav a {
        font-size: 0.7em;
    }
    .main-footer {
        padding: 3px 0; /* Even more reduced padding */
    }
    .footer-content p {
        margin-top: 3px; /* Even more reduced margin */
        font-size: 0.6em; /* Even more reduced font size */
    }
}
