/* ========================================
   用語ツールチップ
   ======================================== */

/* 用語が存在するラベル */
.gpc-has-term {
    border-bottom: 1px dotted #6b7280;
    cursor: help;
    position: relative;
}

.gpc-has-term:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ツールチップポップアップ（PC） */
.gpc-tooltip {
    position: fixed;
    z-index: 100000;
    background: #1d2327;
    color: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 320px;
    min-width: 200px;
    font-size: 13px;
    line-height: 1.6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(4px);
    animation: gpcTooltipFadeIn 0.2s ease forwards;
}

@keyframes gpcTooltipFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gpc-tooltip-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: #93c5fd;
}

.gpc-tooltip-desc {
    color: #e5e7eb;
    margin-bottom: 8px;
}

.gpc-tooltip-link {
    display: inline-block;
    color: #93c5fd;
    font-size: 12px;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.gpc-tooltip-link:hover {
    border-bottom-color: #93c5fd;
}

/* ツールチップの矢印 */
.gpc-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-bottom-color: #1d2327;
}

.gpc-tooltip.gpc-tooltip-above::before {
    bottom: auto;
    top: 100%;
    border-bottom-color: transparent;
    border-top-color: #1d2327;
}

/* モバイル用ボトムシート */
.gpc-tooltip-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

.gpc-tooltip-overlay.active {
    display: block;
}

.gpc-tooltip-sheet {
    position: fixed;
    z-index: 100000;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    max-height: 60vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.gpc-tooltip-sheet.active {
    transform: translateY(0);
}

.gpc-tooltip-sheet-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.gpc-tooltip-sheet-name {
    font-weight: 700;
    font-size: 18px;
    color: #1d2327;
    margin-bottom: 8px;
}

.gpc-tooltip-sheet-desc {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 16px;
}

.gpc-tooltip-sheet-link {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.gpc-tooltip-sheet-link:hover {
    background: #135e96;
    color: #fff;
}

/* タッチデバイスではボトムシートを使用 */
@media (hover: none) {
    .gpc-tooltip {
        display: none !important;
    }
}

/* ホバー可能デバイスではボトムシートを無効化 */
@media (hover: hover) {
    .gpc-tooltip-overlay,
    .gpc-tooltip-sheet {
        display: none !important;
    }
}
