/* GPTリンクのスタイル */
a[data-aui-link="true"] {
    color: #0073aa;
    text-decoration: none;
    border-bottom: 2px dotted #0073aa;
    position: relative;
    transition: all 0.2s ease;
    padding: 0 2px;
}

a[data-aui-link="true"]:hover {
    color: #005a87;
    border-bottom-color: #005a87;
    background-color: rgba(0, 115, 170, 0.05);
}

/* モバイルでのタップ領域を拡大 */
@media (max-width: 768px) {
    a[data-aui-link="true"] {
        padding: 2px 4px;
        margin: 0 2px;
    }
}

/* ツールチップ */
.aui-tooltip {
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    max-width: 400px;
    pointer-events: auto;
}

.aui-tooltip-content {
    padding: 20px;
    position: relative;
}

.aui-tooltip-title {
    font-weight: bold;
    font-size: 18px;
    color: #23282d;
    margin-bottom: 10px;
    padding-right: 30px; /* 閉じるボタンのスペース */
}

.aui-tooltip-description {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    max-height: 200px;
    overflow-y: auto;
    word-wrap: break-word;
}

.aui-tooltip-url {
    text-align: right;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.aui-tooltip-url a {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: rgba(0, 115, 170, 0.05);
}

.aui-tooltip-url a:hover {
    color: #005a87;
    background-color: rgba(0, 115, 170, 0.1);
}

/* 閉じるボタン（モバイル用） */
.aui-tooltip-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: all 0.2s ease;
    font-weight: bold;
}

.aui-tooltip-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* ツールチップの矢印 */
.aui-tooltip::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #ddd;
}

.aui-tooltip::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #fff;
}

/* モバイル用の調整 */
@media (max-width: 768px) {
    .aui-tooltip {
        max-width: calc(100vw - 40px);
        margin: 0 20px;
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%);
    }
    
    .aui-tooltip-content {
        padding: 15px;
    }
    
    .aui-tooltip-title {
        font-size: 16px;
        padding-right: 40px;
    }
    
    .aui-tooltip-description {
        font-size: 13px;
        max-height: 250px;
    }
    
    /* モバイルでは矢印を非表示 */
    .aui-tooltip::before,
    .aui-tooltip::after {
        display: none;
    }
    
    /* モバイルで見やすくするための影を強化 */
    .aui-tooltip {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
}

/* スクロールバーのスタイル */
.aui-tooltip-description::-webkit-scrollbar {
    width: 6px;
}

.aui-tooltip-description::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.aui-tooltip-description::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.aui-tooltip-description::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aui-tooltip {
    animation: fadeIn 0.3s ease;
}