/* ========================================
   タイムライン型目次スタイル
   ======================================== */

.timeline-toc {
    position: fixed;
    left: 0;
    top: 60px;
    width: 320px;
    height: calc(100vh - 60px);
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%);
    transform: translateX(-320px);
    transition: transform 0.3s ease;
    z-index: 110;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.timeline-toc.active {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

/* タイムラインヘッダー */
.timeline-header {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.timeline-subtitle {
    font-size: 0.85rem;
    color: #8b92a8;
}

.timeline-home-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.timeline-home-link:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    transform: translateX(2px);
}

.timeline-home-link svg {
    width: 16px;
    height: 16px;
}

/* タイムラインコンテンツ */
.timeline-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 0;
    position: relative;
}

/* タイムライン軸 */
.timeline-content::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(99, 102, 241, 0.3) 10%,
        rgba(99, 102, 241, 0.5) 50%,
        rgba(99, 102, 241, 0.3) 90%,
        transparent 100%
    );
}

/* タイムラインアイテム */
.timeline-item {
    position: relative;
    padding: 1rem 1.5rem 1rem 70px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    user-select: none;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: #2a2d3a;
    border: 2px solid #4a4d5a;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1;
}

/* 公開済み */
.timeline-item.published {
    cursor: pointer !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.timeline-item.published::before {
    background: linear-gradient(135deg, #10b981, #34d399);
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

/* アクティブ */
.timeline-item.active {
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1));
}

.timeline-item.active::before {
    width: 20px;
    height: 20px;
    left: 30px;
    background: #6366f1;
    border-color: #8b92fc;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.8);
}

/* 未公開 */
.timeline-item.locked::before {
    background: #1a1a2e;
    border-style: dashed;
}

/* ホバー効果 */
.timeline-item.published:hover {
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1));
    transform: translateX(2px);
}

.timeline-item.published:active {
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.15));
    transform: translateX(0);
}

.timeline-item.published:hover::before {
    transform: translateY(-50%) scale(1.2);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
}

/* チャプター情報 */
.timeline-chapter-number {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #8b92a8;
    z-index: 2;
    width: 24px;
    text-align: center;
}

.timeline-item.published .timeline-chapter-number {
    color: #fff;
}

.timeline-chapter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
}

.timeline-item.locked .timeline-chapter-title {
    color: #6a6f7f;
}

.timeline-chapter-subtitle {
    font-size: 0.8rem;
    color: #8b92a8;
    margin-bottom: 0.25rem;
}

.timeline-chapter-date {
    font-size: 0.75rem;
    color: #6a6f7f;
}

/* パートセクション */
.timeline-part {
    margin: 2rem 0;
    padding-left: 70px;
}

.timeline-part-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    position: relative;
}

.timeline-part-title::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6366f1);
}

/* Coming Soonセクション */
.timeline-coming-soon {
    margin: 3rem 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.timeline-coming-soon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.timeline-coming-soon-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

.timeline-coming-soon-text {
    font-size: 0.9rem;
    color: #8b92fc;
    font-weight: 500;
    position: relative;
}

.timeline-coming-soon-count {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #6366f1;
    margin-top: 0.5rem;
}

/* アニメーション */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 新章解禁アニメーション */
.timeline-item.new-unlock {
    animation: unlockChapter 0.8s ease;
}

@keyframes unlockChapter {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    50% {
        transform: translateX(5px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* プログレスインジケーター */
.timeline-progress {
    position: absolute;
    left: 40px;
    top: 0;
    width: 2px;
    background: linear-gradient(180deg, #10b981 0%, #6366f1 100%);
    z-index: 1;
    transition: height 0.5s ease;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .timeline-toc {
        width: 100%;
        transform: translateX(-100%);
    }
    
    .timeline-toc.active {
        transform: translateX(0);
    }
}

/* スクロールバーカスタマイズ */
.timeline-content::-webkit-scrollbar {
    width: 4px;
}

.timeline-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

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

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