/* --- General Body & Typography --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #121829;
    color: #e2e8f0;
    margin: 0;
    padding: 2rem;
    text-align: center;
    background-image: radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 40%);
}

h1, h2 {
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

h1 {
    font-size: 2.8rem;
    color: #f87171; /* A vibrant red */
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.6rem;
    color: #a5b4fc;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #334155;
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* --- Layout & Sections --- */
main {
    max-width: 900px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

section {
    background-color: rgba(45, 55, 72, 0.3);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

/* --- Input & Button --- */
.input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

#draw-number-input {
    font-size: 1.2rem;
    padding: 0.8rem 1rem;
    width: 200px;
    border: 2px solid #4a5568;
    border-radius: 8px;
    background-color: #2d3748;
    color: #e2e8f0;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#draw-number-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

#predict-button {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    background-color: #6366f1;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

#predict-button:hover:not(:disabled) {
    background-color: #4f46e5;
    transform: translateY(-2px);
}

#predict-button:disabled {
    background-color: #4a5568;
    cursor: not-allowed;
    opacity: 0.7;
}

/* --- Lotto Numbers Display --- */
.prediction-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem; /* Space between numbers and copy button */
    margin-bottom: 1rem;
}

.lotto-numbers-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem; /* Reduced gap for a tighter look */
}

.lotto-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    box-shadow: inset -3px -3px 8px rgba(0,0,0,0.4), 2px 2px 6px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.lotto-ball:hover {
    transform: scale(1.1);
}

/* Ball Colors */
.color-1 { background: linear-gradient(135deg, #fce18a, #f8c000); } /* Yellow */
.color-2 { background: linear-gradient(135deg, #89cff0, #4682b4); } /* Blue */
.color-3 { background: linear-gradient(135deg, #ff7f7f, #e63946); } /* Red */
.color-4 { background: linear-gradient(135deg, #a9a9a9, #696969); } /* Gray */
.color-5 { background: linear-gradient(135deg, #90ee90, #3cb371); } /* Green */

/* --- Copy Button --- */
.copy-btn {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid #4a5568;
    border-radius: 6px;
    background-color: #374151;
    color: #e2e8f0;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.copy-btn:hover {
    background-color: #4b5563;
    transform: translateY(-1px);
}

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

/* --- Messages & Spinners --- */
.error-message, .loading-message {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 2rem;
    border-radius: 8px;
    background-color: rgba(255, 107, 107, 0.1);
    color: #ff9a9a;
}

.loading-spinner {
    border: 5px solid #4a5568;
    border-top: 5px solid #6366f1;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Responsive Design --- */
@media (max-width: 600px) {
    body { padding: 1rem; }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.4rem; }
    .input-container { flex-direction: column; }
    #draw-number-input { width: 100%; }
    .prediction-row { flex-direction: column; gap: 1rem; }
    .lotto-ball { width: 40px; height: 40px; font-size: 1rem; }
}
