:root {
    --bg-color: #f0f2f5;
    --bg-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d9d9d9' fill-opacity='0.4'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/svg%3E");
    --card-bg: linear-gradient(145deg, #ffffff, #e6e6e6);
    --card-shadow: 20px 20px 60px #d9d9d9, -20px -20px 60px #ffffff;
    --text-color: #333;
    --btn-bg: #008CBA;
    --btn-hover: #007BA2;
    --btn-shadow: 0 4px 15px 0 rgba(0, 140, 186, 0.75);
    --number-bg: #4CAF50;
    --number-text: white;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --bg-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23333333' fill-opacity='0.4'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/svg%3E");
    --card-bg: linear-gradient(145deg, #2c2c2c, #1e1e1e);
    --card-shadow: 20px 20px 60px #121212, -20px -20px 60px #222222;
    --text-color: #f0f2f5;
    --btn-bg: #4CAF50;
    --btn-hover: #45a049;
    --btn-shadow: 0 4px 15px 0 rgba(76, 175, 80, 0.75);
    --number-bg: #008CBA;
}

body {
    font-family: 'Montserrat', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 20px 0;
    background-color: var(--bg-color);
    background-image: var(--bg-image);
    transition: background-color 0.3s ease, background-image 0.3s ease;
}

.lotto-machine {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 30px;
    width: 100%;
    max-width: 500px;
}

.charts-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    box-sizing: border-box;
}

.chart-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 550px;
    text-align: center;
    transition: all 0.3s ease;
    flex: 1 1 300px; /* Allow containers to shrink/grow but maintain minimum width */
}

.chart-container h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.5em;
    transition: color 0.3s ease;
}

.tradingview-widget-container {
    height: 400px;
    width: 100%;
}

h1 {
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 2.5em;
    transition: color 0.3s ease;
}

.numbers-display {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    min-height: 80px;
}

.number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--number-bg);
    color: var(--number-text);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0 10px;
    animation: pop-in 0.5s ease-out forwards;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

#generator-btn {
    background-color: var(--btn-bg);
    color: white;
    border: none;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: var(--btn-shadow);
}

#generator-btn:hover {
    background-color: var(--btn-hover);
    transform: translateY(-2px);
}

/* Theme Toggle Button Styles */
.theme-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s ease;
}

@keyframes pop-in {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}
