/**
 * Chapter Navigation Plugin Styles
 */

/* ========================================
   Navigation Buttons - Modern & Clean
   ======================================== */

.chapter-navigation {
    margin: 25px 0;
    padding: 0;
}

.chapter-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.chapter-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: #a7987a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    max-width: 280px;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(167, 152, 122, 0.2);
}

.chapter-nav-button:hover {
    background: #96886a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(167, 152, 122, 0.3);
    color: #ffffff;
}

.chapter-nav-button:active {
    transform: translateY(0);
}

.chapter-nav-button.disabled {
    background: #f0f0f0;
    color: #aaaaaa;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.chapter-nav-button .button-icon {
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

.chapter-nav-button .button-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.3;
}

.chapter-nav-button.next-button .button-text {
    align-items: flex-end;
}

.chapter-nav-button .button-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.95;
}

.chapter-nav-button .chapter-number {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chapter-navigation {
        margin: 20px 0;
    }
    
    .chapter-nav-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .chapter-nav-button {
        width: 100%;
        max-width: 100%;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .chapter-nav-button .button-icon {
        font-size: 14px;
    }
    
    .chapter-nav-button .button-label {
        font-size: 11px;
    }
    
    .chapter-nav-button .chapter-number {
        font-size: 10px;
    }
}

/* 可选的其他样式主题 */

/* 简约风格 */
.chapter-navigation.minimal .chapter-nav-button {
    background: #ffffff;
    color: #333333;
    border: 2px solid #a7987a;
}

.chapter-navigation.minimal .chapter-nav-button:hover {
    background: #a7987a;
    color: #ffffff;
}

/* 现代风格 */
.chapter-navigation.modern .chapter-nav-button {
    background: linear-gradient(135deg, #a7987a 0%, #96886a 100%);
    border-radius: 50px;
}

.chapter-navigation.modern .chapter-nav-button:hover {
    background: linear-gradient(135deg, #96886a 0%, #857760 100%);
}

/* 深色主题 */
.chapter-navigation.dark .chapter-nav-button {
    background: #2a2a2a;
    color: #ffffff;
    border: 1px solid #444444;
}

.chapter-navigation.dark .chapter-nav-button:hover {
    background: #3a3a3a;
    border-color: #666666;
}

/* ========================================
   Chapter Index Styles - Modern UI
   ======================================== */

.chapter-index-wrapper {
    margin: 20px 0;
    padding: 0;
}

.chapter-index-container {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.chapter-group {
    border-bottom: 1px solid #f0f0f0;
}

.chapter-group:last-child {
    border-bottom: none;
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #a7987a;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: all 0.25s ease;
}

.chapter-header:hover {
    background: #96886a;
    padding-left: 24px;
}

.chapter-header.collapsed {
    background: #fafafa;
    color: #555555;
    border-bottom: 1px solid #f0f0f0;
}

.chapter-header.collapsed:hover {
    background: #f5f5f5;
    color: #a7987a;
}

.chapter-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.chapter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.25s ease;
}

.chapter-header:hover .chapter-toggle {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chapter-header.collapsed .chapter-toggle {
    background: rgba(167, 152, 122, 0.1);
}

.chapter-header.collapsed:hover .chapter-toggle {
    background: rgba(167, 152, 122, 0.2);
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.chapter-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.chapter-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.25s ease;
    opacity: 1;
    background: #ffffff;
}

.chapter-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.chapter-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.chapter-item {
    transition: all 0.2s ease;
    position: relative;
}

.chapter-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: #f5f5f5;
}

.chapter-item:last-child::after {
    display: none;
}

.chapter-item:hover {
    background: linear-gradient(to right, #fafafa 0%, #ffffff 100%);
}

.chapter-item.current-chapter {
    background: linear-gradient(to right, #fff8e6 0%, #fffdf7 100%);
}

.chapter-item.current-chapter::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #a7987a;
}

.chapter-item.current-chapter:hover {
    background: linear-gradient(to right, #fff5d6 0%, #fffcf0 100%);
}

.chapter-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    text-decoration: none;
    color: #444444;
    gap: 12px;
    transition: all 0.2s ease;
}

.chapter-item.current-chapter .chapter-link {
    padding-left: 24px;
}

.chapter-link:hover {
    color: #a7987a;
    padding-left: 24px;
}

.chapter-item.current-chapter .chapter-link:hover {
    padding-left: 28px;
}

.chapter-item.current-chapter .chapter-link {
    color: #a7987a;
    font-weight: 600;
}

.chapter-part {
    font-size: 13px;
    font-weight: 700;
    color: #a7987a;
    min-width: 70px;
    flex-shrink: 0;
    opacity: 0.9;
}

.chapter-post-title {
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
}

/* 圆点指示器 - 更精致 */
.chapter-link::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d4c9b8;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chapter-item:hover .chapter-link::before {
    background: #a7987a;
    transform: scale(1.3);
}

.chapter-item.current-chapter .chapter-link::before {
    background: #a7987a;
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 3px rgba(167, 152, 122, 0.2);
}

/* 响应式设计 - 优化手机体验 */
@media (max-width: 768px) {
    .chapter-index-wrapper {
        margin: 15px 0;
    }
    
    .chapter-index-container {
        border-radius: 8px;
        border-left: none;
        border-right: none;
    }
    
    .chapter-header {
        padding: 12px 16px;
    }
    
    .chapter-header:hover {
        padding-left: 16px;
    }
    
    .chapter-title {
        font-size: 14px;
        letter-spacing: 0.5px;
    }
    
    .chapter-toggle {
        width: 20px;
        height: 20px;
    }
    
    .toggle-icon {
        font-size: 10px;
    }
    
    .chapter-list {
        padding: 4px 0;
    }
    
    .chapter-link {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 16px;
        gap: 4px;
    }
    
    .chapter-link:hover {
        padding-left: 20px;
    }
    
    .chapter-item.current-chapter .chapter-link {
        padding-left: 20px;
    }
    
    .chapter-item.current-chapter .chapter-link:hover {
        padding-left: 24px;
    }
    
    .chapter-part {
        min-width: auto;
        font-size: 12px;
    }
    
    .chapter-post-title {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .chapter-link::before {
        width: 5px;
        height: 5px;
    }
    
    .chapter-item.current-chapter .chapter-link::before {
        width: 6px;
        height: 6px;
    }
}

/* ========================================
   Language Switcher Styles
   ======================================== */

.language-switcher {
    display: inline-block;
    margin: 15px 0;
}

.language-switch-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #a7987a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(167, 152, 122, 0.2);
    cursor: pointer;
}

.language-switch-button:hover {
    background: #96886a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(167, 152, 122, 0.3);
    color: #ffffff;
}

.language-switch-button:active {
    transform: translateY(0);
}

.language-switch-button.disabled {
    background: #f0f0f0;
    color: #aaaaaa;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    opacity: 0.7;
}

.language-switch-button .flag {
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.language-switch-button .language-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.language-switch-button .unavailable-hint {
    font-size: 11px;
    opacity: 0.6;
    font-weight: 400;
    margin-left: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .language-switcher {
        margin: 12px 0;
    }
    
    .language-switch-button {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .language-switch-button .flag {
        font-size: 18px;
    }
    
    .language-switch-button .language-label {
        font-size: 12px;
    }
    
    .language-switch-button .unavailable-hint {
        font-size: 10px;
    }
}
