/* static/css/style.css */

/* 1. THEME & FONT DEFINITIONS USING CSS VARIABLES */
:root {
    --font-pixel: 'Press Start 2P', cursive;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --color-bg: #f9f9f9; --color-surface: #ffffff; --color-text-primary: #1d1d1f;
    --color-text-secondary: #515154; --color-accent: #007aff; --color-border: #d2d2d7;
    --shadow-color: rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] {
    --color-bg: #111111; --color-surface: #1d1d1d; --color-text-primary: #f5f5f7;
    --color-text-secondary: #a1a1a6; --color-accent: #0a84ff; --color-border: #3a3a3c;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* 2. BASE & LAYOUT STYLES */
body {
    background-color: var(--color-bg); color: var(--color-text-primary); font-family: var(--font-sans);
    display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh;
    margin: 0; padding: 2rem 1rem; box-sizing: border-box; transition: background-color 0.3s, color 0.3s;
}
.container {
    max-width: 600px; width: 100%; text-align: center; background-color: var(--color-surface);
    padding: 2.5rem; border-radius: 16px; border: 1px solid var(--color-border);
    box-shadow: 0 8px 32px var(--shadow-color); transition: background-color 0.3s, border-color 0.3s;
}

/* 3. HEADER, LOGO & TYPOGRAPHY STYLES */
header { margin-bottom: 2rem; }
.header-content { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.title-group { display: flex; align-items: center; gap: 1.5rem; }
.logo-image { width: 100px; height: 100px; object-fit: contain; flex-shrink: 0; }
h1 { font-family: var(--font-pixel); color: var(--color-accent); font-size: 1.5rem; text-align: left; margin: 0; }
p { font-size: 1rem; line-height: 1.6; color: var(--color-text-secondary); text-align: left; }

/* 4. CONTROLS & FORM STYLES */
.controls-grid {
    display: flex; justify-content: space-between; flex-wrap: wrap;
    gap: 1rem; align-items: flex-start; margin: 2rem 0; padding: 1.5rem;
    background-color: var(--color-bg); border: 1px solid var(--color-border); border-radius: 12px;
}
.control-group { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; flex-grow: 1; }
.control-group label { font-family: var(--font-pixel); font-size: 0.65rem; color: var(--color-text-secondary); text-transform: uppercase; }
.control-group select {
    font-family: var(--font-sans); font-size: 1rem; background-color: var(--color-surface);
    color: var(--color-text-primary); border: 1px solid var(--color-border);
    border-radius: 8px; padding: 0.5rem 0.8rem; cursor: pointer; width: 100%;
}
.toggles-row {
    display: flex; justify-content: space-around; align-items: center;
    width: 100%; padding-top: 1.5rem; margin-top: 1rem; border-top: 1px solid var(--color-border);
}

/* 5. BUTTON & RESULT STYLES */
.action-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}
.button {
    font-family: var(--font-sans); font-size: 1rem; font-weight: 600; padding: 0.8rem 1.5rem;
    border: none; border-radius: 12px; cursor: pointer; text-decoration: none;
    transition: all 0.2s ease; display: inline-block;
}
.button:hover { transform: translateY(-2px); }
.generate-button { background-color: var(--color-accent); color: white !important; margin-top: 0; }
.generate-button:hover { box-shadow: 0 4px 15px color-mix(in srgb, var(--color-accent) 40%, transparent); }
.button-outline {
    background-color: transparent;
    border: 2px solid var(--color-accent);
    color: var(--color-accent) !important;
    padding: calc(0.8rem - 2px) calc(1.5rem - 2px);
}
.button-outline:hover {
    background-color: var(--color-accent);
    color: white !important;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--color-accent) 40%, transparent);
}
.result-container { margin-top: 3rem; }
h2 { font-family: var(--font-pixel); }
.image-wrapper { background-color: var(--color-bg); border-radius: 12px; padding: 0.5rem; margin-bottom: 1.5rem; border: 1px solid var(--color-border); }
.logo-image + h1 + img, .image-wrapper img { max-width: 100%; height: auto; border-radius: 8px; }

/* 6. THEME & SLIDER TOGGLE STYLES */
.theme-switcher { position: relative; }
#theme-toggle, #symmetrical, #show_grid, #no_overlap { display: none; }
.theme-switcher .slider {
    display: block; width: 48px; height: 24px; background-color: var(--color-border);
    border-radius: 12px; cursor: pointer; transition: background-color 0.3s;
}
.theme-switcher .slider::before {
    content: ''; display: block; position: absolute; top: 3px; left: 4px;
    width: 18px; height: 18px; background-color: var(--color-surface); border-radius: 50%;
    transition: transform 0.3s ease;
}
#theme-toggle:checked + .slider, #symmetrical:checked + .slider, #show_grid:checked + .slider, #no_overlap:checked + .slider { background-color: var(--color-accent); }
#theme-toggle:checked + .slider::before, #symmetrical:checked + .slider::before, #show_grid:checked + .slider::before, #no_overlap:checked + .slider::before { transform: translateX(23px); }
.theme-control-group { display: flex; align-items: center; gap: 0.75rem; }
.icon-wrapper { color: var(--color-text-secondary); transition: color 0.3s; width: 20px; height: 20px; }
.icon-wrapper svg { width: 100%; height: 100%; }
:root .sun-icon { display: none; }
:root .moon-icon { display: block; }
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
.control-group .toggle-label-main { font-family: var(--font-sans); font-size: 1rem; text-transform: none; font-weight: 500; }

/* 7. FOOTER & SUPPORT TEXT STYLES */
.support-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.support-footer p { font-size: 0.8rem; color: var(--color-text-secondary); text-align: center; }
.support-footer a { color: var(--color-accent); text-decoration: none; font-weight: 600; }
.support-footer a:hover { text-decoration: underline; }
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
}
.social-links a { color: var(--color-text-secondary); transition: color 0.2s ease, transform 0.2s ease; }
.social-links a:hover { color: var(--color-accent); transform: scale(1.1); }
.social-links svg { width: 24px; height: 24px; }
footer { margin-top: 3rem; font-size: 0.75rem; color: var(--color-text-secondary); opacity: 0.8; }

/* 8. MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    body { padding: 1.5rem 0.5rem; justify-content: flex-start; }
    .container { padding: 1.5rem; }
    .logo-image { width: 50px; height: 50px; }
    .title-group { gap: 1rem; }
    h1 { font-size: 1.2rem; }
    .header-content { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .controls-grid { flex-direction: column; align-items: stretch; gap: 1.5rem; }
    .control-group { flex-direction: row; justify-content: space-between; align-items: center; }
    .control-group select { width: auto; }
    .toggles-row {
        flex-direction: column;
        border-top: none;
        padding-top: 0;
        margin-top: 0;
        gap: 1.5rem;
    }
}