:root {
    --vi-panel-bg: #ffffff;
    --vi-text-color: #1a1a2e;
    
    /* Button Colors */
    --vi-btn-side: #6c8de3; 
    --vi-btn-center: #1d4ed8; 
    --vi-btn-center-active: #111827; 
    --vi-btn-text: #ffffff;
    
    --vi-divider: rgba(0, 0, 0, 0.1);
}

/* Navigation Container Setup */
.velvet-ink-tools-wrapper {
    position: relative; 
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px 0;
}

.velvet-ink-nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; 
    margin-bottom: 20px;
}

/* Button Base Styles */
.vi-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--vi-btn-text);
    padding: 10px 18px;
    border: none;
    border-radius: 8px; 
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

/* Previous and Next Buttons */
.vi-nav-btn:not(.vi-toc-btn) {
    background-color: var(--vi-btn-side);
}
.vi-nav-btn:not(.vi-toc-btn):hover {
    filter: brightness(0.9);
}
.vi-nav-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Table of Contents Middle Button */
.vi-toc-btn {
    background-color: var(--vi-btn-center);
}
.vi-toc-btn.active, .vi-toc-btn:hover {
    background-color: var(--vi-btn-center-active);
}

/* The Floating Pop-Up Modal */
.vi-modal-popup {
    position: absolute;
    top: 60px; 
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: 90vw;
    max-width: 450px;
    background-color: var(--vi-panel-bg) !important;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 999999 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--vi-divider);
}

.vi-modal-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.vi-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--vi-divider);
}

.vi-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--vi-text-color);
}

.vi-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--vi-text-color);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.vi-toc-modal-list {
    list-style: none;
    padding: 10px;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.vi-toc-item a {
    color: var(--vi-text-color);
    text-decoration: none;
    display: block;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
}
.vi-toc-item a:hover {
    background-color: var(--vi-divider);
}
.vi-toc-item.current-chapter a {
    font-weight: bold;
    color: var(--vi-btn-center);
}