/* =================================================================
 * Page Specific Styles for Mach Tech Analyzer (style.css)
 * ================================================================= */

/* --- 1. 汎用パーツ調整 --- */

/* バッジの視認性向上 */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* フォームのアイコン調整 */
.input-group-text {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

/* --- 2. 履歴テーブル --- */

.result-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

/* テーブル行のホバーエフェクト */
.table-hover tbody tr:hover {
    background-color: var(--bs-primary-bg-subtle);
}

/* テーブルヘッダー固定と背景色 */
.table thead th {
    background-color: var(--bs-body-bg);
    /* 背景色と同じにして透けないように */
    color: var(--bs-body-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 var(--bs-border-color);
    /* 下線代わり */
}

/* 長いテキストの省略設定 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* --- 3. 結果エリア (Tech Analyzer固有) --- */

/* タブのスタイル調整 */
.tool-results .nav-tabs .nav-link {
    color: var(--bs-secondary);
    transition: all 0.2s ease;
}

.tool-results .nav-tabs .nav-link:hover {
    color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.tool-results .nav-tabs .nav-link.active {
    color: var(--bs-primary);
    background-color: transparent;
    border-color: var(--bs-border-color) var(--bs-border-color) transparent;
    font-weight: bold;
}

.tool-results .nav-tabs {
    border-bottom-color: var(--bs-border-color);
}

/* --- 4. ダークモード対応 / 入力欄の表示調整 --- */
/* 結果表示エリアのinput/textareaは、編集不可だが読みやすくする */

.tool-results .form-control-plaintext,
.tool-results .form-control[readonly] {
    background-color: rgba(255, 255, 255, 0.05);
    /* ほんのり明るく */
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    opacity: 1;
}

.tool-results .form-label {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
}

/* OG画像がない場合のプレースホルダー */
.tool-results .og-placeholder {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--bs-border-color);
    color: var(--bs-secondary-color);
    min-height: 200px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bs-border-radius);
    flex-direction: column;
}

/* --- 5. インタラクティブ要素 (リンクバッジ) --- */

/* リンク化されたスタックバッジ */
.stack-badge {
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
}

.stack-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
    color: #fff !important;
    /* ホバー時も白文字を維持 */
    border-color: rgba(255, 255, 255, 0.2);
}

/* バッジ内のアイコン */
.stack-badge i {
    transition: opacity 0.2s;
}

.stack-badge:hover i {
    opacity: 1 !important;
}

/* --- ローディングオーバーレイ (修正: 画面全体を覆う) --- */
.loading-overlay {
    position: fixed;
    /* viewportに対して固定 */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    /* 濃いめにして背景を隠す */
    display: none;
    flex-direction: column;
    /* アイコンと文字を縦並び */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* モーダル等よりも最前面 */
    backdrop-filter: blur(5px);
}

.loading-overlay h5 {
    margin-top: 1rem;
    color: #fff;
    font-weight: bold;
    letter-spacing: 1px;
}

.loading-overlay p {
    color: rgba(255, 255, 255, 0.7);
}

/* リンク化されたバッジ */
.stack-badge {
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.stack-badge:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    color: #fff !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* その他スタイルは前回同様 */
.tool-results .form-control[readonly] {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

.tool-results .nav-tabs .nav-link.active {
    background-color: transparent;
    color: var(--bs-primary);
    border-color: var(--bs-border-color) var(--bs-border-color) transparent;
}

/* --- 7. レスポンシブ調整 --- */
@media (max-width: 576px) {
    .btn-group-sm>.btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .stack-badge {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }
}/* =================================================================
 * Page Specific Styles for Mach Tech Analyzer (style.css)
 * ================================================================= */

/* --- 1. 汎用パーツ調整 --- */

/* バッジの視認性向上 */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* フォームのアイコン調整 */
.input-group-text {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

/* --- 2. 履歴テーブル --- */

.result-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

/* テーブル行のホバーエフェクト */
.table-hover tbody tr:hover {
    background-color: var(--bs-primary-bg-subtle);
}

/* テーブルヘッダー固定と背景色 */
.table thead th {
    background-color: var(--bs-body-bg);
    /* 背景色と同じにして透けないように */
    color: var(--bs-body-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 var(--bs-border-color);
    /* 下線代わり */
}

/* 長いテキストの省略設定 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* --- 3. 結果エリア (Tech Analyzer固有) --- */

/* タブのスタイル調整 */
.tool-results .nav-tabs .nav-link {
    color: var(--bs-secondary);
    transition: all 0.2s ease;
}

.tool-results .nav-tabs .nav-link:hover {
    color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.tool-results .nav-tabs .nav-link.active {
    color: var(--bs-primary);
    background-color: transparent;
    border-color: var(--bs-border-color) var(--bs-border-color) transparent;
    font-weight: bold;
}

.tool-results .nav-tabs {
    border-bottom-color: var(--bs-border-color);
}

/* --- 4. ダークモード対応 / 入力欄の表示調整 --- */
/* 結果表示エリアのinput/textareaは、編集不可だが読みやすくする */

.tool-results .form-control-plaintext,
.tool-results .form-control[readonly] {
    background-color: rgba(255, 255, 255, 0.05);
    /* ほんのり明るく */
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    opacity: 1;
}

.tool-results .form-label {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
}

/* OG画像がない場合のプレースホルダー */
.tool-results .og-placeholder {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--bs-border-color);
    color: var(--bs-secondary-color);
    min-height: 200px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bs-border-radius);
    flex-direction: column;
}

/* --- 5. インタラクティブ要素 (リンクバッジ) --- */

/* リンク化されたスタックバッジ */
.stack-badge {
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
}

.stack-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
    color: #fff !important;
    /* ホバー時も白文字を維持 */
    border-color: rgba(255, 255, 255, 0.2);
}

/* バッジ内のアイコン */
.stack-badge i {
    transition: opacity 0.2s;
}

.stack-badge:hover i {
    opacity: 1 !important;
}

/* --- 6. ローディングオーバーレイ --- */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    /* 画面幅いっぱい */
    height: 100vh;
    /* 画面高いっぱい */
    background-color: rgba(0, 0, 0, 0.75);
    /* 背景を暗く */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* 最前面に表示 */
    backdrop-filter: blur(4px);
    /* 背景をぼかす */
}

/* --- 7. レスポンシブ調整 --- */
@media (max-width: 576px) {
    .btn-group-sm>.btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .stack-badge {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* --- 前回の内容に追加・更新 --- */

/* リンク付きバッジ */
.stack-badge {
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
}

.stack-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
    color: #fff !important;
}

/* リンクなしバッジ (ホバー効果を打ち消す) */
.stack-badge.no-hover {
    cursor: default;
    transform: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* 通常の影のみ */
}

.stack-badge.no-hover:hover {
    transform: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 1;
}


/* style.css (Tweaked for Proximity) */

/* コンテナ間隔 */
.tech-badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    /* 密集度を下げるために少し広め(0.5rem)を維持 */
    align-items: center;
    /* 縦方向の中央揃え */
}

/* バッジ本体 */
.stack-badge {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.9rem;
    /* 少し文字サイズを抑えて上品に */
    letter-spacing: 0.3px;
    border: 1px solid transparent;
    /* 枠線分の領域確保 */
}

/* リンクなしバッジのスタイル */
.stack-badge.no-hover {
    cursor: default;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    /* 控えめな影 */
}

/* リンクありバッジのホバー */
.stack-badge:not(.no-hover):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #fff !important;
}

/* アイコン調整 */
.stack-badge i {
    width: 1.2em;
    text-align: center;
}

/* セクション見出しの近接調整 */
h6.text-muted {
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem !important;
    /* 見出しとバッジの距離を定義 */
}

/* スマホ調整 */
@media (max-width: 576px) {
    .stack-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}


/* style.css (Colors & History Fix) */

/* リンク色の調整: ダークテーマに映える明るいシアン/プライマリー */
.history-link,
.hover-primary {
    color: #6ea8fe;
    /* Bootstrap primary-300相当 */
    transition: color 0.2s;
}

.history-link:hover,
.hover-primary:hover {
    color: #9ec5fe;
    /* Bootstrap primary-200相当 */
    text-decoration: underline !important;
}

/* 検出なしバッジ: 破線ボーダー等で控えめに */
.badge.bg-transparent {
    color: var(--bs-secondary) !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* コンテナ間隔 */
.tech-badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* バッジ共通 */
.stack-badge {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

/* リンクなしバッジ */
.stack-badge.no-hover {
    cursor: default;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* リンクありバッジ */
.stack-badge:not(.no-hover):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #fff !important;
}

.stack-badge i {
    width: 1.2em;
    text-align: center;
}

h6.text-muted {
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem !important;
}

@media (max-width: 576px) {
    .stack-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}