:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --header-footer-bg: #e9ecef;
    --border-color: #dee2e6;
    --accent-color: #0d6efd;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #adb5bd;
    --header-footer-bg: #1a1a1a;
    --border-color: #333333;
    --accent-color: #3d8bfd;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
}

main {
    flex: 1 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
}

.site-header,
.site-footer {
    min-height: 50px;
    background-color: var(--header-footer-bg);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
}

.site-footer {
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    padding-bottom: 8px;
}

.logo {
    color: var(--text-color);
    font-size: 1.1rem;
    user-select: none;
}

#theme-toggle {
    color: var(--text-color);
    padding: 0.25rem 0.5rem;
}

#theme-toggle:hover {
    background-color: var(--border-color);
}

.footer-link {
    color: var(--text-muted);
    opacity: 0.9;
    transition: color 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.footer-link:hover {
    color: var(--accent-color);
    opacity: 1;
}

.footer-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.footer-badges img {
    height: 20px;
    width: auto;
}

.bookmark-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.3s ease;
    height: 100%;
    cursor: pointer;
}

.bookmark-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-color);
}

.bookmark-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    transition: transform 0.2s ease;
    line-height: 1;
}

.bookmark-card:hover .bookmark-icon {
    transform: scale(1.1);
}

.bookmark-title {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}

[data-theme="dark"] .bookmark-icon[style*="#000000"],
[data-theme="dark"] .bookmark-icon[style*="color: rgb(0, 0, 0)"] {
    filter: brightness(0) invert(1);
}

.contact-section .form-wrapper {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.contact-section .form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
}

.contact-section .form-control {
    background-color: var(--bg-color);
    border-color: var(--border-color);
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.contact-section .form-control:focus {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.contact-section .form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

#form-status.text-success {
    color: #198754;
}

#form-status.text-danger {
    color: #dc3545;
}

@media (max-width: 768px) {
    .bookmark-card {
        padding: 1rem 0.25rem;
    }

    .bookmark-icon {
        font-size: 2.5rem;
    }

    .bookmark-title {
        font-size: 0.95rem;
    }

    .contact-section .form-wrapper {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .site-header .logo {
        font-size: 1rem;
    }

    h1.h4 {
        font-size: 1.25rem;
    }

    .bookmark-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .bookmark-title {
        font-size: 0.85rem;
    }

    .footer-badges {
        gap: 6px;
    }
}