/* =========================================
   PDF GENERATION STYLES
   A4縦レイアウト（210mm x 297mm）
   ========================================= */

/* PDF一時コンテナ */
#pdf-temp-container {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 794px; /* A4 @ 96dpi */
}

/* PDF全体 */
.pdf-document {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
    color: #2D3142;
    line-height: 1.6;
}

/* 各ページ共通 */
.pdf-page {
    width: 794px;
    min-height: 1123px; /* A4 @ 96dpi */
    padding: 50px;
    box-sizing: border-box;
    background: #ffffff;
    position: relative;
    page-break-after: always;
    background-image: 
        linear-gradient(rgba(91, 124, 153, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 124, 153, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* ===== 表紙 ===== */
.pdf-cover {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.pdf-cover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.pdf-logo {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #5B7C99;
    letter-spacing: 0.05em;
}

.pdf-date {
    font-size: 12px;
    color: #666;
}

.pdf-cover-main {
    margin-top: 60px;
}

.pdf-cover-label {
    font-size: 14px;
    color: #5B7C99;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.pdf-cover-title {
    font-size: 36px;
    font-weight: 700;
    color: #2D3142;
    margin: 0 0 15px;
    letter-spacing: 0.02em;
}

.pdf-cover-subtitle {
    font-size: 16px;
    color: #666;
}

.pdf-cover-result {
    margin: 40px auto;
    padding: 30px;
    border: 3px solid;
    border-radius: 16px;
    max-width: 400px;
    background: #fff;
}

.pdf-cover-type-badge {
    display: inline-block;
    padding: 6px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 20px;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.pdf-cover-character {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin: 10px 0;
}

.pdf-cover-type-name {
    font-size: 28px;
    font-weight: 700;
    margin: 15px 0 10px;
}

.pdf-cover-type-subtitle {
    font-size: 14px;
    color: #666;
}

.pdf-cover-declaration {
    margin-top: 30px;
    padding: 25px;
    background: #FAFAF8;
    border-radius: 12px;
}

.pdf-declaration-label {
    font-size: 12px;
    color: #5B7C99;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.pdf-declaration-text {
    font-size: 20px;
    font-weight: 600;
    color: #2D3142;
    line-height: 1.5;
}

.pdf-cover-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 11px;
    color: #999;
}

/* ===== ページヘッダー・フッター ===== */
.pdf-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 30px;
    border-bottom: 2px solid;
}

.pdf-page-type {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.pdf-page-num {
    font-size: 12px;
    color: #999;
}

.pdf-page-footer {
    position: absolute;
    bottom: 30px;
    left: 50px;
    right: 50px;
    text-align: center;
    font-size: 10px;
    color: #999;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

/* ===== セクション ===== */
.pdf-section {
    margin-bottom: 30px;
}

.pdf-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #2D3142;
    margin: 0 0 15px;
    padding-bottom: 8px;
    border-bottom: 3px solid;
}

.pdf-intro-text {
    font-size: 14px;
    line-height: 1.8;
}

.pdf-intro-text strong {
    color: #C4594A;
}

.pdf-strength-intro {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.pdf-text {
    font-size: 14px;
    line-height: 1.8;
}

.pdf-text-small {
    font-size: 12px;
    line-height: 1.7;
    color: #666;
    margin-top: 15px;
}

/* ===== リスト ===== */
.pdf-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pdf-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.pdf-list li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #5B7C99;
    font-weight: bold;
}

.pdf-list-check li::before {
    content: "✓";
    color: #7A9E7E;
}

.pdf-list-ordered {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: pdf-list;
}

.pdf-list-ordered li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
    counter-increment: pdf-list;
}

.pdf-list-ordered li::before {
    content: counter(pdf-list);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: #C4594A;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== ハイライトボックス ===== */
.pdf-highlight-box {
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.8;
}

/* ===== コードボックス ===== */
.pdf-code-box {
    background: #2D3142;
    color: #FAFAF8;
    padding: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.pdf-code-box pre {
    margin: 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== ボトルネック処方箋 ===== */
.pdf-bottleneck {
    margin-bottom: 25px;
}

.pdf-bottleneck-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    color: #fff;
}

.pdf-bottleneck-label {
    font-size: 11px;
    font-weight: 700;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 4px;
}

.pdf-bottleneck-title {
    font-size: 16px;
    font-weight: 600;
}

.pdf-bottleneck-issue {
    background: #FAFAF8;
    padding: 12px 20px;
    font-size: 12px;
    color: #666;
    border-left: 3px solid #ddd;
}

.pdf-bottleneck-issue strong {
    color: #2D3142;
}

.pdf-bottleneck-content {
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.pdf-bn-heading {
    font-size: 14px;
    font-weight: 700;
    color: #2D3142;
    margin: 15px 0 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid #D4A03A;
}

.pdf-bn-heading:first-child {
    margin-top: 0;
}

.pdf-bn-text {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 10px;
}

.pdf-bn-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.pdf-bn-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.6;
}

ol.pdf-bn-list {
    counter-reset: bn-list;
}

ol.pdf-bn-list li {
    counter-increment: bn-list;
}

ol.pdf-bn-list li::before {
    content: counter(bn-list);
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    background: #C4594A;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

ul.pdf-bn-list li::before {
    content: "•";
    position: absolute;
    left: 8px;
    top: 0;
    color: #5B7C99;
    font-weight: bold;
    font-size: 16px;
}

.pdf-bn-subitem {
    font-size: 12px;
    color: #666;
    padding-left: 30px;
    margin: 5px 0;
    line-height: 1.5;
}

/* ===== 最終ページ（学習デザイナーとしての旅へ） ===== */
.pdf-closing {
    display: flex;
    flex-direction: column;
}

.pdf-journey {
    flex: 1;
}

.pdf-journey-title {
    font-size: 24px;
    font-weight: 700;
    color: #2D3142;
    margin-bottom: 25px;
    text-align: center;
}

.pdf-journey-intro {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 25px;
    text-align: center;
}

.pdf-journey-formula {
    font-size: 16px;
    font-weight: 700;
    color: #5B7C99;
    text-align: center;
    padding: 20px;
    background: #E8EEF2;
    border-radius: 10px;
    margin: 25px 0;
}

.pdf-journey-body {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 25px;
}

.pdf-journey-body p {
    margin-bottom: 10px;
}

.pdf-journey-highlight {
    font-size: 15px;
    line-height: 1.8;
    padding: 20px;
    background: #FAFAF8;
    border-left: 4px solid #C4594A;
    border-radius: 0 10px 10px 0;
    margin-bottom: 25px;
}

.pdf-journey-highlight strong {
    color: #C4594A;
}

.pdf-journey-closing {
    font-size: 14px;
    line-height: 1.8;
    text-align: center;
    color: #666;
}

.pdf-final-footer {
    margin-top: auto;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
}

.pdf-brand {
    padding: 20px;
}

.pdf-tagline {
    font-size: 14px;
    color: #5B7C99;
    letter-spacing: 0.1em;
    margin-bottom: 5px;
}

.pdf-company {
    font-size: 18px;
    font-weight: 700;
    color: #2D3142;
    margin-bottom: 10px;
}

.pdf-url {
    font-size: 12px;
    color: #999;
}

/* クロージングページのキャラクター画像 */
.pdf-closing-character {
    text-align: center;
    margin-bottom: 20px;
}

.pdf-closing-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

/* AIプロンプトのコピー案内 */
.pdf-prompt-notice {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border: 2px solid #2196F3;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    text-align: center;
}

.pdf-prompt-notice-text {
    font-size: 14px;
    font-weight: 700;
    color: #1565C0;
    margin: 0 0 5px 0;
}

.pdf-prompt-notice-detail {
    font-size: 12px;
    color: #1976D2;
    margin: 0;
}

/* ===== ローディング ===== */
#pdf-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 49, 66, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pdf-loading-content {
    text-align: center;
    color: #fff;
}

.pdf-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #C4594A;
    border-radius: 50%;
    animation: pdf-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes pdf-spin {
    to { transform: rotate(360deg); }
}

.pdf-loading-content p {
    font-size: 18px;
    margin: 0;
}

.pdf-loading-sub {
    font-size: 14px !important;
    color: rgba(255,255,255,0.7);
    margin-top: 10px !important;
}

/* ===== 処方箋専用ページ（1ページ1処方箋） ===== */
.pdf-prescription-page {
    display: flex;
    flex-direction: column;
}

.pdf-prescription-hero {
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.pdf-prescription-page-title {
    font-size: 11px;
    color: #666;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.pdf-prescription-title-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(45,49,66,0.9) 0%, rgba(45,49,66,0.95) 100%);
    border-left: 4px solid;
    border-radius: 0 8px 8px 0;
}

.pdf-prescription-label {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
}

.pdf-prescription-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

/* 処方箋2ページ目のミニヘッダー */
.pdf-prescription-hero-mini {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pdf-prescription-label-mini {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
}

.pdf-prescription-title-mini {
    font-size: 14px;
    font-weight: 600;
    color: #2D3142;
}

.pdf-prescription-issue {
    margin-top: 12px;
    font-size: 13px;
    color: #555;
    padding-left: 5px;
}

.pdf-issue-key {
    font-weight: 700;
    margin-right: 5px;
}

/* 処方箋コンテンツエリア */
.pdf-prescription-content {
    flex: 1;
    padding: 0 5px;
}

/* セクションブロック */
.pdf-section-block {
    margin-bottom: 18px;
    padding: 15px;
    background: #FAFAF8;
    border-radius: 8px;
}

.pdf-section-block.pdf-section-action {
    background: linear-gradient(135deg, #FFF8E7 0%, #FFF5E0 100%);
    border: 1px solid #F5DEB3;
}

.pdf-bn-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid currentColor;
}

.pdf-bn-icon {
    font-size: 16px;
}

/* 処方箋テキスト */
.pdf-bn-text {
    font-size: 12px;
    line-height: 1.7;
    margin: 0 0 8px 0;
    color: #333;
}

.pdf-bn-text:last-child {
    margin-bottom: 0;
}

/* 番号付きリスト（プロの打ち手） */
.pdf-bn-ordered-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.pdf-bn-ordered-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.6;
}

.pdf-bn-ordered-list li:last-child {
    margin-bottom: 0;
}

.pdf-bn-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.pdf-bn-li-content {
    flex: 1;
}

.pdf-bn-li-content strong {
    color: #2D3142;
}

/* 箇条書きリスト */
.pdf-bn-unordered-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.pdf-bn-unordered-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.6;
}

.pdf-bn-unordered-list li::before {
    content: "•";
    position: absolute;
    left: 5px;
    top: 0;
    color: #5B7C99;
    font-weight: bold;
    font-size: 14px;
}

/* サブ項目（例：など） */
.pdf-bn-subitem {
    font-size: 11px;
    color: #555;
    padding-left: 34px;
    margin: 4px 0;
    line-height: 1.5;
    position: relative;
}

.pdf-bn-subitem::before {
    content: "→";
    position: absolute;
    left: 18px;
    color: #999;
    font-size: 10px;
}

/* ===== 学習理論ページ ===== */
.pdf-theory-page {
    display: flex;
    flex-direction: column;
}

/* 学習理論ヒーローセクション */
.pdf-theory-hero {
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
}

.pdf-theory-label {
    font-size: 12px;
    color: #666;
    letter-spacing: 0.15em;
    margin-bottom: 8px;
}

.pdf-theory-main-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

/* 理論イントロテキスト */
.pdf-theory-intro {
    font-size: 13px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
}

/* 理論ヘッダー */
.pdf-theory-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-bottom: 3px solid;
}

.pdf-theory-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-theory-name {
    font-size: 16px;
    font-weight: 700;
    color: #2D3142;
    margin: 0;
    flex: 1;
}

/* 理論概要テキスト */
.pdf-theory-overview {
    font-size: 12px;
    line-height: 1.8;
    color: #333;
}

.pdf-theory-overview strong {
    color: #2D3142;
    font-weight: 600;
}

/* ===== ケーススタディ ===== */
.pdf-case-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.pdf-case-icon {
    font-size: 20px;
}

.pdf-case-title {
    font-size: 15px;
    font-weight: 700;
    color: #2D3142;
    margin: 0;
}

.pdf-case-block {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
}

.pdf-case-before {
    background: #FFF5F5;
    border-left: 4px solid #E57373;
}

.pdf-case-situation {
    background: #FAFAF8;
    border-left: 4px solid #BDBDBD;
}

.pdf-case-after {
    background: #F5FFF5;
    border-left: 4px solid;
}

.pdf-case-story {
    background: #FFF8E1;
    border-left: 4px solid #FFB74D;
}

.pdf-case-report {
    background: #E8F5E9;
    border-left: 4px solid #66BB6A;
}

.pdf-case-result {
    background: #E3F2FD;
    border-left: 4px solid;
}

.pdf-case-label {
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #555;
}

.pdf-case-content {
    font-size: 12px;
    line-height: 1.7;
    color: #333;
}

.pdf-case-content strong {
    color: #2D3142;
}

.pdf-case-quote {
    font-style: italic;
    border-left: 2px solid #BDBDBD;
    padding-left: 12px;
    margin-left: 5px;
}

/* インサイトボックス */
.pdf-case-insight {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 18px;
    border-radius: 8px;
    border-left: 4px solid;
    margin-top: 15px;
}

.pdf-insight-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.pdf-case-insight p {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    font-weight: 500;
    color: #2D3142;
}

/* ===== 実践フレームワーク ===== */
.pdf-framework-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.pdf-framework-icon {
    font-size: 24px;
}

.pdf-framework-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.pdf-framework-intro {
    font-size: 13px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 20px;
}

.pdf-framework-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pdf-framework-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #FAFAF8;
    border-radius: 8px;
}

.pdf-step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-step-content {
    flex: 1;
}

.pdf-step-name {
    font-size: 14px;
    font-weight: 700;
    color: #2D3142;
    margin: 0 0 5px 0;
}

.pdf-step-desc {
    font-size: 12px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* ===== 印刷時の調整 ===== */
@media print {
    .pdf-page {
        page-break-after: always;
        page-break-inside: avoid;
    }
    
    #pdf-loading {
        display: none !important;
    }
}
