:root {
    /* --- LIGHT MODE VARIABLES --- */
    --bg-body: #f8f9fa;
    --bg-header: #212529;
    --bg-card: #ffffff;
    --bg-sidebar: #f1f3f5;
    --text-main: #212529;
    --text-header: #ffffff;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --link-color: #0d6efd;
    --link-hover: #0a58ca;
    --modal-overlay: rgba(0, 0, 0, 0.6);
    
    /* Ad Specific */
    --bg-ad-placeholder: #f0f0f0;
    --border-ad: #cccccc;
    --bg-mobile-ad: #ffffff;
}

/* --- DARK MODE VARIABLES --- */
html.dark {
    --bg-body: #111827;       
    --bg-header: #0f172a;     
    --bg-card: #1f2937;       
    --bg-sidebar: #374151;    
    --text-main: #f3f4f6;     
    --text-header: #e2e8f0;
    --text-muted: #9ca3af;
    --border-color: #4b5563;
    --link-color: #60a5fa;    
    --link-hover: #93c5fd;
    --modal-overlay: rgba(0, 0, 0, 0.85);

    /* Ad Specific */
    --bg-ad-placeholder: #2d3748;
    --border-ad: #4a5568;
    --bg-mobile-ad: #1f2937;
}

/* --- GLOBAL RESET --- */
* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0; padding: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex; flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; width: 100%;
}

body.theme-transitioning,
body.theme-transitioning * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* --- HEADER --- */
header {
    background: var(--bg-header); color: var(--text-header);
    padding: 1rem 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky; top: 0; z-index: 1000;
}
header .nav-container {
    width: 100%; max-width: 100%; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center;
}
header h1, header .nav-brand { margin: 0; font-size: 1.75rem; font-weight: 600; }
header a { color: var(--text-header); text-decoration: none; transition: opacity 0.2s; }
header a:hover { opacity: 0.8; }
header nav ul { padding: 0; list-style: none; margin: 0; display: flex; align-items: center; }
header nav li { margin-left: 25px; }

/* Theme Toggle */
#theme-toggle {
    background: transparent; border: 1px solid rgba(255,255,255,0.2); border-radius: 50%;
    width: 36px; height: 36px; padding: 6px; cursor: pointer; color: var(--text-header);
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
#theme-toggle:hover { background: rgba(255,255,255,0.1); }
#theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; }
.sun-icon { display: none; }
.moon-icon { display: block; }
html.dark .sun-icon { display: block; color: #fbbf24; }
html.dark .moon-icon { display: none; }


/* --- FLUID LAYOUT --- */
.page-container {
    display: flex; flex-grow: 1;
    width: 100%; max-width: 1440px; margin: 0 auto;
    padding: 20px 16px; gap: 20px;
    box-sizing: border-box;
}

.main-content {
    flex: 1; 
    padding: 25px;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.08); 
    min-width: 0; overflow-wrap: break-word;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .page-container {
        padding: 10px 8px;
        gap: 12px;
    }
    .main-content {
        padding: 14px 10px;
        border-radius: 6px;
    }
    header .nav-container {
        padding: 0 12px;
    }
    header h1, header .nav-brand {
        font-size: 1.35rem;
    }
    header nav li {
        margin-left: 15px;
    }
}

/* ===== REDESIGNED FOOTER ===== */
footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: var(--bg-header);
    padding: 2rem 0;
    color: var(--text-header);
    font-size: 0.9rem;
}

.gc-footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.gc-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
}

.gc-footer-wordmark {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-header);
    text-decoration: none;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.gc-footer-wordmark:hover {
    color: var(--link-hover);
}

.gc-footer-copyright {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.4;
}

.gc-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: flex-end;
    max-width: 500px;
}

.gc-footer-nav a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.8;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.gc-footer-nav a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Footer responsive: stack on narrow screens */
@media (max-width: 600px) {
    .gc-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        padding: 0 16px;
    }
    .gc-footer-nav {
        justify-content: flex-start;
        max-width: 100%;
        gap: 0.4rem 1.25rem;
    }
    .gc-footer-nav a {
        font-size: 0.95rem;
        padding: 0.15rem 0;
    }
}

.text-center {
    text-align: center;
}
