/**
 * 宿曜鑑定シート スタイルシート（A4版）
 * A4サイズ対応 (210mm × 297mm)
 * PDF生成用に最適化
 */

/* リセット & 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", "ヒラギノ角ゴ Pro W3", sans-serif;
    background: linear-gradient(135deg, #f0fff7 0%, #fffdf0 100%);
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

h1 {
    color: #d3d01d;
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.2em;
}

/* フォームセクション */
.form-section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
    font-size: 1.2em;
}

.date-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.date-inputs select {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1em;
    background: white;
    transition: all 0.3s;
    min-width: 100px;
}

.date-inputs select:focus {
    outline: none;
    border-color: #0bed84;
    box-shadow: 0 0 0 3px rgba(11,237,132,0.1);
}

.date-inputs span {
    font-weight: 600;
    color: #666;
}

.submit-btn {
    background: linear-gradient(135deg, #d3d01d 0%, #0bed84 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(211,208,29,0.3);
    display: block;
    margin: 0 auto;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11,237,132,0.4);
}

/* エラーメッセージ */
.error-message {
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* アクションボタン */
.result-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.print-btn, .pdf-btn, .back-btn, .wordpress-link {
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.print-btn {
    background: #0bed84;
    color: white;
}

.pdf-btn {
    background: linear-gradient(135deg, #d3d01d 0%, #0bed84 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(211,208,29,0.3);
}

.print-btn:hover, .pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11,237,132,0.4);
}

.back-btn {
    background: #6c757d;
    color: white;
}

.back-btn:hover {
    background: #5a6268;
}

.wordpress-link {
    background: #d3d01d;
    color: white;
}

.wordpress-link:hover {
    background: #b8b51a;
}

/* PDF生成説明 */
.pdf-instruction {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 10000;
    display: none;
    max-width: 500px;
    width: 90%;
}

.pdf-instruction.show {
    display: block;
}

.pdf-instruction h3 {
    color: #d3d01d;
    margin-bottom: 20px;
}

.pdf-instruction ol {
    text-align: left;
    margin: 20px 0;
}

.pdf-instruction li {
    margin: 10px 0;
}

.pdf-close-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 20px;
}

/* 鑑定シート本体 */
.sheet-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    position: relative;
}

/* シートヘッダー */
.sheet-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #d3d01d;
}

.sheet-title {
    color: #d3d01d;
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.date-info {
    font-size: 1.1em;
    color: #666;
    font-weight: 500;
}

/* 基本情報表示 */
.basic-info {
    background: linear-gradient(135deg, rgba(211,208,29,0.1) 0%, rgba(11,237,132,0.1) 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
}

.shuku-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.shuku-name, .you-name {
    font-size: 2.5em;
    font-weight: 700;
    color: #d3d01d;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.you-name {
    color: #0bed84;
}

.special-day, .ryouhitsu {
    margin: 8px 0;
    font-size: 1.1em;
}

.special-day .label, .ryouhitsu .label {
    font-weight: 600;
    color: #555;
}

.special-day .value {
    color: #d32f2f;
    font-weight: 700;
}

.ryouhitsu .value {
    color: #ff6b35;
    font-weight: 700;
}

/* ママタイプセクション */
.mama-type-section {
    text-align: center;
    margin-bottom: 25px;
}

.section-title {
    color: #0bed84;
    font-size: 1.6em;
    margin-bottom: 12px;
    font-weight: 700;
}

.mama-type {
    font-size: 1.8em;
    color: #d3d01d;
    font-weight: 700;
    padding: 12px;
    background: linear-gradient(135deg, rgba(211,208,29,0.05) 0%, rgba(11,237,132,0.05) 100%);
    border-radius: 12px;
    border: 2px solid #d3d01d;
}

/* 詳細グリッド */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.detail-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #0bed84;
    page-break-inside: avoid;
}

.detail-card.full-width {
    grid-column: span 1;
}

.card-title {
    color: #0bed84;
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f0fe;
}

.card-content {
    color: #444;
    line-height: 1.7;
    font-size: 0.95em;
    white-space: pre-wrap;
    text-align: left;
}

/* フッター */
.sheet-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    color: #999;
}

.website {
    color: #0bed84;
    font-weight: 600;
    margin-top: 5px;
}

/* 印刷用スタイル（A4サイズ対応） */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }
    
    body {
        background: white !important;
        font-size: 10pt;
    }
    
    .container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    /* 不要な要素を非表示 */
    header,
    .form-section,
    .result-actions,
    .error-message,
    .back-btn,
    .confirm-section,
    .privacy-notice,
    .button-group,
    .wordpress-link,
    .pdf-instruction,
    .pdf-btn,
    .print-btn {
        display: none !important;
    }
    
    /* シートコンテナ */
    .sheet-container {
        width: 190mm; /* A4幅 - マージン */
        padding: 10mm;
        box-shadow: none !important;
        border: none !important;
        page-break-after: auto;
        margin: 0;
    }
    
    /* ヘッダー */
    .sheet-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
        page-break-after: avoid;
    }
    
    .sheet-title {
        font-size: 18pt;
        margin-bottom: 5px;
        color: #d3d01d !important;
    }
    
    .date-info {
        font-size: 10pt;
        color: #666 !important;
    }
    
    /* 基本情報 */
    .basic-info {
        padding: 10mm;
        margin-bottom: 12mm;
        background: rgba(211,208,29,0.05) !important;
        border: 1pt solid #d3d01d;
        page-break-after: avoid;
    }
    
    .shuku-name, .you-name {
        font-size: 20pt;
        color: #d3d01d !important;
    }
    
    .you-name {
        color: #0bed84 !important;
    }
    
    .special-day, .ryouhitsu {
        font-size: 9pt;
    }
    
    /* ママタイプ */
    .mama-type-section {
        margin-bottom: 12mm;
        page-break-after: avoid;
    }
    
    .section-title {
        font-size: 12pt;
        margin-bottom: 5mm;
        color: #0bed84 !important;
    }
    
    .mama-type {
        font-size: 14pt;
        padding: 8mm;
        border: 1.5pt solid #d3d01d;
        color: #d3d01d !important;
    }
    
    /* 詳細カード */
    .detail-grid {
        display: block;
        margin: 0;
        padding: 0;
    }
    
    .detail-card {
        width: 100%;
        margin-bottom: 10mm;
        padding: 8mm;
        background: #f8f9fa !important;
        border-left: 3pt solid #0bed84;
        page-break-inside: avoid;
    }
    
    /* 3つ目のカードの後で改ページ */
    .detail-card:nth-child(3) {
        page-break-after: always;
    }
    
    .card-title {
        font-size: 11pt;
        margin-bottom: 5mm;
        padding-bottom: 2mm;
        border-bottom: 1pt solid #e8f0fe;
        color: #0bed84 !important;
    }
    
    .card-content {
        font-size: 9pt;
        line-height: 1.5;
        text-align: left !important;
        color: #333 !important;
    }
    
    /* フッター */
    .sheet-footer {
        margin-top: 10mm;
        padding-top: 5mm;
        border-top: 1pt solid #e0e0e0;
        page-break-inside: avoid;
        font-size: 8pt;
    }
    
    .website {
        color: #0bed84 !important;
    }
    
    /* カラー印刷を有効化 */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
}

/* モバイル対応 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .date-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-inputs select {
        width: 100%;
    }
    
    .sheet-container {
        padding: 20px;
    }
    
    .sheet-title {
        font-size: 1.8em;
    }
    
    .shuku-name, .you-name {
        font-size: 2em;
    }
    
    .mama-type {
        font-size: 1.3em;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .print-btn, .pdf-btn, .back-btn, .wordpress-link {
        width: 100%;
        text-align: center;
    }
}