/**
 * 网址导航侧边栏样式
 * 固定分类导航侧边栏
 *
 * @package PixelShare
 * @author 猫大大
 * @version 1.0.0
 */

/* 侧边栏容器 */
.nav-sidebar-container {
    flex-shrink: 0;
    width: 250px;
    position: sticky;
    top: 20px;
    z-index: 100;
}

/* 侧边栏主体 */
.nav-sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* 侧边栏头部 */
.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: left;
}

/* 导航菜单 */
.sidebar-nav {
    padding: 8px 0;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-menu a:hover {
    background: rgba(99, 102, 241, 0.05);
    color: #6366f1;
    border-left-color: #6366f1;
}

.sidebar-menu a.active {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-left-color: #6366f1;
    font-weight: 600;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #fafafa;
}

.sidebar-register-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: #6366f1;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.sidebar-register-btn:hover {
    background: #5855eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}



/* 黑暗模式适配 */
.dark-theme .nav-sidebar {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .sidebar-header {
    background: #1f2937;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .sidebar-header h3 {
    color: #f9fafb;
}

.dark-theme .sidebar-menu a {
    color: #d1d5db;
}

.dark-theme .sidebar-menu a:hover,
.dark-theme .sidebar-menu a.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.dark-theme .sidebar-footer {
    background: #1f2937;
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .nav-main-container {
        flex-direction: column;
        gap: 20px;
    }

    .nav-sidebar-container {
        width: 100%;
        position: static;
        order: -1;
        margin-bottom: 20px;
    }
}

/* 移动端隐藏侧边栏 */
@media (max-width: 768px) {
    .nav-sidebar-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    .nav-sidebar {
        border-radius: 12px;
    }

    .sidebar-nav {
        padding: 8px 0;
    }

    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 0 12px;
    }

    .sidebar-menu li {
        flex: 1;
        min-width: 120px;
    }

    .sidebar-menu a {
        padding: 8px 12px;
        text-align: center;
        border-radius: 6px;
        border-left: none;
        font-size: 13px;
    }
}

/* 移动端特殊适配 - 隐藏侧边栏 */
@media (max-width: 768px) {
    .nav-sidebar-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    .sidebar-menu {
        gap: 6px;
        padding: 0 16px;
    }

    .sidebar-menu li {
        min-width: 100px;
    }

    .sidebar-menu a {
        padding: 6px 10px;
        font-size: 12px;
    }

    .sidebar-header h3 {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .sidebar-menu li {
        min-width: 100px;
    }
}

/* 滚动条样式 */
.nav-sidebar::-webkit-scrollbar {
    width: 4px;
}

.nav-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.nav-sidebar::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 2px;
}

.nav-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* 动画效果 */
.nav-sidebar-container.animate-in {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 平滑滚动跟随效果 */
.nav-sidebar-container.following {
    transition: top 0.3s ease-out;
}

/* 目标区域高亮效果 */
.nav-highlight {
    position: relative;
    animation: highlightPulse 3s ease-in-out;
}

.nav-highlight::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-radius: 15px;
    z-index: -1;
    animation: highlightGlow 3s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes highlightGlow {
    0%, 100% {
        opacity: 0;
        box-shadow: 0 0 0 rgba(99, 102, 241, 0);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .nav-main-container {
        flex-direction: column;
        gap: 20px;
    }

    .nav-sidebar-container {
        width: 100%;
        position: static;
        order: -1; /* 在移动端将侧边栏移到顶部 */
    }
}

/* 移动端隐藏侧边栏 */
@media (max-width: 768px) {
    .nav-sidebar-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    .nav-sidebar {
        border-radius: 8px;
    }

    .sidebar-nav {
        max-height: none;
    }

    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 16px 20px;
    }

    .sidebar-menu li {
        margin: 0;
    }

    .sidebar-menu a {
        padding: 8px 16px;
        border-radius: 20px;
        background: rgba(99, 102, 241, 0.1);
        color: #6366f1;
        font-size: 14px;
        white-space: nowrap;
    }

    .sidebar-menu a:hover,
    .sidebar-menu a.active {
        background: #6366f1;
        color: white;
    }
}

@media (max-width: 768px) {
    .nav-main-container {
        padding: 0 15px;
    }

    .nav-sidebar-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 -15px;
    }

    .nav-sidebar {
        border-radius: 0;
        margin: 0;
    }
}
