/* --- CSS Variables for Easy Theme Management --- */
:root {
    --bg-dark: #1a1a2e;
    --bg-light: #2a2a4e;
    --surface-color: #23233c;
    --primary-color: #7f5af0;
    --secondary-color: #2cb67d;
    --text-color: #e0e0e0;
    --text-muted: #94a1b2;
}

/* --- Basic Setup & Body Styling --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-light));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

/* --- Typography --- */
h1 {
    font-weight: 600;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #fffffe; /* Brighter white for main heading */
    text-shadow: 0 0 15px rgba(127, 90, 240, 0.5);
}

p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

p b {
    color: var(--text-color);
    font-weight: 400;
}

/* --- Input & Button Styling --- */
.input-container {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

label {
    font-size: 1.1rem;
    font-weight: 300;
}

input[type="text"] {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    width: 300px;
    background-color: var(--surface-color);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-color);
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(127, 90, 240, 0.5);
}

button {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    color: #fffffe;
    transition: transform 0.2s, box-shadow 0.2s;
}

#createBtn {
    background: var(--primary-color);
    box-shadow: 0 4px 20px rgba(127, 90, 240, 0.4);
}

#downloadBtn {
    background: var(--secondary-color);
    box-shadow: 0 4px 20px rgba(44, 182, 125, 0.4);
}

button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(127, 90, 240, 0.6);
}

#downloadBtn:not(:disabled):hover {
    box-shadow: 0 6px 25px rgba(44, 182, 125, 0.6);
}

button:disabled {
    background-color: #4a4a6a;
    color: var(--text-muted);
    cursor: not-allowed;
}


/* --- Main Content Containers --- */
.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    margin: 1.5rem 0;
}

canvas {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#explanationBox {
    width: 400px;
    height: 450px;
    background-color: var(--surface-color);
    border: 1px solid #3a3a5a;
    border-radius: 12px;
    padding: 1.5rem;
    line-height: 1.7;
    overflow-y: auto;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.placeholder {
    color: var(--text-muted);
    font-style: italic;
}

#explanationBox h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}


/* --- Custom Scrollbar for a Polished Look --- */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--surface-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9d7fe9;
}