/* 
 * 目次とトップに戻るボタンのスタイル
 * ファイル配置場所: /ai/css/ui/table-of-contents.css
 */

/* 目次セクション */
.table-of-contents {
    background: #f5f8ff;
    border: 1px solid #2196F3;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.table-of-contents h2 {
    color: #1976D2;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* 目次リスト */
.table-of-contents ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    max-height: 600px;
    overflow-y: auto;
}

/* カスタムスクロールバー */
.table-of-contents ul::-webkit-scrollbar {
    width: 8px;
}

.table-of-contents ul::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-of-contents ul::-webkit-scrollbar-thumb {
    background: #90CAF9;
    border-radius: 4px;
}

.table-of-contents ul::-webkit-scrollbar-thumb:hover {
    background: #64B5F6;
}

/* 目次項目 */
.table-of-contents li {
    margin-bottom: 8px;
    line-height: 1.8;
}

/* メインセクションのリンク */
.table-of-contents li a {
    color: #1976D2;
    text-decoration: none;
    font-weight: 500;
    display: block;
    padding: 5px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.table-of-contents li a:hover {
    background-color: #E3F2FD;
    color: #0D47A1;
    padding-left: 20px;
}

/* サブセクション */
.table-of-contents li.toc-sub {
    margin-left: 20px;
}

.table-of-contents li.toc-sub a {
    font-weight: normal;
    font-size: 0.95rem;
    color: #2196F3;
}

.table-of-contents li.toc-sub a:hover {
    color: #1565C0;
}

/* トップに戻るボタン */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background-color: #1976D2;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-to-top:active {
    transform: translateY(-1px);
}

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

/* モバイル対応 */
@media (max-width: 768px) {
    .table-of-contents {
        padding: 15px;
        margin: 20px 0;
    }
    
    .table-of-contents h2 {
        font-size: 1.2rem;
    }
    
    .table-of-contents ul {
        max-height: 400px;
    }
    
    .table-of-contents li a {
        padding: 8px 12px;
        font-size: 0.95rem;
    }
    
    .table-of-contents li.toc-sub {
        margin-left: 15px;
    }
    
    .table-of-contents li.toc-sub a {
        font-size: 0.9rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* タブレット対応 */
@media (max-width: 1024px) and (min-width: 769px) {
    .table-of-contents ul {
        max-height: 500px;
    }
}
