/**
 * assets/css/birthday-design-print.css
 * バースデープラン専用 デザインプリント スタイルシート
 */

/* =========================================================
   全体ラッパー & コンテナ
========================================================= */
.smps2-birthday-wrapper {
    background: #ffffff;
    border: 2px solid #fed7aa;
    border-radius: 16px;
    padding: 24px;
    margin: 25px 0;
    box-shadow: 0 4px 20px rgba(255, 153, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.smps2-birthday-inner {
    max-width: 100%;
}

/* ヘッダー */
.smps2-birthday-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ffedd5;
}

.smps2-birthday-title {
    font-size: 20px;
    font-weight: 700;
    color: #9a3412;
    margin: 0 0 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.smps2-birthday-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* 2カラムレイアウト */
.smps2-birthday-flex-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.smps2-birthday-preview-col {
    flex: 1 1 48% !important;
    max-width: 540px !important;
    min-width: 320px !important;
    position: sticky;
    top: 20px;
}

.smps2-birthday-controls-col {
    flex: 1 1 50% !important;
    min-width: 300px !important;
}

/* =========================================================
   リアルタイムプレビュー領域
========================================================= */
/* プレビュー親ラッパー：横幅を十分に確保 */
.smps2-birthday-preview-wrapper {
    width: 100% !important;
    max-width: 520px !important; /* 横長台紙が収まる十分な幅 */
    margin: 0 auto 20px auto !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* プレビューコンテナの共通設定 */
.smps2-birthday-preview-container,
#smps2-birthday-canvas {
    position: relative !important;
    display: block !important;
    background-color: #ffffff !important;
    border: 1px solid #dcdcdc !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    transition: all 0.3s ease;
    user-select: none;
}

/* Type A / Type C：縦型台紙（縦長） */
.smps2-birthday-preview-container[data-smps2-layout="bd_type_a"],
#smps2-birthday-canvas[data-smps2-layout="bd_type_a"],
.smps2-birthday-preview-container[data-smps2-layout="bd_type_c"],
#smps2-birthday-canvas[data-smps2-layout="bd_type_c"],
.smps2-birthday-preview-container.smps2-layout-bd_type_a,
.smps2-birthday-preview-container.smps2-layout-bd_type_c {
    width: 100% !important;
    max-width: 350px !important;
    height: 460px !important;
    aspect-ratio: 1 / 1.32 !important;
    min-height: unset !important;
}

/* Type B 台紙コンテナ（横1.25 : 縦1） */
.smps2-birthday-preview-container[data-smps2-layout="bd_type_b"],
#smps2-birthday-canvas[data-smps2-layout="bd_type_b"],
.smps2-birthday-preview-container.smps2-layout-bd_type_b {
    width: 100% !important;
    max-width: 450px !important;
    height: 360px !important;
    aspect-ratio: 450 / 360 !important; /* 1.25 : 1 */
    min-height: unset !important;
    background-color: #ffffff !important;
    border: 1px solid #dcdcdc !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    position: relative !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
}

/* 写真スロット枠（①〜④） */
.smps2-birthday-photo-hole {
    position: absolute !important;
    border: 2px dashed #ff9800 !important;
    background-color: rgba(255, 152, 0, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    border-radius: 4px;
    cursor: pointer;
    z-index: 2;
    overflow: hidden;
    transition: all 0.2s ease;
}

.smps2-birthday-photo-hole:hover {
    border-color: #f97316 !important;
    background-color: rgba(255, 152, 0, 0.16) !important;
}

/* 各コマの画像フィット */
.smps2-birthday-photo-hole img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

/* ①〜④の番号バッジ */
.smps2-birthday-hole-badge {
    font-size: 16px !important;
    font-weight: bold !important;
    color: #ff9800 !important;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.05em;
    pointer-events: none;
}

/* 台紙上の写真枠操作ボタン (回転・解除) */
.smps2-birthday-hole-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.smps2-birthday-photo-hole:hover .smps2-birthday-hole-actions,
.smps2-birthday-photo-hole.active-hole .smps2-birthday-hole-actions {
    opacity: 1;
}

.smps2-birthday-hole-btn {
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.smps2-birthday-hole-btn:hover {
    background: #ff9900;
}

.smps2-birthday-hole-btn-clear:hover {
    background: #ef4444;
}

/* 文字レイヤー */
.smps2-birthday-text-layer {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
    color: #334155;
    font-weight: 600;
    user-select: none;
    pointer-events: none;
    z-index: 5;
    padding: 4px;
    box-sizing: border-box;
}

/* =========================================================
   フォーム コントロール
========================================================= */
.smps2-birthday-controls-col .smps2-form-group {
    margin-bottom: 22px;
}

.smps2-birthday-label {
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

.smps2-birthday-label .step-num {
    background: #ff9900;
    color: #ffffff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
    flex-shrink: 0;
}

.smps2-badge-optional {
    margin-left: 8px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: normal;
}

/* レイアウト選択ラジオカード */
.smps2-birthday-layout-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.smps2-birthday-radio-card {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.smps2-birthday-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.smps2-radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.smps2-radio-content strong {
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 4px;
}

.smps2-radio-content small {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
}

.smps2-birthday-radio-card:hover .smps2-radio-content {
    border-color: #fdba74;
    background: #fffaf5;
}

.smps2-birthday-radio-card.active .smps2-radio-content,
.smps2-birthday-radio-card.is-selected .smps2-radio-content,
.smps2-birthday-radio-card input[type="radio"]:checked + .smps2-radio-content {
    border-color: #ff9900;
    background: #fff7ed;
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.2);
}

.smps2-birthday-radio-card.active .smps2-radio-content strong,
.smps2-birthday-radio-card.is-selected .smps2-radio-content strong,
.smps2-birthday-radio-card input[type="radio"]:checked + .smps2-radio-content strong {
    color: #ea580c;
}

.smps2-birthday-radio-card.active .smps2-radio-content svg,
.smps2-birthday-radio-card.is-selected .smps2-radio-content svg,
.smps2-birthday-radio-card input[type="radio"]:checked + .smps2-radio-content svg {
    border-color: #ff9900 !important;
    background: #fffaf0 !important;
}

/* テキストエリア */
.smps2-birthday-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #1e293b;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    resize: vertical;
}

.smps2-birthday-textarea:focus {
    outline: none;
    border-color: #ff9900;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.15);
}

.smps2-form-tip {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
}

/* 写真スロット割り当てグリッド */
.smps2-birthday-slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.smps2-birthday-slot-item {
    position: relative;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.smps2-birthday-slot-item:hover {
    border-color: #ff9900;
    background: #fffaf5;
}

.smps2-birthday-slot-item.active-slot {
    border-color: #ff9900;
    border-style: solid;
    background: #fff7ed;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.2);
}

.smps2-birthday-slot-item.drag-over,
.smps2-frame-hole.drag-over,
.smps2-birthday-frame-hole.drag-over {
    border-color: #ea580c !important;
    background: #ffedd5 !important;
    transform: scale(1.02);
}

.smps2-birthday-slot-item.has-photo {
    background: #ffffff;
    border-style: solid;
    border-color: #e2e8f0;
}

.smps2-birthday-slot-thumb {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.smps2-birthday-slot-thumb img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.smps2-birthday-slot-thumb .slot-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #334155;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    z-index: 2;
}

.smps2-birthday-slot-thumb .slot-empty-text {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* スロット操作ボタン (クリア・回転) */
.smps2-birthday-slot-controls {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}

.smps2-birthday-btn-ctrl {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 11px;
    padding: 3px 6px;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s ease;
}

.smps2-birthday-btn-ctrl:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.smps2-birthday-btn-clear:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.smps2-birthday-btn-rotate:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0284c7;
}

/* プレビュー穴枠のDnDハイライト */
.smps2-birthday-photo-hole.drag-over {
    border-color: #ea580c !important;
    background: rgba(255, 153, 0, 0.2) !important;
    transform: scale(1.02);
}

.smps2-birthday-photo-hole.active-hole {
    border-color: #ff9900 !important;
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.4);
}

/* =========================================================
   レスポンシブ（タブレット・モバイル）
========================================================= */
@media (max-width: 860px) {
    .smps2-birthday-flex-layout {
        flex-direction: column;
        gap: 20px;
    }

    .smps2-birthday-preview-col {
        flex: 1 1 100%;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        position: static;
    }

    .smps2-birthday-controls-col {
        flex: 1 1 100%;
        width: 100%;
    }

    .smps2-birthday-layout-selector {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .smps2-birthday-radio-card .smps2-radio-content {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 14px;
        text-align: left;
    }

    .smps2-birthday-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
