/**
 * Fairplus 侧边栏样式
 * 
 * 右侧固定侧边栏，包含快捷操作按钮和返回顶部功能
 */

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 侧边栏主容器 */
.fp-sidebar {
    position: fixed;
    right: 20px;
    bottom: 5%;
    transform: translateY(-5%);
    z-index: 1000;
    transition: all 0.3s ease;
}

.fp-sidebar-container {
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* 侧边栏项目 */
.fp-sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    color: #fff;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    padding: 8px;
    position: relative;
}

.fp-sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    transform: scale(1.05);
}


.fp-sidebar-item i {
    font-size: 20px;
    margin-bottom: 6px;
    display: block;
    transition: transform 0.2s ease;
}

.fp-sidebar-item:hover i {
    transform: scale(1.1);
}

.fp-sidebar-item span {
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
    display: block;
    font-weight: 500;
}

/* 返回顶部按钮特殊样式 */
.fp-back-to-top {
    background-color: var(--fp-color-primary, #ff8c00) !important;
    display: none; /* 默认隐藏，滚动时显示 */
}

.fp-back-to-top.fp-show {
    display: flex;
}

.fp-back-to-top:hover {
    background-color: var(--fp-color-primary-dark, #ff7700) !important;
}

/* Hover 文字提示 */
.fp-sidebar-item[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--fp-color-primary);
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1001;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.fp-sidebar-item[data-tooltip]::after {
    content: '';
    position: absolute;
    right: calc(100% + 0px);
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: var(--fp-color-primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1001;
    pointer-events: none;
}

.fp-sidebar-item[data-tooltip]:hover::before,
.fp-sidebar-item[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 弹窗样式 */
.fp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.fp-modal.fp-modal-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.fp-modal-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: fp-modal-slide-in 0.3s ease;
}

@keyframes fp-modal-slide-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.fp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.fp-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.fp-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.fp-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.fp-modal-content {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 弹窗内容样式优化 */
.fp-modal-content h1,
.fp-modal-content h2,
.fp-modal-content h3,
.fp-modal-content h4,
.fp-modal-content h5,
.fp-modal-content h6 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.fp-modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

.fp-modal-content .fluentform {
    margin: 0;
}

/* 滚动时的动画效果 */
.fp-sidebar.fp-sidebar-scrolled {
    transform: translateY(0) scale(0.95);
}

/* 响应式设计 - 移动端隐藏侧边栏 */
@media (max-width: 768px) {
    .fp-sidebar {
        display: none !important;
    }
}

/* 防止弹窗打开时页面滚动 */
body.fp-modal-open {
    overflow: hidden;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .fp-sidebar-container {
        border: 2px solid #fff;
    }
    
    .fp-sidebar-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .fp-sidebar-item:last-child {
        border-bottom: none;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .fp-sidebar,
    .fp-sidebar-item,
    .fp-sidebar-item i,
    .fp-modal-container {
        transition: none;
        animation: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .fp-modal-container {
        background: #1a1a1a;
        color: #fff;
    }
    
    .fp-modal-header {
        background: #2a2a2a;
        border-bottom-color: #444;
    }
    
    .fp-modal-title {
        color: #fff;
    }
    
    .fp-modal-close {
        color: #ccc;
    }
    
    .fp-modal-close:hover {
        background: #444;
        color: #fff;
    }
    
    .fp-modal-content h1,
    .fp-modal-content h2,
    .fp-modal-content h3,
    .fp-modal-content h4,
    .fp-modal-content h5,
    .fp-modal-content h6 {
        color: #fff;
    }
    
    .fp-modal-content p {
        color: #ccc;
    }
}