/* Topics Detail ページ専用スタイル */

/* タイトル */
.topics-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #667eea;
    display: inline-block;
}

/* 商品カード */
.product-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.product-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #667eea;
    padding: 1rem 1.5rem;
}
.product-card .card-header h2 {
    color: #333;
    font-weight: 600;
    margin-bottom: 0;
}
.product-card .card-header p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0;
    margin-top: 0.5rem;
}
.product-card .list-group-item {
    border-left: none;
    border-right: none;
    padding: 1rem 1.5rem;
    transition: background-color 0.2s, padding-left 0.2s;
}
.product-card .list-group-item:first-child {
    border-top: none;
}
.product-card .list-group-item:last-child {
    border-bottom: none;
}
.product-card .list-group-item:hover {
    background-color: #f8f9fa;
    padding-left: 2rem;
}
.product-card .list-group-item a {
    color: #495057;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.product-card .list-group-item a:hover {
    color: #667eea;
}
.product-card .list-group-item a::before {
    content: '\F285';
    font-family: 'bootstrap-icons';
    color: #667eea;
    font-size: 0.8rem;
}

/* PDFカード */
.pdf-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}
.pdf-card .card-body {
    padding: 1.5rem;
}

/* PDFコンテナ（PDF.jscanvasレンダリング） */
.pdf-card .pdf-container {
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f8f9fa;
    max-width: 100%;
}

/* ページナビゲーション */
.pdf-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
}
.pdf-page-info {
    font-size: 0.9rem;
    color: #495057;
    min-width: 7em;
    text-align: center;
}

/* canvasラッパー：横スクロールなし・幅100%に収縮 */
.pdf-canvas-wrapper {
    position: relative;
    width: 100%;
    background: #e9ecef;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem 0;
    min-height: 200px;
}
#pdfCanvas {
    /* JS側でwidthを動的に設定するため最大幅だけ指定 */
    max-width: 100%;
    height: auto !important;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background: #fff;
}

/* ローディング表示 */
.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    color: #6c757d;
    font-size: 0.9rem;
}
.pdf-loading.d-none {
    display: none !important;
}

.pdf-card .pdf-fallback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}
.pdf-card .pdf-fallback .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}
.pdf-card .pdf-fallback .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* コンテンツカード */
.content-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.content-card .card-body {
    padding: 2rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    /* タイトル */
    .topics-title {
        font-size: 1.25rem;
        padding-bottom: 0.5rem;
    }

    /* 商品カード */
    .product-card .card-header {
        padding: 0.75rem 1rem;
    }
    .product-card .list-group-item {
        padding: 0.75rem 1rem;
    }
    .product-card .list-group-item:hover {
        padding-left: 1.25rem;
    }

    /* PDFカード */
    .pdf-card .card-body {
        padding: 0.5rem;
    }
    .pdf-nav {
        gap: 0.5rem;
        padding: 0.5rem;
    }
    .pdf-canvas-wrapper {
        padding: 0.5rem 0;
    }
    .pdf-card .pdf-fallback {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        margin-top: 0.5rem;
    }
    .pdf-card .pdf-fallback span {
        text-align: center;
        display: block;
    }
    .pdf-card .pdf-fallback .btn {
        width: 100%;
        padding: 0.75rem 1rem;
    }

    /* コンテンツカード */
    .content-card .card-body {
        padding: 1rem;
    }

    /* ページトップボタン */
    #pageTopBtn {
        width: 45px !important;
        height: 45px !important;
        line-height: 45px !important;
        bottom: 15px !important;
        right: 15px !important;
    }
}
