/* Topics Dropdown Styles */
.nav-topics {
    position: relative;
}

.nav-topics > a {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.nav-topics-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.2s;
    margin-bottom: 2px;
    margin-left: 5px;
}

.nav-topics.active .nav-topics-arrow {
    transform: rotate(180deg);
}

.nav-topics-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--ghost-accent-color, #15171a);
    min-width: 220px;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 8px 0;
    margin-top: 8px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.dark-mode .nav-topics-dropdown {
    background: #1a1a1a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.nav-topics.active .nav-topics-dropdown {
    display: block;
}

.nav-topics-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #fff !important;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-topics-dropdown a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-topics-dropdown .tag-count {
    opacity: 0.7;
    font-size: 0.9em;
    margin-left: 4px;
}

#tags-template {
    display: none;
}

/* Mobile styles */
@media (max-width: 767px) {
    .nav-topics {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .nav-topics > a {
        display: flex;
        justify-content: center;
        align-items: center;
        width: auto;
    }

    .nav-topics-dropdown {
        position: static;
        box-shadow: none;
        margin-top: 8px;
        margin-left: 0;
        padding: 0;
        max-height: none;
        background: transparent;
        width: 100%;
        left: auto;
        right: auto;
        text-align: center;
    }

    .nav-topics-dropdown a {
        color: inherit !important;
        padding: 8px 0;
        text-align: center;
        margin-bottom: 4px;
        margin-right: 5px;
    }

    .gh-head-open .nav-topics > a {
        pointer-events: auto;
    }
}

/* Scrollbar styling - only for desktop */
@media (min-width: 768px) {
    .nav-topics-dropdown::-webkit-scrollbar {
        width: 6px;
    }

    .nav-topics-dropdown::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
    }

    .nav-topics-dropdown::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }

    .nav-topics-dropdown::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }
}
