.sidebar {
    position: static;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 5px;
}

.sidebar.sidebar-expanded {
    max-width: 350px;
}

.sidebar.sidebar-compact {
    max-width: 280px;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a93226;
}

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgb(0, 0, 0);
}

.sidebar-section {
    background-color: #000;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.sidebar-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.sidebar-title {
    font-size: 1.2rem;
    color: white;
    display: flex;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.sidebar-title i {
    margin-right: 10px;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.popular-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.popular-post-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
    transition: all 0.3s ease;
}

.popular-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-post-item.lazy-load {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.popular-post-item.lazy-loaded {
    opacity: 1;
    transform: translateY(0);
}

.popular-post-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.popular-post-link:hover {
    transform: translateX(5px);
}

.popular-post-content {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.post-icon {
    margin-right: 8px;
    color: var(--primary-color);
    font-size: 12px;
    margin-top: 4px;
    flex-shrink: 0;
}

.popular-post-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.popular-post-link:hover .popular-post-title {
    color: var(--primary-color);
}

.categories {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.category-item.lazy-load {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.category-item.lazy-loaded {
    opacity: 1;
    transform: translateY(0);
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 4px;
    padding: 8px 12px;
}

.category-link:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
    color: var(--primary-color);
}

.category-name {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.category-name i {
    margin-right: 8px;
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.category-count {
    background-color: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-tags {
    margin-top: 20px;
}

.sidebar-tags-container {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}

.sidebar-tags-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-tag-item {
    margin: 0;
}

.sidebar-tag-link {
    display: inline-block;
    color: rgb(255, 5, 5);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
}

.sidebar-tag-link:hover {
    color: #ff0000;
    text-decoration: underline;
    transform: none;
    box-shadow: none;
    background: none;
}

.sidebar-tag-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    margin-left: 5px;
}

.hidden-tags {
    display: none;
}

.hidden-tags.show {
    display: block;
}

.sidebar-tags-container::-webkit-scrollbar {
    width: 6px;
}

.sidebar-tags-container::-webkit-scrollbar-track {
    background: rgba(192, 57, 43, 0.1);
    border-radius: 3px;
}

.sidebar-tags-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.sidebar-tags-container::-webkit-scrollbar-thumb:hover {
    background: #a93226;
}

.sidebar-tags-container {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(192, 57, 43, 0.1);
}

.show-more-container {
    margin-top: 15px;
    text-align: center;
}

.show-more-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.show-more-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}

.show-more-btn i {
    transition: transform 0.3s ease;
    color: inherit;
}

.show-more-btn.expanded i {
    transform: rotate(180deg);
}

.show-more-text,
.show-less-text {
    transition: opacity 0.3s ease;
}

.author-section {
    background: black;
    border: 1px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.author-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: black;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-avatar {
    flex-shrink: 0;
}

.author-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.author-avatar img:hover {
    transform: scale(1.05);
}

.author-details {
    flex: 1;
    min-width: 0;
}

.author-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.author-role {
    display: block;
    margin-bottom: 8px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.role-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.role-badge.grandmaster {
    background: linear-gradient(45deg, #a93226, #ff0000);
    color: whitesmoke;
    border: 1px solid white;
}

.role-badge.nexusmaster {
    background: linear-gradient(45deg, var(--primary-color), #a93226);
    color: white;
    border: 1px solid var(--primary-color);
}

.role-badge i {
    font-size: 0.8rem;
    color: inherit;
}

.author-bio {
    font-size: 0.85rem;
    color: #ccc;
    margin-top: 8px;
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.search-section {
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.search-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-input:hover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit:hover {
    background: #a93226;
    transform: translateY(-50%) scale(1.05);
}

.search-submit i {
    font-size: 14px;
}

.search-submit:hover i {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .home-page .sidebar-section:not(.search-section) {
        display: none !important;
    }
    
    .home-page .search-section {
        margin-bottom: 15px;
        padding: 15px;
        background-color: rgba(0, 0, 0, 0.9);
        border-radius: 8px;
    }
    
    .home-page .sidebar-title {
        font-size: 1rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .home-page .search-input {
        padding: 12px 45px 12px 14px;
        font-size: 14px;
        border-radius: 6px;
    }
    
    .home-page .search-submit {
        right: 6px;
        padding: 6px 10px;
    }
    
    .home-page .search-hint {
        font-size: 11px !important;
        margin-top: 8px !important;
    }
    
    .home-page .sidebar {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .home-page .search-input {
        min-height: 44px;
    }
    
    .home-page .search-submit {
        min-width: 44px;
        min-height: 36px;
    }
}

@media (max-width: 768px) {
    .footer-section .footer-links {
        display: none;
    }
    
    .footer-section:has(.footer-links) {
        display: none;
    }
}