:root {
    --bg-gradient: linear-gradient(135deg, #1a1a2e, #16213e);
    --container-bg: rgba(255, 255, 255, 0.05);
    --text-color: #ffffff;
    --button-bg: #e94560;
    --button-shadow: rgba(233, 69, 96, 0.4);
    --border-color: rgba(255, 255, 255, 0.1);
    --ball-shadow: rgba(0, 0, 0, 0.3);
}

body.light-mode {
    --bg-gradient: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    --container-bg: rgba(255, 255, 255, 0.8);
    --text-color: #2d3436;
    --button-bg: #6c5ce7;
    --button-shadow: rgba(108, 92, 231, 0.3);
    --border-color: rgba(0, 0, 0, 0.05);
    --ball-shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 40px 0;
    margin: 0;
    background: var(--bg-gradient);
    transition: background 0.5s ease;
}

.container {
    background-color: var(--container-bg);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    max-width: 600px;
    width: 90%;
    transition: all 0.3s ease;
}

.theme-switch-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

#theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    background-color: var(--container-bg);
}

#theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}

h1 {
    color: var(--text-color);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 30px;
    transition: color 0.3s ease;
}

.lotto-numbers {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.lotto-ball {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    box-shadow: 0 6px 12px var(--ball-shadow);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

/* Color scheme for lotto balls */
.lotto-ball[data-number-group="1"] { background: linear-gradient(135deg, #fbc400, #f39c12); }
.lotto-ball[data-number-group="2"] { background: linear-gradient(135deg, #69c8f2, #3498db); }
.lotto-ball[data-number-group="3"] { background: linear-gradient(135deg, #ff7171, #e74c3c); }
.lotto-ball[data-number-group="4"] { background: linear-gradient(135deg, #aaaaaa, #7f8c8d); }
.lotto-ball[data-number-group="5"] { background: linear-gradient(135deg, #b0d840, #27ae60); }


#generate-btn {
    background-color: var(--button-bg);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px var(--button-shadow);
}

#generate-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 12px 25px var(--button-shadow);
}

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

.animal-test-section h2 {
    color: var(--text-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 25px;
}

.upload-container {
    margin-bottom: 20px;
}

.upload-label {
    display: block;
    cursor: pointer;
}

#image-preview-container {
    width: 100%;
    min-height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: var(--container-bg);
    transition: all 0.3s ease;
}

#image-preview-container:hover {
    border-color: var(--button-bg);
}

#upload-placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

#image-preview {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

#loading-spinner {
    color: var(--text-color);
    margin: 20px 0;
    font-weight: 600;
}

#result-container {
    margin-top: 20px;
}

#result-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 15px;
}

#label-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-label {
    width: 60px;
    text-align: right;
    color: var(--text-color);
    font-size: 0.9rem;
}

.result-bar-bg {
    flex-grow: 1;
    height: 12px;
    background-color: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.result-bar-fill {
    height: 100%;
    background-color: var(--button-bg);
    width: 0%;
    transition: width 0.5s ease;
}

.result-percent {
    width: 45px;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 15px;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--container-bg);
    color: var(--text-color);
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

#contact-form textarea {
    height: 100px;
    resize: vertical;
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--button-bg);
    box-shadow: 0 0 0 2px var(--button-shadow);
}

#submit-btn {
    width: 100%;
    background-color: var(--button-bg);
    color: white;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--button-shadow);
}

#submit-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
