:root {
    /* Light Mode (Default) */
    --bg-color: #ffffff;
    --text-color: #101010;
    --card-bg: #f5f5f5;
    --accent-color: #000000;
    --accent-text: #ffffff;
    --border-color: #dbdbdb;
    --error-color: #ff3040;
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-color: #101010;
    --text-color: #f5f5f5;
    --card-bg: #1e1e1e;
    --accent-color: #ffffff;
    --accent-text: #000000;
    --border-color: #333333;
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { background-color: var(--bg-color); color: var(--text-color); transition: background 0.3s, color 0.3s; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img, video { max-width: 100%; height: auto; display: block; }
.hidden { display: none !important; }

/* Layout */
.container { max-width: 800px; margin: 0 auto; padding: 0 1rem; }
.navbar { padding: 1rem 0; border-bottom: 1px solid var(--border-color); margin-bottom: 2rem; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.5rem; letter-spacing: -1px; }
.logo span { opacity: 0.5; }

/* Controls */
.nav-controls { display: flex; gap: 10px; align-items: center; }
#theme-toggle { background: none; border: none; cursor: pointer; padding: 5px; }
#theme-toggle svg { width: 24px; height: 24px; fill: var(--text-color); }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

select { background: var(--card-bg); color: var(--text-color); border: 1px solid var(--border-color); padding: 5px; border-radius: 6px; }

/* Hero */
.main-content { text-align: center; min-height: 70vh; }
h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.subtitle { color: #777; margin-bottom: 2rem; }

/* Downloader Box */
.downloader-box { max-width: 600px; margin: 0 auto; }
.input-group { display: flex; flex-direction: column; gap: 10px; }
@media(min-width: 600px) {
    .input-group { flex-direction: row; }
}
input[type="text"] { flex: 1; padding: 15px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-color); font-size: 1rem; outline: none; transition: border 0.2s; }
input[type="text"]:focus { border-color: var(--text-color); }

button#btn-submit { padding: 15px 30px; border-radius: 12px; border: none; background: var(--accent-color); color: var(--accent-text); font-weight: 600; cursor: pointer; font-size: 1rem; transition: opacity 0.2s; }
button#btn-submit:hover { opacity: 0.8; }
button#btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.error-message { color: var(--error-color); margin-top: 1rem; font-weight: 500; }

/* Spinner */
.loading-spinner { margin-top: 2rem; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--card-bg); border-top-color: var(--text-color); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 10px; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Results */
.result-card { background: var(--card-bg); border-radius: 16px; padding: 20px; margin-top: 2rem; text-align: left; border: 1px solid var(--border-color); }
.user-info { display: flex; align-items: center; margin-bottom: 15px; font-weight: 600; }
.caption { margin-bottom: 20px; white-space: pre-wrap; font-size: 0.95rem; }
.media-container { display: flex; flex-direction: column; gap: 15px; }
.media-item { position: relative; }
.media-item img, .media-item video { border-radius: 12px; width: 100%; border: 1px solid var(--border-color); }
.dl-btn { display: inline-block; width: 100%; text-align: center; margin-top: 10px; padding: 12px; background: var(--text-color); color: var(--bg-color); border-radius: 8px; font-weight: 600; font-size: 0.9rem; }

/* FAQ Page */
.faq-grid { display: grid; gap: 1.5rem; text-align: left; margin-top: 2rem; }
.faq-item h3 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.faq-item p { color: #777; }

/* Footer */
.footer { margin-top: 3rem; padding: 2rem 0; text-align: center; color: #777; font-size: 0.9rem; border-top: 1px solid var(--border-color); }
.footer-nav { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1rem; flex-wrap: wrap; }