:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ffffff;
    --dark: #1a252f;
    --code-bg: #f8f9fa;
    --duck-yellow: #ffd700;
    --link-color: #2c5aa0;
    --link-hover: #e74c3c;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: var(--light);
    padding: 20px;
    padding-top: 80px;
    max-width: 1000px;
    margin: 0 auto;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 20px;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 70px;
}

.navbar-content {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-title span {
    animation: duckFloat 3s infinite ease-in-out;
}

header, .category-title {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    border-bottom: 3px solid var(--secondary);
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

header::before, .category-title::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #3498db, #e74c3c, #2ecc71, #f39c12);
}

h1 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 2.8rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.3rem;
    margin-bottom: 25px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.toc-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--secondary);
    border-radius: 15px;
    padding: 0;
    margin: 30px 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.toc-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #e74c3c, #2ecc71, #f39c12);
}

.toc-details {
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 70px;
}

.toc-details[open] {
    animation: tocExpand 0.3s ease-out;
    max-height: 500px;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 25px 30px;
    cursor: pointer;
    background: rgba(255,255,255,0.7);
    transition: all 0.3s ease;
    position: relative;
    list-style: none;
    border-bottom: 2px solid transparent;
}

.toc-header:hover {
    background: rgba(255,255,255,0.9);
    border-bottom-color: var(--secondary);
}

.toc-header::-webkit-details-marker {
    display: none;
}

.toc-details[open] .toc-header {
    border-bottom-color: var(--secondary);
    background: white;
}

.toc-header h3 {
    color: var(--primary);
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.toc-duck {
    font-size: 2.2rem;
    animation: duckFloat 3s infinite ease-in-out;
}

.toc-man {
    font-size: 2.2rem;
}

.toc-toggle {
    position: absolute;
    right: 25px;
    font-size: 1.5rem;
    color: var(--secondary);
    transition: transform 0.3s ease;
}

.toc-details[open] .toc-toggle {
    transform: rotate(180deg);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 25px 30px;
    animation: fadeIn 0.3s ease-out;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 22px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.toc-item:hover {
    transform: translateX(8px);
    border-color: var(--secondary);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.toc-item.current {
    background: linear-gradient(135deg, var(--duck-yellow) 0%, #ffed4a 100%);
    border-color: var(--duck-yellow);
    color: #5c4a00;
    font-weight: bold;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.toc-icon {
    font-size: 1.6rem;
    width: 35px;
    text-align: center;
    transition: transform 0.2s ease;
}

.toc-item:hover .toc-icon {
    transform: scale(1.2);
}

.current-marker {
    margin-left: auto;
    font-size: 1.4rem;
    animation: duckFloat 2s infinite ease-in-out, bounce 1s infinite;
    background: rgba(255,255,255,0.9);
    padding: 6px 12px;
    border-radius: 20px;
    border: 2px solid var(--duck-yellow);
}

.toc-footer {
    padding: 18px 30px 22px;
    border-top: 1px solid #dee2e6;
    text-align: center;
    background: rgba(255,255,255,0.5);
    animation: fadeIn 0.4s ease-out 0.1s both;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toc-footer:hover {
    background: rgba(255,255,255,0.8);
}

.toc-quack {
    color: #6c757d;
    font-style: italic;
    font-size: 1.1rem;
}

.toc-details[open] .toc-nav,
.toc-details[open] .toc-footer {
    animation: slideDown 0.3s ease-out;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.content a:not(.toc-item):not(.toggle-btn):not(.tag):not(.post-card):not(.source-link) {
    color: var(--link-color);
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 4px;
    background: linear-gradient(120deg, rgba(44, 90, 160, 0.1) 0%, rgba(44, 90, 160, 0.05) 100%);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.content a:not(.toc-item):not(.toggle-btn):not(.tag):not(.post-card):not(.source-link):hover {
    color: var(--link-hover);
    background: linear-gradient(120deg, rgba(231, 76, 60, 0.15) 0%, rgba(231, 76, 60, 0.08) 100%);
    border-bottom: 2px solid var(--link-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.2);
}

.callout a {
    display: inline-block;
    padding: 12px 20px;
    margin: 8px 5px;
    background: linear-gradient(135deg, var(--secondary) 0%, #2980b9 100%);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.3);
    border: 2px solid transparent;
}

.callout a:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.callout a:active {
    transform: translateY(0);
}

.source-link {
    font-weight: 600;
    color: var(--link-color);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(44, 90, 160, 0.1);
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.source-link:hover {
    color: var(--link-hover);
    background: rgba(231, 76, 60, 0.15);
    border-bottom: 2px solid var(--link-hover);
    transform: translateY(-2px);
}

.toggle-btn {
    background: linear-gradient(to bottom, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    font-size: 1.1rem;
}

.toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
    background: linear-gradient(to bottom, #3da5e0, #2c8fc8);
}

.toggle-btn:active {
    transform: translateY(1px);
}

.duck-icon {
    font-size: 1.4rem;
    transition: transform 0.3s;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.content {
    background-color: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

p {
    margin: 25px 0;
    font-size: 1.15rem;
    line-height: 1.7;
}

.section-title {
    color: var(--primary);
    margin: 45px 0 25px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--secondary);
    font-size: 1.8rem;
    position: relative;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100px;
    height: 3px;
    background: var(--accent);
}

.code-block-container, details.code-block-container {
    position: relative;
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.code-block {
    background-color: #1e1e1e;
    padding: 25px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #d4d4d4;
    border-left: 4px solid var(--secondary);
    position: relative;
}

.code-header {
    cursor: pointer;
    transition: box-shadow 0.3s ease;
    background: #252526;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3c3c3c;
}

.code-header:hover {
    box-shadow: 0 0 5px rgba(0, 255, 170, 0.8);
}

.code-lang {
    cursor: pointer;
    transition: box-shadow 0.3s ease;
    color: #9cdcfe;
    font-weight: bold;
    font-size: 0.9rem;
}

.code-lang:hover {
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.8);
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    tab-size: 4;
}

.comment {
    color: #6a9955;
}

.keyword {
    color: #c586c0;
}

.string {
    color: #ce9178;
}

.function {
    color: #dcdcaa;
}

.duck-comment {
    background-color: rgba(255, 215, 0, 0.15);
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 8px;
    position: relative;
    border-left: 4px solid var(--duck-yellow);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.duck-comment::before {
    content: "🦆";
    position: absolute;
    left: -25px;
    top: 15px;
    font-size: 1.8rem;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    border: 2px solid var(--duck-yellow);
}

.duck-comment p {
    margin: 10px 0;
    font-style: italic;
    color: #5c4a00;
}

.hidden {
    display: none;
}

.callout {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 5px solid var(--secondary);
    padding: 30px;
    margin: 30px 0;
    border-radius: 0 12px 12px 0;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.callout::before {
    content: "💡";
    position: absolute;
    left: -50px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    background: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.key-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 35px 0;
}

.feature-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--secondary);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.feature-card h3 {
    color: var(--secondary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
}

.feature-icon {
    font-size: 1.8rem;
}

.tags, .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-top: 1em;
}

.tag, .post-tag {
    display: inline-block;
    padding: 0.3em 0.7em;
    background-color: #eef;
    color: #225;
    border-radius: 12px;
    font-size: 0.9em;
    text-decoration: none;
    transition: background-color 0.2s;
}

.tag:hover, .post-tag:hover {
    background-color: #cdd;
}

.post-tag {
    background-color: #eef7ff;
    color: var(--secondary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}


.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.post-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.post-image {
    height: 180px;
    background-color: var(--secondary);
    background-size: cover;
    background-position: center;
    position: relative;
}

.post-image::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}

.post-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 15px;
    line-height: 1.3;
}

.post-excerpt {
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: auto;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 5px;
}


.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin: 30px 0;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.empty-state p {
    color: #7f8c8d;
    max-width: 500px;
    margin: 0 auto;
}


.scroll-image {
    opacity: 0;
    transform: translateY(150px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out, box-shadow 0.5s ease;
}

.scroll-image.scrolled {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.scroll-image:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    filter: hue-rotate(120deg) saturate(150%);
}


footer {
    text-align: center;
    margin-top: 50px;
    padding: 25px;
    color: #7f8c8d;
    font-size: 1rem;
    border-top: 1px solid #e0e0e0;
}


.duck-animation {
    display: inline-block;
    animation: duckFloat 4s infinite ease-in-out;
}

@keyframes duckFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes tocExpand {
    from { opacity: 0.8; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-2px); }
    60% { transform: translateY(-1px); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}


#comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}


@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-top: 70px;
    }
    
    .content {
        padding: 20px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .toc-header h3 {
        font-size: 1.5rem;
    }
    
    .toc-item {
        font-size: 1.1rem;
        padding: 15px 18px;
    }
    
    .toc-nav {
        padding: 20px;
    }
    
    .callout a {
        display: block;
        text-align: center;
        margin: 10px 0;
    }
    
    .duck-comment::before {
        left: -15px;
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
    
    .callout::before {
        left: -35px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .navbar {
        padding: 10px 15px;
        height: 60px;
    }
    
    .navbar-title {
        font-size: 1.2rem;
    }

    .github-icon {
        content: url("img/github_teal.png");
        transition: opacity 0.3s ease;
    }
    
    .github-icon:hover {
        content: url("img/github_magenta.png");
    }
    
    .walker {
        display: inline-block;
        transition: transform 0.3s ease;
    }
    
    .flipped {
        transform: scaleX(-1);
    }
    
    .toggle-btn {
        padding: 10px 15px;
        font-size: 1rem;
    }
    
    .navbar-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .navbar-title {
        margin: 10px 0;
        text-align: center;
    }
}

.image-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    justify-items: center;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.scroll-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.scroll-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}
