:root {
    --bg-body: #ffffff;
    --bg-surface: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --navbar-bg: #ffffff;
    --footer-bg: #f8f9fa;
    --link-color: #0d6efd;
    --nav-link-color: #212529;
    --nav-link-hover-bg: #e7f1ff;
    --footer-link-color: #6c757d;
    --footer-link-hover: #0d6efd;
}

body.dark {
    --bg-body: #121212;
    --bg-surface: #1e1e1e;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --border-color: #2c2c2c;
    --card-bg: #1e1e1e;
    --navbar-bg: #1a1a1a;
    --footer-bg: #0f0f0f;
    --link-color: #3b82f6;
    --nav-link-color: #e8e8e8;
    --nav-link-hover-bg: #2a2a2a;
    --footer-link-color: #a0a0a0;
    --footer-link-hover: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color 0.25s ease, color 0.2s ease;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

#header-placeholder {
    flex-shrink: 0;
    background-color: var(--navbar-bg);
    border-bottom: 1px solid var(--border-color);
}

main {
    flex: 1 0 auto;
}

#footer-placeholder {
    flex-shrink: 0;
    background-color: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.logo i {
    color: var(--link-color);
    font-size: 1.5rem;
}

.logo:hover {
    color: var(--link-color);
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link-custom {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--nav-link-color);
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link-custom:hover {
    background-color: var(--nav-link-hover-bg);
    color: var(--link-color);
}

.nav-link-custom.active {
    background-color: var(--link-color);
    color: white;
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    padding: 0.4rem 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.theme-toggle:hover {
    background-color: var(--bg-surface);
    border-color: var(--link-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 0;
}

.footer-section h5 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a,
.footer-section ul li span {
    color: var(--footer-link-color);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section ul li a:hover {
    color: var(--footer-link-hover);
    text-decoration: underline;
}

.footer-section ul li i {
    width: 1.25rem;
    font-size: 0.9rem;
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.btn-primary {
    background-color: var(--link-color);
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 0.375rem;
    color: white;
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-block;
    text-decoration: none;
    font-size: 0.9rem;
    width: auto;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.25rem;
    border-radius: 0.375rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-outline:hover {
    background-color: var(--bg-surface);
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.card-cover {
    background-size: cover;
    background-position: center;
    min-height: 200px;
}

.text-white {
    color: white;
}

.text-shadow-1 {
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.border-bottom {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.py-5 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.mt-auto {
    margin-top: auto;
}

.d-flex {
    display: flex;
}

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

.justify-content-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

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

.rounded-3 {
    border-radius: 0.75rem;
}

.shadow {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

.overflow-hidden {
    overflow: hidden;
}

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: var(--link-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.scroll-to-top:hover {
    background-color: var(--footer-link-hover);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.copyright a,
.copyright .creator-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: inherit;
}

.copyright a:hover,
.copyright .creator-link:hover {
    color: var(--link-color);
    text-decoration: underline;
}

.copyright a:not(:hover) {
    color: var(--text-secondary);
    text-decoration: none;
}

@media (min-width: 768px) {
    .site-header {
        flex-direction: row;
        padding: 1rem 0;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo i {
        font-size: 1.8rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-link-custom {
        padding: 0.5rem 1rem;
        font-size: 1rem;
        white-space: normal;
    }
    
    .theme-toggle {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        gap: 0.5rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 2rem;
        padding: 3rem 0;
    }
    
    .footer-section h5 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .footer-section ul li a,
    .footer-section ul li span {
        font-size: 0.9rem;
    }
    
    .copyright {
        font-size: 0.875rem;
        padding-top: 2rem;
    }
    
    .py-5 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .px-4 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .gap-4 {
        gap: 1.5rem;
    }
    
    .card-cover {
        min-height: 300px;
    }
    
    .btn-primary,
    .btn-outline {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }
    
    .scroll-to-top {
        bottom: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .site-header {
        padding: 0.5rem 0;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .logo i {
        font-size: 1.3rem;
    }
    
    .nav-link-custom {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .theme-toggle {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .footer-content {
        padding: 1.5rem 0;
        gap: 1.25rem;
    }
    
    .footer-section ul li a,
    .footer-section ul li span {
        font-size: 0.8rem;
    }
    
    .py-5 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .px-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .card-cover {
        min-height: 150px;
    }
}
