@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-color: #050510;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-primary: #833ab4;
    --accent-secondary: #fd1d1d;
    --accent-gradient: linear-gradient(45deg, #833ab4, #fd1d1d, #fcb045);
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --ball-size: 60px;
    --glass-blur: 15px;
    --history-bg: rgba(255, 255, 255, 0.05);
}

body.light-mode {
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --history-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(131, 58, 180, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(253, 29, 29, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.light-mode {
    background-image:
        radial-gradient(at 0% 0%, rgba(131, 58, 180, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(253, 29, 29, 0.05) 0px, transparent 50%);
}

.container {
    width: 90%;
    max-width: 800px;
    text-align: center;
    z-index: 1;
    position: relative;
}

.theme-switch {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
}

#theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

#theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-weight: 300;
}

.lotto-display {
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    padding: 3rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    min-height: 150px;
    align-items: center;
}

.ball {
    width: var(--ball-size);
    height: var(--ball-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), inset 0 -4px 6px rgba(0, 0, 0, 0.2);
    transform: scale(0);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
    overflow: hidden;
}

.ball::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

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

/* Ball Colors */
.ball-range-1 {
    background: linear-gradient(135deg, #fbc02d, #f57f17);
}

/* 1-10 Yellow */
.ball-range-2 {
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
}

/* 11-20 Blue */
.ball-range-3 {
    background: linear-gradient(135deg, #e53935, #b71c1c);
}

/* 21-30 Red */
.ball-range-4 {
    background: linear-gradient(135deg, #757575, #424242);
}

/* 31-40 Gray */
.ball-range-5 {
    background: linear-gradient(135deg, #43a047, #1b5e20);
}

/* 41-45 Green */

.controls {
    margin-top: 2rem;
}

#generate-btn {
    background: var(--accent-gradient);
    border: none;
    padding: 1.2rem 3rem;
    border-radius: 100px;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    box-shadow: 0 10px 30px rgba(131, 58, 180, 0.3);
}

#generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(131, 58, 180, 0.5);
    filter: brightness(1.1);
}

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

#generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.history {
    margin-top: 4rem;
    width: 100%;
}

.history h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--history-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-numbers {
    display: flex;
    gap: 8px;
}

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

.history-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.contact {
    margin-top: 4rem;
    margin-bottom: 4rem;
    width: 100%;
}

.contact h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.contact p {
    color: var(--text-muted);
    opacity: 0.7;
    margin-bottom: 2rem;
    font-weight: 300;
}

.contact-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-radius: 2rem;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

body.light-mode .form-group input,
body.light-mode .form-group textarea {
    background: rgba(0, 0, 0, 0.02);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-btn {
    background: var(--accent-gradient);
    border: none;
    padding: 1rem;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
}

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

footer {
    margin-top: auto;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0.6;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2.5rem;
    }

    .ball {
        --ball-size: 50px;
        font-size: 1.25rem;
    }

    .history-item {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .contact-form {
        padding: 1.5rem;
    }
}

/* Disqus Comments */
.comments {
    margin-top: 4rem;
    margin-bottom: 4rem;
    text-align: left;
    width: 100%;
}

.comments h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
    text-align: center;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    padding: 3rem 2rem;
    border-radius: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.modal-content p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-btn {
    background: var(--accent-gradient);
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 100px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-btn:hover {
    transform: scale(1.05);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}