/* ======================================================
   comparison.css - AIロープレ比較ページ専用スタイル
   - index.cssのデザインシステムを継承
   - 比較表とカード型レイアウトに最適化
   ====================================================== */

/* ===== Hero Section ===== */
.comparison-hero {
    background: var(--bg-gradient-primary);
    color: var(--white);
    padding: 166px 24px 74px;
    text-align: center;
}

.comparison-hero h1 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    color: var(--white);
}

.comparison-hero .hero-subtitle {
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
}

.comparison-hero .hero-description {
    font-size: clamp(14px, 1.5vw, 16px);
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
    opacity: 0.95;
}

.comparison-hero .highlight-text {
    color: var(--color-bronze);
    font-weight: 700;
}

/* ===== Quick Comparison Table Section ===== */
.quick-comparison-section {
    padding: 80px 24px;
    background: var(--color-gray-lightF2);
}

.section-title {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    color: var(--color-forest-dark);
    line-height: 1.4;
}

/* ===== Quick Comparison Table ===== */
.comparison-table-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* 既存のラッパーはそのまま */
.comparison-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) var(--gray-200);
}

.comparison-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
}

.comparison-table thead {
    background: transparent;
}

.comparison-table th {
    padding: 18px 16px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: var(--color-forest-dark);
    border: 1px solid #cab898;
    vertical-align: middle;
}

.comparison-table th.comparison-item-header {
    text-align: center;
    min-width: 140px;
    background: #d9c9a8;
    color: var(--color-forest-dark);
}

.comparison-table th.highlight-column {
    background: var(--color-teal);
    color: var(--white);
    position: relative;
    border-color: var(--color-teal);
    border-top: 2px solid var(--color-green-light69);
    border-left: 2px solid var(--color-green-light69);
    border-right: 2px solid var(--color-green-light69);
}

.comparison-table th.competitor-column {
    background: #d9c9a8;
    color: var(--color-forest-dark);
}

.comparison-table td {
    padding: 18px 16px;
    font-size: 14px;
    line-height: 1.7;
    vertical-align: middle;
    text-align: center;
    border: 1px solid #f2f2f2;
}

.comparison-table td.comparison-item {
    font-weight: 600;
    color: var(--color-forest-dark);
    background: var(--white);
    text-align: center;
    min-width: 140px;
}

.comparison-table td.highlight-column {
    background: #d8e9e0;
    font-weight: 500;
    color: var(--color-forest-dark);
    text-align: center;
    border-left: 2px solid var(--color-green-light69);
    border-right: 2px solid var(--color-green-light69);
}

.comparison-table td.competitor-cell {
    background: var(--white);
    color: var(--color-teal);
}

.comparison-table tbody tr:hover {
    background: transparent;
}

.comparison-table tbody tr:hover td.comparison-item {
    background: #eeeee5;
}

.comparison-table tbody tr:hover td.highlight-column {
    background: #cde0d5;
}

.comparison-table tbody tr:hover td.competitor-cell {
    background: #fafafa;
}

.comparison-table tbody tr:last-child td.highlight-column {
    border-bottom: 2px solid var(--color-green-light69);
}

.table-note {
    text-align: left;
    margin: 24px 0 0 18px;
    font-size: 12px;
    color: var(--color-primary);
    font-weight: 500;
    padding-left: 1em;
    text-indent: -1em;
}

/* ===== Why Kartie Section ===== */
.why-kartie-section {
    padding: 80px 24px;
    background: #e8e8e8; /* グレー背景に変更 */
}

.difference-block {
    margin-bottom: 72px;
}

.difference-block:last-child {
    margin-bottom: 0;
}

.difference-title {
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 32px;
    color: var(--color-forest-dark);
    text-align: center;
}

.comparison-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.comparison-card {
    background: var(--white);
    border-radius: 12px;
    overflow: visible; /* バッジ表示のため */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

/* カルティロープレカードのバッジ */
.kartie-card::before {
    content: 'カルティロープレの強み';
    position: absolute;
    top: -12px;
    left: 20px;
    background: #d4a574; /* ブロンズ/ゴールド色 */
    color: var(--color-forest-dark);
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    z-index: 1;
}

.comparison-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.comparison-card .card-header {
    padding: 32px 24px 15px;
    font-weight: 700;
    font-size: 18px;
    border-radius: 12px 12px 0 0;
}

.kartie-card .card-header {
    background: var(--color-teal);
    color: var(--white);
}

.general-card .card-header {
    background: var(--white);
    color: var(--color-forest-dark);
    border-bottom: none;
}

.kartie-card .card-header h4 {
    color: var(--white);
}

.comparison-card .card-body {
    padding: 0px 24px 24px 24px;
    background: var(--white);
    border-radius: 0 0 12px 12px;
}

.comparison-card .card-body.strengths {
    background: var(--color-teal);
}

.comparison-card .card-body h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 16px;
    display: none;
}

.feature-item {
    margin-bottom: 20px;
    padding: 20px;
    background: #fff9f0;
    border-left: 4px solid #d4a574;
    border-radius: 4px;
}

.kartie-card .feature-item {
    background: #fff9f0;
    border-left-color: #d4a574;
}

.general-card .feature-item {
    background: #f5f5f5;
    border-left-color: #999;
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.5;
}

.feature-title img {
    width: 12px;
    margin-right: 6px;
    filter: invert(55%) sepia(86%) saturate(500%) hue-rotate(92deg) brightness(95%) contrast(90%);
}

.general-card .feature-title img {
    filter: brightness(0) saturate(100%) invert(33%) sepia(0%) saturate(0%) hue-rotate(183deg) brightness(96%) contrast(85%);
}

.kartie-card .feature-title {
    color: var(--color-forest-dark);
}

.general-card .feature-title {
    color: var(--color-forest-dark);
}

.feature-description {
    font-size: 14px;
    line-height: 1.8;
    color: var(--gray-700);
}

/* ===== Detailed Comparison Table Section ===== */
.detailed-comparison-section {
    padding: 80px 24px;
    background: var(--white);
}

.detailed-table {
    min-width: 800px;
}

.detailed-table th.category-header {
    min-width: 120px;
    text-align: left;
}

.detailed-table th.feature-header {
    min-width: 160px;
    text-align: left;
}

.detailed-table td.category-cell {
    background: var(--color-forest-dark);
    font-weight: 700;
    color: var(--white);
    text-align: center;
    vertical-align: top;
    min-width: 120px;
    border: 1px solid var(--color-forest-dark);
    border-bottom: 1px solid var(--white);
}

.detailed-table td.feature-cell {
    background: var(--white);
    font-weight: 600;
    color: var(--color-forest-dark);
    text-align: center;
    min-width: 160px;
}

ul.table-notes {
    margin: 24px 0 0 18px;
    list-style: none;
}

ul.table-notes li {
    font-size: 12px;
    line-height: 1.8;
    color: var(--color-primary);
    padding-left: 1em;
    text-indent: -1em;
}

.table-notes li:last-child {
    margin-bottom: 0;
}

ul.table-notes li strong {
    font-weight: 700;
}

.table-notes li:last-child {
    margin-bottom: 0;
}

/* ===== Service Selection Section ===== */
.service-selection-section {
    padding: 80px 24px;
    background: var(--gray-100);
}

.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 48px;
}

.service-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.service-card-header {
    padding: 24px;
    text-align: center;
}

.service-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 700;
    background: var(--gray-300);
    color: var(--gray-800);
}

.kartie-service-card {
    background-color: #edfff5;
}

.kartie-service-card .service-badge {
    background: var(--color-teal);
    color: var(--white);
}

.kartie-badge {
    background: var(--color-teal);
    color: var(--white);
}

.service-card-body {
    padding: 0 24px 32px;
}

.service-card-body h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--color-forest-dark);
    text-align: center;
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-features li {
    font-size: 14px;
    line-height: 1.8;
    color: var(--gray-700);
    margin-bottom: 16px;
    padding-left: 24px;
    position: relative;
}

.service-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 16px;
    height: 16px;
    background-image: url('../img/icon/icon-check.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: invert(55%) sepia(86%) saturate(500%) hue-rotate(92deg) brightness(95%) contrast(90%);
}

.service-features li:last-child {
    margin-bottom: 0;
}

.service-description {
    font-size: 14px;
    line-height: 1.8;
    color: var(--gray-700);
}

/* ===== Responsive Styles ===== */
@media (max-width: 768px) {
    .comparison-hero {
        padding: 166px 20px 60px;
    }

    .quick-comparison-section,
    .why-kartie-section,
    .detailed-comparison-section,
    .service-selection-section {
        padding: 60px 20px;
    }

    .cta-section {
        padding: 60px 20px;
    }

    .section-title {
        margin-bottom: 32px;
    }

    .difference-block {
        margin-bottom: 56px;
    }

    .comparison-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 16px 12px;
        font-size: 13px;
    }

    ul.table-notes {
        margin: 24px 0 0 0;
    }

    .table-note {
        margin-left: 0;
    }

    .service-cards {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 32px;
    }

    .cta-section h2 {
        margin-bottom: 20px;
    }

    .cta-section p {
        margin-bottom: 24px;
    }

    .cta-section .btn {
        width: 100%;
        max-width: 320px;
        padding: 14px 32px;
        font-size: 16px;
    }

    .comparison-table-container {
        --scroll-opacity: 0.6;
    }

    .comparison-table-container::after {
        content: '';
        position: absolute;
        right: 24px;
        top: 50%;
        transform: translateY(-50%);
        
        background-image: url('../img/icon/arrow-icon.svg');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        
        width: 40px;
        height: 40px;
        
        opacity: var(--scroll-opacity);
        pointer-events: none;
        z-index: 10;
        
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
        
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    /* アニメーションは初期状態のみ */
    .comparison-table-container:not(.scrolled-end):not(.is-scrolling)::after {
        animation: scroll-hint 2s infinite;
    }

    @keyframes scroll-hint {
        0%, 100% { 
            transform: translateY(-50%) translateX(0); 
        }
        50% { 
            transform: translateY(-50%) translateX(5px); 
        }
    }

    /* 完全に右端に到達したら非表示 */
    .comparison-table-container.scrolled-end::after {
        opacity: 0;
        animation: none;
    }

    /* スクロール中は一時的にアニメーション停止（オプション） */
    .comparison-table-container.is-scrolling::after {
        animation: none;
    }

    .why-kartie-section {
        padding: 60px 20px;
    }

    .difference-block {
        margin-bottom: 56px;
    }

    .difference-title {
        text-align: left;
        margin-bottom: 32px;
        font-size: clamp(18px, 2.5vw, 24px);
    }

    .comparison-cards {
        grid-template-columns: 1fr;
        gap: 32px; /* カード間の余白を広げる */
    }

    .kartie-card::before {
        font-size: 12px;
        padding: 5px 12px;
        left: 16px;
    }

    .comparison-card .card-header {
        padding: 28px 20px 16px;
        font-size: 16px;
    }

    .comparison-card .card-body {
        padding: 20px;
    }

    .feature-item {
        padding: 16px;
    }

}

@media (max-width: 520px) {
    .comparison-hero {
        padding: 166px 16px 50px;
    }

    .quick-comparison-section,
    .why-kartie-section,
    .detailed-comparison-section,
    .service-selection-section {
        padding: 50px 16px;
    }

    .cta-section {
        padding: 50px 16px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 12px 8px;
        font-size: 12px;
    }

    .comparison-card .card-header,
    .comparison-card .card-body {
        padding: 20px;
    }

    .service-card-header,
    .service-card-body {
        padding: 20px;
    }

    .service-card-body {
        padding: 0 20px 20px 20px;
    }

    .why-kartie-section {
        padding: 50px 16px;
    }

    .comparison-card .card-header {
        padding: 24px 16px 16px;
    }

    .comparison-card .card-body {
        padding: 0px 16px 16px;
    }

    .feature-item {
        padding: 14px;
    }
}

/* ===== アクセシビリティ向上 ===== */
@media (prefers-reduced-motion: reduce) {
    .comparison-card,
    .service-card {
        transition: none;
    }

    .comparison-card:hover,
    .service-card:hover {
        transform: none;
    }
}

/* ===== 印刷用スタイル ===== */
@media print {
    .comparison-hero {
        background: var(--white);
        color: var(--black);
        padding: 40px 0;
    }

    .comparison-table-wrapper {
        overflow: visible;
    }

    .comparison-table {
        min-width: 100%;
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }

    .comparison-card,
    .service-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
        page-break-inside: avoid;
    }

    .cta-section {
        display: none;
    }
}