/* ====================================
   patent.php 専用CSS
   DigPat デザインシステム準拠
   ==================================== */

/* ========================================
   ユニバーサルリセット
   ======================================== */

* {
    box-sizing: border-box;
}

/* ========================================
   ベーススタイル
   ======================================== */

html {
    overflow-x: hidden;
    max-width: 100vw;
    box-sizing: border-box;
}

body {
    background: #f8fafc; /* 極薄グレー */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
    line-height: 1.6;
    color: #192f60; /* アイアンブルー */
    padding-top: var(--header-height, 3.5rem);
    overflow-x: hidden;
    max-width: 100vw;
}

/* ========================================
   ローディング画面
   ======================================== */

.loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height, 3.5rem));
    padding: 40px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e2e8f0;
    border-top-color: #f39800; /* マリーゴールド */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
}

/* ========================================
   レポートコンテナ
   ======================================== */

.report-container {
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ========================================
   ヒーローセクション（アイアンブルー背景）
   ======================================== */

.hero-section {
    background: #192f60; /* アイアンブルー単色 */
    color: #ffffff; /* 白テキスト */
    padding: 100px 20px; /* 十分な余白（抜け感） */
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
}

/* ランクバッジ（マリーゴールドアクセント） */
.hero-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f39800; /* マリーゴールド背景 */
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 900;
    padding: 12px 30px;
    border-radius: 50px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(243, 152, 0, 0.3);
}

.hero-rank-badge svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

/* 出願人タイプバッジ */
.applicant-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 10px 25px;
    border-radius: 50px;
    margin-bottom: 20px;
    margin-left: 15px;
    background: rgba(255, 255, 255, 0.1); /* 半透明白 */
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.applicant-type-badge svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

/* キャッチコピー */
.hero-catchcopy {
    font-size: clamp(1.8rem, 5vw, 2.8rem); /* レスポンシブ */
    font-weight: 900;
    margin-bottom: 30px;
    line-height: 1.3;
    color: #ffffff;
    letter-spacing: -0.5px;
}

/* 経済インパクト（Big Number） */
.hero-economic-impact {
    font-size: clamp(3rem, 8vw, 5rem); /* 調整：インパクト重視のサイズ */
    font-weight: 900;
    color: #f39800; /* マリーゴールド */
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-economic-unit {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: rgba(255, 255, 255, 0.8); /* 薄い白 */
    font-weight: 600;
    margin-left: 8px;
}

.hero-description {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.7;
}

.hero-title {
    font-size: clamp(1.8rem, 5vw, 2.8rem); /* キャッチコピーと同じサイズ */
    color: rgba(255, 255, 255, 0.85);
    max-width: 800px;
    margin: 0 auto 30px;
    line-height: 1.4;
    font-weight: 400;
}

/* ========================================
   Bento Grid（12カラムベース）
   ======================================== */

.main-content {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 32px;
    padding: 60px;
    max-width: 1280px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* カード配置（PC版） */
.tech-evaluation-card {
    grid-column: span 8; /* 左2/3 */
    order: 1;
}

.basic-info-card {
    grid-column: span 4; /* 右1/3 */
    grid-row: span 2; /* 2行分の高さ */
    order: 2;
}

.rights-info-card {
    grid-column: span 8; /* 技術詳細の下 */
    order: 3;
}

.cost-card {
    grid-column: span 4; /* 左1/3 - 目標ポジショニング */
    order: 4;
}

.market-fit-card {
    grid-column: span 8; /* 右2/3 - 市場ポテンシャル */
    order: 5;
}

.consultant-section {
    grid-column: 1 / -1; /* 全幅 */
    order: 6;
}

.roadmap-card {
    grid-column: 1 / -1; /* 全幅 */
    order: 7;
}

.economic-impact-card {
    grid-column: span 6; /* 左側 */
    grid-row: span 2; /* 2行分の高さ */
    order: 8;
}

.economic-detail-card {
    grid-column: span 6; /* 右側上 */
    order: 9;
}

.ip-strategy-card {
    grid-column: span 6; /* 右側下 */
    order: 10;
}

.differentiation-card {
    grid-column: 1 / -1; /* 全幅 */
    order: 7; /* 「なぜ今なのか」の直下 */
}

/* ========================================
   統一カードスタイル
   ======================================== */

.section-card {
    background: #ffffff; /* 純白 */
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(25, 47, 96, 0.06); /* アイアンブルー混合シャドウ */
    padding: 32px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* 基本情報の折りたたみ機能（PC・タブレットでは非表示） */
.toggle-basic-info {
    display: none;
}

.basic-info-collapsible {
    max-height: none;
    overflow: visible;
}

.section-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 50px rgba(25, 47, 96, 0.08);
}

/* ========================================
   技術タグ
   ======================================== */

.tech-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.tech-tag {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(243, 152, 0, 0.08), rgba(243, 152, 0, 0.12)); /* マリーゴールド薄め */
    color: #192f60; /* アイアンブルー */
    border: 2px solid rgba(243, 152, 0, 0.3); /* マリーゴールド枠 */
    border-radius: 50px; /* 完全な角丸（ピル型） */
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tech-tag:hover {
    background: linear-gradient(135deg, rgba(243, 152, 0, 0.15), rgba(243, 152, 0, 0.2));
    border-color: rgba(243, 152, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 152, 0, 0.2);
}

/* カードヘッダー */
.card-header {
    background: transparent;
    color: #192f60; /* アイアンブルー */
    padding: 0 0 16px 20px;
    font-weight: 900;
    font-size: clamp(18px, 2.5vw, 24px);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #f39800; /* マリーゴールド縦線 */
    margin-bottom: 20px;
}

/* アイコン（配色の使い分け） */
.icon-outline {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
    flex-shrink: 0;
}

/* 通常アイコン（アイアンブルー） */
.icon-normal {
    color: #192f60;
}

/* 重要アイコン（アイアンブルーに統一） */
.icon-important {
    color: #192f60;
}

/* コストカードのアイコン（サイズと色を統一） */
.cost-card .icon-outline {
    width: 24px;
    height: 24px;
    color: #192f60; /* アイアンブルー */
}

.cost-card .card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

/* Big Number */
.big-number {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 12px;
}

.big-number-currency {
    font-size: 24px;
    font-weight: 600;
    color: #64748b;
}

.big-number-value {
    font-size: clamp(32px, 5vw, 40px);
    font-weight: 900;
    color: #192f60;
    letter-spacing: -0.5px;
}

/* ========================================
   導入ロードマップ（タイムライン）
   ======================================== */

.roadmap-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(25, 47, 96, 0.06);
    padding: 32px;
}

.roadmap-title {
    color: #192f60;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 900;
    margin-bottom: 24px;
    padding-left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #f39800;
}

.roadmap-phases {
    position: relative;
    padding-left: 30px;
}

.roadmap-phase {
    position: relative;
    margin-bottom: 32px;
    padding-left: 20px;
}

.roadmap-phase::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 8px;
    width: 16px;
    height: 16px;
    background: #f39800; /* マリーゴールド */
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #f39800;
    z-index: 2;
}

.roadmap-phase::after {
    content: '';
    position: absolute;
    left: -22px;
    top: 24px;
    width: 2px;
    height: calc(100% + 8px);
    background: #cbd5e1; /* 薄グレー */
    z-index: 1;
}

.roadmap-phase:last-child::after {
    display: none;
}

.roadmap-phase-name {
    font-size: 18px;
    font-weight: 700;
    color: #192f60;
    margin-bottom: 8px;
}

.roadmap-phase-duration {
    font-size: 14px;
    font-weight: 600;
    color: #192f60; /* アイアンブルー */
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.roadmap-phase-duration svg {
    width: 18px;
    height: 18px;
}

.roadmap-phase-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.7;
}

.roadmap-support-box,
.roadmap-success-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

/* ========================================
   テーブル（差別化比較表）
   ======================================== */

.table-responsive-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0;
}

.differentiation-card table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
    min-width: 600px; /* スマホでスクロール */
}

.differentiation-card thead {
    background: #f8fafc; /* 極薄グレー */
}

.differentiation-card th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: #192f60; /* アイアンブルー */
    border: 1px solid #e2e8f0;
}

.differentiation-card td {
    padding: 16px;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.differentiation-card tbody tr:hover {
    background: #f8fafc;
}

.differentiation-card tbody tr td:first-child {
    font-weight: 600;
    color: #192f60;
}

/* ========================================
   チャートコンテナ
   ======================================== */

.chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 360px;
    max-height: 100%;
}

/* ========================================
   審査タイムライン
   ======================================== */

.timeline-item {
    position: relative;
    padding-left: 20px;
    margin-bottom: 16px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 10px;
    height: 10px;
    background: #f39800; /* マリーゴールド統一 */
    border-radius: 50%;
    z-index: 2;
}

.timeline-dot {
    display: none; /* 既存のドットを無効化 */
}

/* ========================================
   CTAセクション
   ======================================== */

.cta-section {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 10px 50px rgba(25, 47, 96, 0.08);
    padding: 40px;
    text-align: center;
    max-width: 1000px;
    margin: 40px auto 20px; /* 上40px、下20px */
}

.cta-title {
    color: #192f60;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    margin-bottom: 24px;
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
    margin-bottom: 28px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label {
    font-size: 15px;
    color: #192f60;
    font-weight: 500;
}

.cta-button {
    background: #f39800; /* マリーゴールド */
    color: #ffffff;
    font-weight: 700;
    padding: 20px 44px;
    border: none;
    border-radius: 50px;
    font-size: clamp(16px, 2.5vw, 18px);
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(243, 152, 0, 0.25);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.cta-button .icon-outline {
    color: #ffffff; /* ボタン内のアイコンは白色 */
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(243, 152, 0, 0.35);
    background: #d97706;
}

/* ========================================
   フッター
   ======================================== */

.report-footer {
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    text-align: center;        /* right → center に変更 */
    font-size: 0.85rem;
    color: #64748b;
}

/* ========================================
   レスポンシブ対応
   ======================================== */

/* タブレット（768px-1199px） */
@media screen and (max-width: 1199px) and (min-width: 769px) {
    .main-content {
        grid-template-columns: repeat(6, 1fr);
        gap: 24px;
        padding: 40px;
    }

    /* PC版のレイアウトを維持（12カラム → 6カラムで比率保持） */

    /* Row 1: 技術詳細(4) + 基本情報(2, 2行) */
    .tech-evaluation-card {
        grid-column: span 4; /* 4/6 = 2/3 */
        order: 1;
    }

    .basic-info-card {
        grid-column: span 2; /* 2/6 = 1/3 */
        grid-row: span 2; /* 2行分の高さを維持 */
        order: 2;
    }

    /* Row 2: 参入スピード(4) */
    .rights-info-card {
        grid-column: span 4; /* 4/6 = 2/3 */
        order: 3;
    }

    /* Row 3: 目標ポジショニング(2) + 市場ポテンシャル(4) */
    .cost-card {
        grid-column: span 2; /* 2/6 = 1/3 */
        order: 4;
    }

    .market-fit-card {
        grid-column: span 4; /* 4/6 = 2/3 */
        order: 5;
    }

    /* Row 4: コンサル総評(全幅) */
    .consultant-section {
        grid-column: 1 / -1;
        order: 6;
    }

    /* Row 5: 導入ロードマップ(全幅) */
    .roadmap-card {
        grid-column: 1 / -1;
        order: 7;
    }

    /* Row 6: 競合優位性(全幅) */
    .differentiation-card {
        grid-column: 1 / -1;
        order: 8;
    }

    /* Row 7-8: 経済インパクト(3, 2行) + 経済詳細(3) + 知財戦略(3) */
    .economic-impact-card {
        grid-column: span 3; /* 3/6 = 1/2 */
        grid-row: span 2; /* 2行分の高さを維持 */
        order: 9;
    }

    .economic-detail-card {
        grid-column: span 3; /* 3/6 = 1/2 */
        order: 10;
    }

    .ip-strategy-card {
        grid-column: span 3; /* 3/6 = 1/2 */
        order: 11;
    }

    .checkbox-grid {
        gap: 12px 20px;
    }
}

/* スマホ（768px以下） */
@media screen and (max-width: 768px) {
    /* 全体の横幅制御 */
    html, body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .report-container {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .hero-section {
        padding: 24px 16px !important; /* 60px 20px → 24px 16px */
        padding-left: 16px !important;
        padding-right: 16px !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .main-content {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        padding: 24px 16px !important; /* 32px 20px → 24px 16px */
        padding-left: 16px !important;
        padding-right: 16px !important;
        max-width: 100vw !important; /* PC版のmax-width: 1280pxを解除 */
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 全カードを強制的に全幅表示 */
    .section-card,
    .tech-evaluation-card,
    .basic-info-card,
    .rights-info-card,
    .cost-card,
    .market-fit-card,
    .consultant-section,
    .roadmap-card,
    .economic-impact-card,
    .economic-detail-card,
    .ip-strategy-card,
    .differentiation-card {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* スマホでの表示順序（技術情報優先） */
    .tech-evaluation-card { order: 1; }
    .basic-info-card { order: 2; }
    .rights-info-card { order: 3; }
    .cost-card { order: 4; }
    .market-fit-card { order: 5; }
    .consultant-section { order: 6; }
    .roadmap-card { order: 7; }         /* なぜ今かの下 */
    .differentiation-card { order: 8; }  /* 導入ロードマップの下 */
    .economic-impact-card { order: 9; }  /* 活用モデルピボット案 */
    .economic-detail-card { order: 10; } /* 経済効果の想定 */
    .ip-strategy-card { order: 11; }     /* 審査プロセス評価 */

    .basic-info-card,
    .economic-impact-card {
        grid-row: auto; /* PC版の2行分をリセット */
    }

    /* カード余白調整 */
    .section-card {
        padding: 24px; /* 20px → 24px 統一 */
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .roadmap-card {
        padding: 24px; /* 20px → 24px 統一 */
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* カードタイトルのフォントサイズ調整 */
    .card-header {
        font-size: clamp(16px, 4vw, 20px); /* 少し縮小 */
    }

    /* 本文フォントサイズ調整 */
    .card-content {
        font-size: 13px; /* 14px → 13px */
    }

    .cta-section {
        padding: 24px 16px !important; /* 28px 20px → 24px 16px */
        padding-left: 16px !important;
        padding-right: 16px !important;
        margin: 24px auto 16px; /* 30px auto 20px → 24px auto 16px */
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .checkbox-grid {
        flex-direction: column;
        align-items: center; /* flex-start → center 中央寄せ */
        gap: 12px;
        padding: 0;
    }

    .checkbox-item {
        justify-content: flex-start;
    }

    /* テーブル横スクロール機能の強化 */
    .table-responsive-wrapper {
        border-radius: 8px;
        box-shadow: inset 0 0 0 1px #e2e8f0;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100%;
    }

    .differentiation-card {
        overflow: visible; /* カード自体ははみ出さない */
    }

    .differentiation-card table {
        min-width: 600px; /* テーブルのみ横長 */
    }

    /* 基本情報の折りたたみボタン（スマホのみ表示） */
    .toggle-basic-info {
        display: flex !important;
        background: linear-gradient(135deg, rgba(243, 152, 0, 0.08), rgba(243, 152, 0, 0.12));
        border: 2px solid rgba(243, 152, 0, 0.3);
        border-radius: 12px;
        padding: 12px 16px;
        width: 100%;
        font-size: 14px;
        font-weight: 700;
        color: #192f60;
        cursor: pointer;
        margin-bottom: 16px;
        transition: all 0.3s ease;
        align-items: center;
        justify-content: space-between;
    }

    .toggle-basic-info:hover {
        background: linear-gradient(135deg, rgba(243, 152, 0, 0.12), rgba(243, 152, 0, 0.16));
        border-color: rgba(243, 152, 0, 0.5);
    }

    .toggle-basic-info::after {
        content: '▼';
        font-size: 12px;
        color: #f39800;
        transition: transform 0.3s ease;
    }

    .toggle-basic-info.active::after {
        transform: rotate(180deg);
    }

    /* 基本情報の折りたたみコンテンツ */
    .basic-info-collapsible {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
    }

    .basic-info-collapsible.active {
        max-height: 3000px;
    }
}

@media screen and (max-width: 480px) {
    .hero-section {
        padding: 20px 12px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .hero-rank-badge {
        font-size: 1.2rem;
        padding: 10px 20px;
    }

    .applicant-type-badge {
        font-size: 1rem;
        padding: 8px 16px;
        margin-left: 0;
        margin-top: 10px;
    }

    .main-content {
        padding: 20px 12px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        gap: 20px !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .section-card {
        padding: 20px;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .roadmap-card {
        padding: 20px;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .cta-section {
        padding: 20px 12px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin: 20px auto 12px;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

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

    /* 折りたたみボタンさらに縮小 */
    .toggle-basic-info {
        font-size: 13px;
        padding: 10px 14px;
    }
}
