/* カスタムスタイル */

/* 差分表示 */
.diff-added {
    background-color: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-left: 3px solid #28a745;
    margin-bottom: 4px;
}

.diff-deleted {
    background-color: #f8d7da;
    color: #721c24;
    padding: 4px 8px;
    border-left: 3px solid #dc3545;
    margin-bottom: 4px;
}

.diff-modified {
    margin-bottom: 8px;
}

.diff-modified .before {
    background-color: #f8d7da;
    color: #721c24;
    padding: 4px 8px;
    border-left: 3px solid #dc3545;
    margin-bottom: 2px;
}

.diff-modified .after {
    background-color: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-left: 3px solid #28a745;
}

/* ステータスバッジ */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-draft {
    background-color: #e2e8f0;
    color: #4a5568;
}

.status-preview {
    background-color: #bee3f8;
    color: #2c5282;
}

.status-staging {
    background-color: #fef3c7;
    color: #92400e;
}

.status-executing {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ログ表示 */
.log-info {
    color: #2563eb;
}

.log-warning {
    color: #f59e0b;
}

.log-error {
    color: #dc2626;
}

/* アニメーション */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* AI風アニメーション効果 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* ラジオボタンのカスタムスタイル */
input[type="radio"]:checked + div {
    font-weight: bold;
}

input[type="radio"]:checked ~ * {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* グラデーション背景のホバー効果 */
.bg-gradient-to-r:hover {
    transform: translateY(-2px);
}

/* ========== トレーニングフロー ========== */

/* オーバーレイ（暗い背景） */
#training-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9990;
    transition: opacity 0.3s ease;
}

/* スポットライト（ハイライト枠） */
#training-spotlight {
    position: absolute;
    z-index: 9991;
    border-radius: 8px;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.6),
        0 0 0 4px rgba(99, 102, 241, 0.7),
        0 0 20px 4px rgba(99, 102, 241, 0.3);
    transition: top 0.4s ease, left 0.4s ease, width 0.4s ease, height 0.4s ease;
    pointer-events: none;
}

/* ツールチップ */
#training-tooltip {
    position: absolute;
    z-index: 9992;
    width: 400px;
    max-width: calc(100vw - 32px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: none;
}

#training-tooltip.training-tooltip-center {
    position: fixed;
    width: 480px;
}

/* ツールチップ ヘッダー */
.training-tooltip-header {
    display: flex;
    align-items: center;
    padding: 16px 20px 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.training-tooltip-icon {
    font-size: 24px;
    margin-right: 10px;
    line-height: 1;
}

.training-tooltip-title {
    font-size: 16px;
    font-weight: 700;
    flex: 1;
}

.training-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.training-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ツールチップ 本文 */
.training-tooltip-body {
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
}

/* ツールチップ フッター */
.training-tooltip-footer {
    padding: 12px 20px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* プログレスバー */
.training-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.training-progress-text {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

.training-progress-bar {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.training-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* ナビゲーションボタン */
.training-nav {
    display: flex;
    gap: 8px;
}

.training-prev-btn,
.training-next-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.training-prev-btn {
    background: #f3f4f6;
    color: #6b7280;
}

.training-prev-btn:hover {
    background: #e5e7eb;
}

.training-next-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.training-next-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* トレーニング中のbody */
body.training-active {
    overflow: hidden;
}

/* 登場アニメーション */
@keyframes training-tooltip-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#training-tooltip.training-tooltip-enter {
    animation: training-tooltip-in 0.3s ease forwards;
}

#training-tooltip.training-tooltip-center.training-tooltip-enter {
    animation: training-tooltip-in 0.3s ease forwards;
}

/* トレーニング開始ボタン */
.training-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.training-start-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.training-start-btn svg {
    width: 14px;
    height: 14px;
}

/* ===========================================================================
   info-tip: ボタン横の「?」ホバー説明ツールチップ（媒体反映の優先順位の注記用）
   =========================================================================== */
.info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 5px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.85);
    color: #6b21a8;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    user-select: none;
    vertical-align: middle;
    flex-shrink: 0;
}
/* 濃色ボタンの外に置く独立バッジ用（グレー） */
.info-tip.info-tip-standalone {
    background: #e5e7eb;
    color: #4b5563;
    border: 1px solid #d1d5db;
}
.info-tip .info-tip-box {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 70;
    top: 150%;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    max-width: 78vw;
    background: #1f2937;
    color: #f9fafb;
    text-align: left;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.55;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    transition: opacity 0.15s ease;
    white-space: normal;
    pointer-events: none;
}
.info-tip .info-tip-box b {
    color: #fde68a;
}
.info-tip:hover .info-tip-box,
.info-tip:focus .info-tip-box,
.info-tip:focus-within .info-tip-box {
    visibility: visible;
    opacity: 1;
}
.info-tip .info-tip-box::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #1f2937;
}
