/* Comparison Section */
.comparison {
    padding: 80px 0 40px 0; 
    background: linear-gradient(180deg, #e8f4fd 0%, #f0f7ff 100%);
    position: relative;
    overflow: hidden;
}

/*
Background Image Effect
*/
.comparison::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: url('images/city-skyline.png') no-repeat bottom center;
    background-size: cover;
    opacity: 0.1;
    z-index: 0;
}

.comparison .container {
    position: relative;
    z-index: 1;
}

/*
Header
*/
.comparison-header {
    text-align: center;
    margin-bottom: 15px;
}

.comparison-header .section-title {
    color: #1a1a1a;
    font-size: 48px;
    margin-bottom: 10px;
    text-shadow: none;
}

.section-subtitle-en {
    font-family: var(--font-primary);
    font-size: 18px;
    letter-spacing: 0.2em;
    opacity: 0.6;
    text-transform: uppercase;
    color: #666;
}

/*
比較テーブルラッパー
*/
.comparison-table-wrapper {
    background: transparent !important;
    border: none !important;
    margin-bottom: 40px;
    overflow-x: visible; /* PC画面ではスクロールなし */
    overflow-y: hidden;
    box-shadow: none !important;
}

/* スクロールバーのスタイリング */
.comparison-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.comparison-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.comparison-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.comparison-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/*
テーブル全体
*/
.comparison-table {
    width: 100%;
    border: none !important;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--font-primary), var(--font-japanese);
    text-align: center;
    table-layout: fixed;
}

/*
ヘッダー行
*/
.comparison-table thead tr {
    background: transparent !important;
    border: none !important;
}

.comparison-table th {
    padding: 0;
    text-align: center !important;
    vertical-align: bottom;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

/* 左上の空セル */
.empty-cell {
    width: 15%;
    background: linear-gradient(180deg, #e8f4fd 0%, #f0f7ff 100%) !important;
    border: none !important;
    opacity: 1 !important;
}

/*
会社ヘッダー列
*/
.company-col {
    padding: 0 !important;
    border: none !important;
    position: relative;
}

/*
スグカク列の幅を1.2倍に
*/
.company-col.sugukaku {
    width: 32% !important;
}

.company-col.competitor {
    width: 24% !important;
}

.company-col.inhouse {
    width: 24% !important;
}

/* 会社ヘッダー */
.company-header {
    padding: 15px 20px;
    text-align: center !important;
    border: none !important;
    border-radius: 15px 15px 0 0;
    margin: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 60px; /* 最小高さを設定 */
    height: 60px; /* 高さを固定 */
}

/* スグカク列を高くする */
.company-col.sugukaku .company-header {
    background: #ff9500;
    padding: 25px 20px;
    margin-top: -5px;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(255, 149, 0, 0.2);
    border-radius: 20px 20px 0 0;
    min-height: 80px; /* スグカク列は少し高く */
    height: 80px; /* 高さを固定 */
}
.company-col.competitor .company-header {
    background: #6c757d;
    padding: 15px 20px;
}

.company-col.inhouse .company-header {
    background: #6c757d;
    padding: 15px 20px;
}

.company-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
    color: white !important;
    text-align: center !important;
}

/*
テーブルボディ
*/
.comparison-table tbody tr {
    border: none !important;
    position: relative;
}

.comparison-table td {
    padding: 10px 20px;
    text-align: center !important;
    vertical-align: middle !important;
    border: none !important;
    position: relative;
}

/*
左端の機能ラベル
*/
.feature-label {
    background: #2563eb;
    color: white;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.05em;
    width: 10%;
    text-align: center !important;
    vertical-align: middle !important;
    position: relative;
    padding: 10px 20px;
}

.feature-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: white;
}

/*
最後の機能ラベルは下線なし
*/
.comparison-table tbody tr:last-child .feature-label::after {
    display: none;
}

/*
データセル
*/
.sugukaku-data {
    background: #fff5e6 !important;
    text-align: center !important;
    vertical-align: middle !important;
    width: 32% !important;
    position: relative;
    border-left: 2px solid #ff9500 !important;
    border-right: 2px solid #ff9500 !important;
}

.competitor-data {
    background: #f5f5f5;
    text-align: center !important;
    vertical-align: middle !important;
    width: 24% !important;
    position: relative;
}

.inhouse-data {
    background: #f5f5f5;
    text-align: center !important;
    vertical-align: middle !important;
    width: 24% !important;
    position: relative;
}

/*
データセルの下に薄緑色の線を追加
*/
.sugukaku-data::after,
.competitor-data::after,
.inhouse-data::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #e8f4fd;
}

/*
最後の行のデータセルは下線なし
*/
.comparison-table tbody tr:last-child .sugukaku-data::after,
.comparison-table tbody tr:last-child .competitor-data::after,
.comparison-table tbody tr:last-child .inhouse-data::after {
    display: none;
}

/* 最後の行のスグカク列に下のボーダーを追加 */
.comparison-table tbody tr:last-child .sugukaku-data {
    background: #fff5e6 !important;
    text-align: center !important;
    vertical-align: middle !important;
    width: 32% !important;
    position: relative;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/*
データコンテンツ
*/
.data-content {
    text-align: center !important;
    width: 100%;
    height: 100%;
}

.data-content p {
    color: #333;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    text-align: center !important;
}

/*
ハイライト
*/
.highlight-pink {
    color: #ff6b00;
    font-weight: 700;
    font-size: 16px;
}

/*
すべての枠線を削除
*/
.comparison-table,
.comparison-table * {
    outline: none !important;
}

/*
モバイル用カードを完全に削除
*/
.comparison-cards-mobile {
    display: none !important; /* 常に非表示 */
}

/*
レスポンシブ対応
*/
@media (max-width: 1024px) {
    /* タブレットから横スクロール開始 */
    .comparison-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .comparison-table {
        min-width: 900px; /* タブレットでの最小幅 */
        font-size: 14px;
    }

    /* ヘッダーの高さ固定 */
    .company-header {
        min-height: 55px;
        height: 55px;
        padding: 10px 15px;
    }
    
    .company-col.sugukaku .company-header {
        min-height: 75px;
        height: 75px;
        padding: 20px 15px;
    }

    .company-header h3 {
        font-size: 16px;
    }

    .feature-label {
        font-size: 14px;
    }

    .data-content p {
        font-size: 14px;
    }

    .highlight-pink {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .comparison {
        padding: 60px 0;
    }

    .comparison-header {
        margin-bottom: 30px;
    }

    .comparison-header .section-title {
        font-size: 36px;
    }

    /* テーブルラッパーは表示したまま */
    .comparison-table-wrapper {
        display: block !important; /* 表示を維持 */
        margin: 0 -20px; /* 左右の余白を調整 */
        padding: 0 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .comparison-table {
        min-width: 700px; /* モバイルでの最小幅 */
        font-size: 14px;
    }

    /* ヘッダーの高さ固定 */
    .company-header {
        min-height: 50px;
        height: 50px;
        padding: 10px 10px;
    }
    
    .company-col.sugukaku .company-header {
        min-height: 70px;
        height: 70px;
        padding: 15px 10px;
    }
    
    .company-header h3 {
        font-size: 14px;
    }
    
    /* スクロール可能であることを示すグラデーション */
    .comparison-table-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, rgba(248, 250, 252, 0.8));
        pointer-events: none;
    }
}

@media (max-width: 480px) {
    .comparison {
        padding: 40px 0;
    }

    .comparison-header .section-title {
        font-size: 28px;
    }

    .section-subtitle-en {
        font-size: 14px;
    }
    
    .comparison-table {
        min-width: 600px; /* スマホでの最小幅 */
        font-size: 13px;
    }

    /* ヘッダーの高さ固定（480px以下も同じ設定を維持） */
    .company-header {
        min-height: 50px;
        height: 50px;
        padding: 10px 10px;
    }
    
    .company-col.sugukaku .company-header {
        min-height: 60px;
        height: 60px;
        padding: 15px 10px;
    }
    
    .company-header h3 {
        font-size: 14px;
    }
    
    .feature-label {
        font-size: 13px;
        padding: 8px 15px;
    }
    
    .data-content p {
        font-size: 13px;
    }
}
