:root {
    --bg-color: #ffffff;
    --container-bg: #fbfbfd;
    --card-bg: #ffffff;
    --text-main: #004268;
    --text-muted: rgba(0, 66, 104, 0.7);
    --accent: #0077bc;
    --button-bg: #39d6b2;
    --button-text: #ffffff;
    --border-color: #d2d2d7;
    --logo-filter: none;
    --shadow: rgba(0, 66, 104, 0.08);
    --modal-overlay: rgba(0, 43, 69, 0.85);
    --github-filter: invert(16%) sepia(58%) saturate(800%) hue-rotate(179deg);
}

[data-theme="dark"] {
    --bg-color: #002b45;
    --container-bg: rgba(255, 255, 255, 0.05);
    --card-bg: #004268;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --accent: #39d6b2;
    --button-bg: #39d6b2;
    --button-text: #004268;
    --border-color: rgba(255, 255, 255, 0.1);
    --logo-filter: brightness(0) invert(1);
    --shadow: rgba(0, 0, 0, 0.3);
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --github-filter: invert(1);
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; transition: background-color 0.3s ease, color 0.3s ease; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color); color: var(--text-main);
    margin: 0; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; min-height: 100vh;
}

.header-controls { position: absolute; top: 20px; right: 20px; display: flex; gap: 12px; align-items: center; }

.github-link { display: flex; align-items: center; text-decoration: none; opacity: 0.8; transition: opacity 0.2s; }
.github-link:hover { opacity: 1; }
.github-icon { width: 24px; height: 24px; filter: var(--github-filter); }

.btn-small {
    background: var(--container-bg); border: 1px solid var(--border-color);
    color: var(--text-main); padding: 8px 16px; border-radius: 20px;
    cursor: pointer; font-size: 0.8rem; font-weight: 600;
    text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
    transition: opacity 0.2s;
}
.btn-small:hover { opacity: 0.75; }

.logo { max-width: 220px; height: auto; margin-bottom: 40px; filter: var(--logo-filter); }
.container { width: 100%; max-width: 650px; text-align: center; transition: max-width 0.4s ease-in-out; }
.container.full-width { max-width: 95vw; }

h2 { font-size: 2.2rem; font-weight: 700; color: var(--accent); margin-bottom: 1.5rem; letter-spacing: -0.02em; }

.description-box {
    text-align: left; background: var(--container-bg); padding: 1.5rem 2rem;
    border-radius: 20px; margin-bottom: 2rem; border: 1px solid var(--border-color);
}
.description-box p { margin: 0; color: var(--text-muted); line-height: 1.5; }

.form-card {
    background: var(--card-bg); padding: 2rem; border-radius: 24px;
    box-shadow: 0 10px 30px var(--shadow); border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.form-group { margin-bottom: 1.5rem; text-align: left; }
label { display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 8px; text-transform: uppercase; color: var(--accent); }
input[type="file"] { width: 100%; padding: 12px; background: var(--container-bg); border-radius: 12px; border: 2px dashed var(--border-color); color: var(--text-main); }

button.main-btn {
    background: var(--button-bg); color: var(--button-text); border: none;
    padding: 1.1rem 3rem; border-radius: 14px; cursor: pointer; font-size: 1.1rem; font-weight: 700; width: 100%;
    transition: filter 0.15s ease;
}
button.main-btn:hover:not(:disabled) { filter: brightness(1.06); }
button.main-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.preview-section { display: none; margin-top: 2rem; animation: fadeIn 0.6s ease forwards; width: 100%; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--modal-overlay); display: none; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(8px);
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: var(--card-bg); width: 90%; max-width: 600px; border-radius: 28px; padding: 2.5rem;
    max-height: 85vh; overflow-y: auto;
}
.faq-item { margin-bottom: 1.5rem; text-align: left; }
.faq-item strong { display: block; color: var(--accent); margin-bottom: 5px; }

.status-msg { margin-top: 1.5rem; font-size: 0.9rem; font-weight: 500; min-height: 1.2em; }

footer { margin-top: auto; padding-top: 30px; font-size: 0.85rem; color: var(--text-muted); text-align: center; }
footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }

.active-toggle { background: var(--button-bg) !important; color: var(--button-text) !important; border-color: var(--button-bg) !important; }
.visitor-counter { margin-top: 12px; opacity: 0.8; }
