:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #4b5563;
    --border-color: #e5e7eb;
    --nav-bg: rgba(255, 255, 255, 0.8);
}

body.dark-mode {
    --bg-color: #111827;
    --card-bg: #1f2937;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --nav-bg: rgba(17, 24, 39, 0.8);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.nav-bar {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s, border-color 0.3s;
}

.nav-logo { font-weight: 800; font-size: 1.2rem; color: var(--primary-color); text-decoration: none; }

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a { margin-left: 1.5rem; text-decoration: none; color: var(--text-muted); font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary-color); }

.theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 1.5rem;
    padding: 0;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.theme-btn:hover {
    background: var(--border-color);
    transform: rotate(15deg) scale(1.1);
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.hero-section {
    text-align: center;
    padding: 3rem 0;
}

.hero-section h1 { font-size: 2.5rem; margin-bottom: 1rem; color: var(--text-main); }
.hero-section p { font-size: 1.1rem; color: var(--text-muted); }

.main-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 3rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    text-align: center;
    margin-bottom: 3rem;
    transition: background-color 0.3s, border-color 0.3s;
}

.upload-section {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
    transition: all 0.3s;
}

.upload-section:hover { border-color: var(--primary-color); background: rgba(79, 70, 229, 0.05); }

button:not(.theme-btn) {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button:not(.theme-btn):hover { background-color: var(--primary-hover); }
button:not(.theme-btn):active { transform: scale(0.98); }

#image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 1rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.content-article {
    margin-top: 4rem;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
    transition: background-color 0.3s, border-color 0.3s;
}

.content-article h2 { color: var(--text-main); border-left: 4px solid var(--primary-color); padding-left: 1rem; margin: 2rem 0 1rem; }
.content-article h3 { color: var(--text-main); margin-top: 1.5rem; }
.content-article p { color: var(--text-muted); margin-bottom: 1.2rem; }

footer {
    text-align: center;
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.contact-form {
    max-width: 500px;
    margin: 2rem auto;
    text-align: left;
}

.form-group { margin-bottom: 1rem; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-main);
    transition: border-color 0.3s, background-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Disqus Theme Sync */
.dark-mode #disqus_thread {
    filter: invert(1) hue-rotate(180deg);
}

@media (max-width: 640px) {
    .nav-bar { padding: 1rem; }
    .nav-links a { margin-left: 1rem; font-size: 0.8rem; }
    .theme-btn { margin-left: 1rem; width: 32px; height: 32px; font-size: 1rem; }
    .hero-section h1 { font-size: 1.8rem; }
    .main-card { padding: 1.5rem; }
}
