/* ==========================================================================
   詳細資料ボタン & モーダルシステム
   ========================================================================== */

/* 詳細資料ボタン */
.detail-button-container {
    text-align: center;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.detail-button,
.consultation-button {
    border: none;
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    width: 300px !important;
    max-width: 300px;
    min-width: 300px;
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
    color: white !important;
}

.detail-button {
    background: linear-gradient(45deg, #2196f3, #42a5f5);
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
}

/* 無料相談ボタン */
.consultation-button {
    background: linear-gradient(45deg, #ff6b35, #ff8a65);
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.detail-button:hover,
.consultation-button:hover {
    transform: translateY(-2px);
    text-decoration: none !important;
    color: white !important;
}

.detail-button:hover {
    box-shadow: 0 8px 30px rgba(33, 150, 243, 0.4);
    background: linear-gradient(45deg, #1976d2, #2196f3);
}

.consultation-button:hover {
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.4);
    background: linear-gradient(45deg, #e64a19, #ff6b35);
}

.detail-button:active,
.consultation-button:active {
    transform: translateY(0);
    text-decoration: none !important;
    color: white !important;
}

.detail-button:active {
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
}

.consultation-button:active {
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

/* フォーカス時もスタイル統一 */
.detail-button:focus,
.consultation-button:focus {
    outline: none;
    text-decoration: none !important;
    color: white !important;
}

/* モーダル背景 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* 初期状態で完全に非表示 */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    display: flex; /* アクティブ時にflexに変更 */
    opacity: 1;
    visibility: visible;
}

/* モーダルコンテンツ */
.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(30px) scale(0.9);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

/* モーダルヘッダー */
.modal-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-subtitle {
    font-size: 16px;
    color: #333;
    margin: 0;
    font-weight: 500;
}

/* 閉じるボタン */
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

/* 選択肢ボタン */
.option-button {
    background: linear-gradient(45deg, #4caf50, #66bb6a);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin: 10px 0;
    transition: all 0.3s ease;
    box-shadow: 0 3px 15px rgba(76, 175, 80, 0.3);
}

.option-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.4);
    background: linear-gradient(45deg, #388e3c, #4caf50);
}

.option-button:active {
    transform: translateY(0);
}

/* ==========================================================================
   プログラムテーブル & マップモーダル
   ========================================================================== */

/* プログラムテーブル */
.program-info-table {
    width: 100%;
    max-width: 800px;
    margin: 30px auto;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-collapse: collapse;
    table-layout: fixed; /* 重要：固定レイアウトに変更 */
}

/* コラム幅の指定（table-layout: fixed用） */
.program-info-table col.label-col {
    width: 30%; /* PC版：ラベル列30% */
}

.program-info-table col.content-col {
    width: 70%; /* PC版：コンテンツ列70% */
}

.program-info-table thead {
    background: linear-gradient(135deg, #e60039, #ff4569);
    color: white;
}

.program-info-table thead th {
    padding: 20px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.program-info-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.program-info-table tbody tr:hover {
    background-color: #f8f9fa;
}

.program-info-table tbody tr:last-child {
    border-bottom: none;
}

.program-info-table td {
    padding: 16px 20px;
    vertical-align: top;
}

/* より強力な詳細度で幅を指定 */
table.program-info-table td.label-cell {
    background-color: #f8f9fa !important;
    font-weight: 600 !important;
    color: #495057 !important;
    width: 30% !important; /* PC版：30% */
    border-right: 2px solid #e60039 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important; /* 英語・URLも強制改行 */
    hyphens: auto !important; /* ハイフネーション */
}

table.program-info-table td.content-cell {
    color: #6c757d !important;
    line-height: 1.6 !important;
    width: 70% !important; /* PC版：70% */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important; /* 英語・URLも強制改行 */
    hyphens: auto !important; /* ハイフネーション */
    max-width: 0 !important; /* テーブル幅制限のトリック */
}

.program-info-table .content-cell strong {
    color: #e60039;
    font-weight: 600;
}

.program-info-table .link {
    color: #e60039;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    word-break: break-all !important; /* URLの強制改行 */
    overflow-wrap: break-word !important;
}

.program-info-table .link:hover {
    color: #d10033;
    text-decoration: underline;
}

/* 価格情報のスタイリング */
.price-info {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 12px;
    border-radius: 8px;
    margin: 8px 0;
}

.price-item {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    padding: 6px 0;
    border-bottom: 1px solid #dee2e6;
}

.price-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

/* 住所情報のスタイリング（クリック可能） */
.address-info {
    margin-bottom: 12px;
}

.address-clickable {
    color: #e60039;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
}

.address-clickable:hover {
    color: #d10033;
    text-decoration: underline;
}

.address-description {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #1565c0;
    margin-top: 8px;
    border-left: 4px solid #2196f3;
}

/* マップモーダルのスタイル */
.map-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.map-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.map-modal-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 90%;
    width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: translateY(30px) scale(0.9);
    transition: all 0.3s ease;
}

.map-modal-overlay.active .map-modal-content {
    transform: translateY(0) scale(1);
}

.map-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.map-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.map-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-modal-close:hover {
    color: #333;
}

.map-container {
    width: 100%;
    height: 450px;
    position: relative;
}

.map-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 16px 16px;
}

.map-info {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.map-address {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.map-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.map-link {
    color: #e60039;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid #e60039;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.map-link:hover {
    background: #e60039;
    color: white;
}

/* ==========================================================================
   イメージスライダー
   ========================================================================== */

/* プラグラムイメージスライド */
.image-slider {
    position: relative;
    max-width: 500px;
    margin: 30px auto;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* スライド表示エリア */
.slider-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* アスペクト比16:9で固定 */
    overflow: hidden;
}

/* スライドコンテナ */
.slider-container {
    display: flex;
    width: 300%; /* 3枚の画像の場合 */
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

/* 各スライド */
.slide {
    width: 33.333%; /* 3枚の場合は33.333% */
    height: 100%;
    flex-shrink: 0;
    position: relative;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 画像がない場合のプレースホルダー */
.slide-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #e9ecef, #dee2e6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 18px;
    font-weight: 500;
}

/* ナビゲーション矢印（PC用・画像上に配置） */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 10;
}

.slider-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.slider-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.slider-nav.prev {
    left: 15px;
}

.slider-nav.next {
    right: 15px;
}

/* ドットナビゲーション */
.slider-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px;
    background: rgba(248, 249, 250, 0.9);
    flex-wrap: nowrap;
}

.dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    min-height: 10px;
    border-radius: 50%;
    background: #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    margin: 0 8px;
    flex-shrink: 0;
    flex-grow: 0;
}

.dot:hover {
    background: #adb5bd;
}

.dot.active {
    background: #e60039;
    box-shadow: 0 0 0 2px rgba(230, 0, 57, 0.2);
}

/* ==========================================================================
   目次システム
   ========================================================================== */

/* 目次のスタイル */
#auto-table-of-contents {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#auto-table-of-contents h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    border-bottom: 2px solid #e60039;
    padding-bottom: 5px;
    font-size: 18px;
}

#auto-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    line-height: 1.6;
}

#auto-toc-list li {
    margin: 8px 0;
}

#auto-toc-list a {
    text-decoration: none;
    color: #495057;
    display: block;
    padding: 5px 0;
    transition: all 0.2s ease;
    border-radius: 4px;
}

#auto-toc-list a:hover {
    color: #007bff;
    background-color: #e3f2fd;
}

/* 階層レベルのインデント */
.auto-toc-level-2 { 
    padding-left: 0 !important; 
    font-weight: 600; 
    font-size: 16px;
}
.auto-toc-level-3 { 
    padding-left: 30px !important; 
    font-size: 15px;
}
.auto-toc-level-4 { 
    padding-left: 60px !important; 
    font-size: 14px;
}

.auto-toc-level-2:hover { padding-left: 10px !important; }
.auto-toc-level-3:hover { padding-left: 40px !important; }
.auto-toc-level-4:hover { padding-left: 70px !important; }

/* アクティブリンクのスタイル */
#auto-toc-list a.active {
    color: #007bff;
    background-color: #e3f2fd;
    font-weight: 600;
}

/* ==========================================================================
   CVボタン
   ========================================================================== */

/* CVボタンのスタイル */
.cv-button-container {
    text-align: center;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cv-button {
    background: linear-gradient(45deg, #e60039, #ff4569);
    color: white !important;
    border: none;
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(230, 0, 57, 0.3);
    transition: all 0.3s ease;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    width: 300px !important;
    max-width: 300px;
    min-width: 300px;
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
}

.cv-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(230, 0, 57, 0.4);
    background: linear-gradient(45deg, #d10033, #e60039);
    text-decoration: none !important;
    color: white !important;
}

.cv-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(230, 0, 57, 0.3);
    text-decoration: none !important;
    color: white !important;
}

.cv-button:focus {
    outline: none;
    text-decoration: none !important;
    color: white !important;
}

/* ==========================================================================
   レスポンシブ対応
   ========================================================================== */

@media (max-width: 768px) {
    /* ボタン関連 */
    .detail-button-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .detail-button,
    .consultation-button {
        width: 90% !important;
        max-width: 90%;
        min-width: 90%;
        font-size: 14px;
        padding: 14px 24px;
    }
    
    /* CVボタン */
    .cv-button-container {
        margin: 20px 0;
    }
    
    .cv-button {
        width: 90% !important;
        max-width: 90%;
        min-width: 90%;
        padding: 14px 24px;
        font-size: 14px;
    }
    
    /* モーダル関連 */
    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .modal-subtitle {
        font-size: 14px;
    }
    
    .option-button {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    /* テーブル関連 - より強力な詳細度 */
    table.program-info-table {
        font-size: 14px !important;
        table-layout: fixed !important; /* モバイルでも固定レイアウト維持 */
    }
    
    /* モバイル版コラム幅の指定 */
    .program-info-table col.label-col {
        width: 25% !important; /* モバイル版：ラベル列25% */
    }

    .program-info-table col.content-col {
        width: 75% !important; /* モバイル版：コンテンツ列75% */
    }
    
    table.program-info-table thead th {
        padding: 16px 12px !important;
        font-size: 18px !important;
    }
    
    table.program-info-table td {
        padding: 12px !important;
    }
    
    table.program-info-table td.label-cell {
        width: 25% !important; /* モバイルでは25% */
        font-size: 13px !important;
        background-color: #f8f9fa !important;
        font-weight: 600 !important;
        color: #495057 !important;
        border-right: 2px solid #e60039 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-all !important; /* 英語・URLも強制改行 */
        hyphens: auto !important;
    }
    
    table.program-info-table td.content-cell {
        width: 75% !important; /* モバイルでの残り75% */
        font-size: 14px !important;
        color: #6c757d !important;
        line-height: 1.6 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-all !important; /* 英語・URLも強制改行 */
        hyphens: auto !important;
        max-width: 0 !important; /* テーブル幅制限のトリック */
    }
    
    .price-item {
        font-size: 13px;
    }
    
    .address-description {
        font-size: 13px;
    }
    
    /* マップモーダル関連 */
    .map-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .map-container {
        height: 300px;
    }
    
    .map-modal-header {
        padding: 15px 20px;
    }
    
    .map-modal-title {
        font-size: 16px;
    }
    
    .map-info {
        padding: 15px 20px;
    }
    
    .map-links {
        gap: 10px;
    }
    
    .map-link {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    /* スライダー関連 */
    .image-slider {
        margin: 20px 10px;
    }
    
    .slider-nav {
        display: none;
    }
    
    .slider-dots {
        padding: 20px;
    }
    
    .dot {
        margin: 0 6px;
        flex-shrink: 0;
        flex-grow: 0;
    }
    
    /* 目次関連 */
    #auto-table-of-contents {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .auto-toc-level-2 { padding-left: 0 !important; }
    .auto-toc-level-3 { padding-left: 20px !important; }
    .auto-toc-level-4 { padding-left: 40px !important; }
    
    .auto-toc-level-2:hover { padding-left: 8px !important; }
    .auto-toc-level-3:hover { padding-left: 28px !important; }
    .auto-toc-level-4:hover { padding-left: 48px !important; }
}

/* デスクトップ用の追加スタイル */
@media (min-width: 769px) {
    .dot {
        width: 10px;
        height: 10px;
        min-width: 10px;
        min-height: 10px;
        margin: 0 10px;
    }
}

/* ==========================================================================
   アニメーション効果
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cvFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-button-container {
    animation: fadeInUp 0.8s ease-out;
}

.program-info-table {
    animation: fadeIn 0.8s ease-out;
    -webkit-animation: fadeIn 0.8s ease-out;
}

.image-slider {
    animation: slideIn 0.8s ease-out;
}

.cv-button-container {
    animation: cvFadeIn 0.8s ease-out;
}

/* ==========================================================================
   デモ用スタイル
   ========================================================================== */

.demo-section {
    margin: 50px 0;
    padding: 30px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #f9f9f9;
}

.demo-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}