/* ===========================================
   AI SCHEMA WIZARD v11 — BASE STYLES
   Design overrides are injected inline per post
   via ai_wizard_get_design_css() in PHP.
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;700&display=swap');

/* ── ADMIN SETTINGS PAGE ─────────────────── */
.ai-sw-settings { max-width: 1200px; margin: 20px auto; padding: 20px; background: #fff; box-shadow: 0 0 10px rgba(0,0,0,.1); }
.ai-sw-settings-container { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px; }
.ai-sw-section { flex: 1 1 400px; min-width: 300px; padding: 20px; background: #f9f9f9; border: 1px solid #ddd; border-radius: 5px; }

/* ── RECIPE CARD BASE ────────────────────── */
.ai-sw-recipe-card {
    max-width: 800px;
    margin: 40px auto;
    background: #fffefa;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    overflow: hidden;
    font-family: 'Lora', serif;
}

/* ── HEADER ──────────────────────────────── */
.ai-sw-recipe-card .ai-sw-recipe-card-header {
    padding: 20px;
    background: linear-gradient(135deg, #DA003A 0%, #feb47b 100%);
    color: #fff;
    border-bottom: 1px solid #fde8d7;
    text-align: center;
}
.ai-sw-recipe-card .ai-sw-recipe-title {
    margin: 0;
    font-size: 2.2em;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,.2);
    line-height: 1.2;
}

/* ── IMAGE ───────────────────────────────── */
.ai-sw-recipe-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 650px;
    object-fit: cover;
    border-radius: 0;
}

/* ── META STRIP ──────────────────────────── */
.ai-sw-recipe-card .ai-sw-recipe-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid #eee;
}
.ai-sw-meta-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 14px 28px;
    border-right: 1px solid #eee;
    flex: 1 1 auto;
    min-width: 100px;
}
.ai-sw-meta-item:last-child { border-right: none; }
.ai-sw-meta-label { font-weight: 700; color: #999; font-size: .72em; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.ai-sw-meta-label i { display: inline-flex; align-items: center; color: #DA003A; }
.ai-sw-meta-value { color: #111; font-size: 1.05em; font-weight: 700; white-space: nowrap; }

/* ── BUTTONS ROW ─────────────────────────── */
.ai-sw-recipe-buttons-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}
.ai-sw-recipe-print-btn,
.ai-sw-recipe-pin-btn {
    background: #DA003A;
    color: #fff;
    padding: 17px 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
    transition: background .3s ease, transform .2s ease, box-shadow .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 200px;
    flex: 1 1 200px;
    max-width: 280px;
    text-decoration: none;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(218,0,58,.3);
    letter-spacing: .03em;
}
.ai-sw-recipe-print-btn:hover,
.ai-sw-recipe-pin-btn:hover { background: #ff6a4f; transform: translateY(-2px); color: #fff; }
.ai-sw-recipe-print-btn svg,
.ai-sw-recipe-pin-btn svg { pointer-events: none; }

/* ── DESCRIPTION ─────────────────────────── */
.ai-sw-recipe-description { padding: 20px; background: #fff; border-bottom: 1px solid #eee; }
.ai-sw-recipe-description h3 { color: #DA003A; font-size: 1.4em; margin-top: 0; margin-bottom: 10px; }

/* ── CONTENT GRID ────────────────────────── */
.ai-sw-recipe-card-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 25px 20px;
    background: #fff;
}
.ai-sw-recipe-ingredients { margin-bottom: 24px; }
.ai-sw-recipe-card h3 { color: #DA003A; font-size: 1.4em; margin-top: 0; margin-bottom: 15px; padding-bottom: 5px; border-bottom: 2px solid #fde8d7; }

/* ── INGREDIENTS ─────────────────────────── */
.ai-sw-recipe-ingredients ul { list-style: none; padding: 0; margin: 0; }
.ai-sw-recipe-ingredients ul li { position: relative; padding: 8px 0 8px 8px; border-bottom: 1px dashed #eee; color: #444; line-height: 1.6; cursor: pointer; user-select: none; min-height: 44px; display: flex; align-items: center; gap: 10px; transition: opacity .2s; }
.ai-sw-recipe-ingredients ul li::before { display: none; }

/* Square checkbox indicator */
.ai-sw-ing-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid #DA003A;
    border-radius: 3px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
}
.ai-sw-ingredient-done .ai-sw-ing-check {
    background: #DA003A;
    border-color: #DA003A;
}
.ai-sw-ingredient-done .ai-sw-ing-check::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

/* Ingredient body — qty and name inline, qty fixed-width so text aligns */
.ai-sw-ing-body { display: flex; align-items: baseline; gap: 5px; flex: 1; min-width: 0; }
.ai-sw-qty { flex-shrink: 0; min-width: 3ch; font-weight: 600; color: #333; }
.ai-sw-ing-name { flex: 1; }

/* ── INGREDIENT STRIKETHROUGH ───────────── */
.ai-sw-ingredient-done .ai-sw-ing-body { text-decoration: line-through; opacity: .5; }
.ai-sw-ingredient-done { opacity: .65; }

/* ── INSTRUCTIONS ────────────────────────── */
.ai-sw-recipe-instructions ol { list-style: none; padding-left: 0; margin: 0; counter-reset: step-counter; }
.ai-sw-recipe-instructions ol li { position: relative; padding: 12px 0 12px 40px; border-bottom: 1px dashed #eee; color: #444; line-height: 1.7; counter-increment: step-counter; }
.ai-sw-recipe-instructions ol li::before { content: counter(step-counter); position: absolute; left: 0; top: 12px; width: 24px; height: 24px; background: #DA003A; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85em; font-weight: 600; line-height: 1; }

/* ── NUTRITION ───────────────────────────── */
.ai-sw-recipe-nutrition {
    padding: 20px;
    background: #fcfcfc;
    border-radius: 5px;
    margin-top: 20px;
    grid-column: 1 / -1;
    border: 1px solid #eee;
}
.ai-sw-nutrition-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid #e5e5e5; border-radius: 6px; overflow: hidden; width: 100%; box-sizing: border-box; }
.ai-sw-nutrition-list li { color: #444; font-size: .9em; border-bottom: 1px solid #ebebeb; padding: 9px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; }
.ai-sw-nutrition-list li:nth-child(odd) { border-right: 2px solid #d8d8d8; }
.ai-sw-nutrition-list li:nth-last-child(-n+2) { border-bottom: none; }
.ai-sw-nutrition-list li strong { color: #666; font-weight: 500; white-space: nowrap; }
.ai-sw-nutrition-list li span { font-weight: 700; color: #111; white-space: nowrap; margin-left: auto; }

/* ── JUMP BUTTON ─────────────────────────── */
.jump-box { text-align: center; margin: 30px auto; }
.btn-jump {
    display: inline-block;
    padding: 15px 35px;
    background: #DA003A;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
    transition: .2s;
}
.btn-jump:hover { background: #ff6a4f; transform: translateY(-2px); color: #fff; }

/* ── RATING SECTION ──────────────────────── */
.ai-sw-recipe-card-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 24px 20px;
    border-bottom: 1px solid #eee;
    background: #fffdf5;
}
.ai-sw-stars-row { display: flex; align-items: center; gap: 8px; }
.ai-sw-rating-summary { display: flex; align-items: baseline; gap: 5px; font-size: 1em; }
.ai-sw-rating-avg { font-weight: 800; color: #c9a000; font-size: 1.4em; line-height: 1; }
.ai-sw-rating-sep { color: #888; font-size: .9em; }
.ai-sw-rating-votes { color: #aaa; font-size: .88em; }
.ai-sw-rating-cta {
    color: #b8860b;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: .01em;
    animation: ai-sw-pulse 2s ease-in-out infinite;
}
.ai-sw-rating-msg { font-size: .88em; min-height: 1.2em; }
@keyframes ai-sw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}
.ai-sw-stars { display: flex; gap: 4px; }
.ai-sw-star { font-size: 42px !important; color: #e0e0e0; cursor: pointer; transition: color .12s, transform .12s; line-height: 1; user-select: none; display: inline-block; }
.ai-sw-star.filled { color: #F5A623 !important; text-shadow: 0 1px 4px rgba(245,166,35,.35); }
.ai-sw-star:hover { color: #F5A623 !important; transform: scale(1.25); text-shadow: 0 2px 8px rgba(245,166,35,.5); }
.ai-sw-rating-info { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.ai-sw-rating-msg { font-size: 12px; margin-top: 2px; }

/* ── SERVING ADJUSTER ────────────────────── */
.ai-sw-serving-adjuster { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ai-sw-serving-controls { display: flex; align-items: center; gap: 8px; }
.ai-sw-serving-btn {
    background: #DA003A;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .1s;
    line-height: 1;
    padding: 0;
}
.ai-sw-serving-btn:hover { background: #ff4066; transform: scale(1.1); }
#ai-sw-serving-count { font-size: 20px; font-weight: 700; color: #DA003A; min-width: 28px; text-align: center; }

/* ── TIMER BUTTON ────────────────────────── */
.ai-sw-timer-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #DA003A;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
    transition: background .2s;
}
.ai-sw-timer-btn:hover { background: #b80031; }

/* ── SPLIT PANEL LAYOUT ──────────────────── */
.ai-sw-split-layout {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    align-items: flex-start;
}
.ai-sw-split-left {
    position: sticky;
    top: 80px;
}
.ai-sw-split-right {
    padding: 36px 36px 36px 40px;
    border-left: 1px solid #f0f0f0;
}
@media (max-width: 700px) {
    .ai-sw-split-layout { grid-template-columns: 1fr; }
    .ai-sw-split-left { position: static; }
    .ai-sw-split-right { padding: 20px; border-left: none; border-top: 1px solid #f0f0f0; }
}

/* ── SPLIT COLS (v11 Split Panel design) ─── */
.ai-sw-split-cols {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0;
    background: #fff;
}
.ai-sw-split-col { padding: 28px 32px; }
.ai-sw-split-col:first-child { border-right: 1px solid #f0f0f0; }
@media (max-width: 700px) {
    .ai-sw-split-cols { grid-template-columns: 1fr; }
    .ai-sw-split-col { padding: 20px; border-right: none !important; }
}

/* ── STACKED COLS (v11 Stacked design) ───── */
.ai-sw-stacked-cols {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 0;
    background: #fff;
}
.ai-sw-stacked-col { padding: 28px 36px; }
.ai-sw-stacked-col:first-child { border-right: 1px solid #EDE8E0; background: #FDFCFA; }
@media (max-width: 700px) {
    .ai-sw-stacked-cols { grid-template-columns: 1fr; }
    .ai-sw-stacked-col { padding: 20px; border-right: none !important; }
}

/* ── NORDIC IMAGE FRAME ───────────────────── */
.ai-sw-recipe-image-frame { padding: 16px 16px 0; }

/* ── MOBILE META STRIP ────────────────────── */
@media (max-width: 600px) {
    .ai-sw-recipe-card .ai-sw-recipe-card-meta {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
    }
    .ai-sw-meta-item {
        border-right: 1px solid #eee !important;
        border-bottom: 1px solid #eee !important;
        padding: 12px 16px !important;
        align-items: center !important;
        text-align: center;
        min-width: 0 !important;
    }
    .ai-sw-meta-item:nth-child(even) { border-right: none !important; }
    .ai-sw-nutrition-list { grid-template-columns: 1fr !important; }
    .ai-sw-nutrition-list li:nth-child(odd) { border-right: none !important; }
    .ai-sw-nutrition-list li { padding: 8px 12px !important; }
    .ai-sw-recipe-nutrition { padding: 12px 16px !important; }
}

/* ── KEYWORDS SECTION (bottom of card) ───── */
.ai-sw-keywords-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.ai-sw-keywords-label {
    font-size: .72em;
    color: #aaa;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .06em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── FAQ SECTION ─────────────────────────── */
.ai-sw-faq-section { padding: 20px; margin-top: 20px; }
.ai-sw-faq-q { font-weight: 700; margin: 0 0 4px; }
.ai-sw-faq-a { margin: 0; font-size: .93em; line-height: 1.65; }

/* ── RECIPE INFO STRIP ────────────────────── */
.ai-sw-recipe-info-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}
.ai-sw-info-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    border-right: 1px solid #e8e8e8;
    flex: 1 1 auto;
}
.ai-sw-info-item:last-of-type { border-right: none; }
.ai-sw-info-icon { font-size: 1.4em; flex-shrink: 0; line-height: 1; opacity: .7; }
.ai-sw-info-text { display: flex; flex-direction: column; gap: 2px; }
.ai-sw-info-label { color: #aaa; font-size: .72em; text-transform: uppercase; font-weight: 700; letter-spacing: .06em; white-space: nowrap; line-height: 1.2; }
.ai-sw-info-value { color: #111; font-weight: 700; font-size: 1em; white-space: nowrap; line-height: 1.3; }
.ai-sw-info-keywords {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 28px 16px;
    border-top: 1px solid #e8e8e8;
}
.ai-sw-info-keywords .ai-sw-info-label { font-size: .72em; color: #aaa; text-transform: uppercase; font-weight: 700; letter-spacing: .06em; white-space: nowrap; flex-shrink: 0; }
.ai-sw-keywords-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-sw-keyword-tag {
    background: #fff;
    color: #444;
    border-radius: 20px;
    padding: 4px 13px;
    font-size: .82em;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid #ddd;
    line-height: 1.5;
}
@media (max-width: 600px) {
    .ai-sw-recipe-info-strip { padding: 0; }
    .ai-sw-info-item { flex: 1 1 40%; padding: 12px 16px; border-bottom: 1px solid #eee; }
    .ai-sw-info-keywords { padding: 12px 16px; justify-content: center; }
    .ai-sw-keywords-wrap { justify-content: center; }
}

/* ── PRINT ───────────────────────────────── */
@media print {
    body * { visibility: hidden; }
    .ai-sw-recipe-card, .ai-sw-recipe-card * { visibility: visible; }
    .ai-sw-recipe-card { position: absolute; left: 0; top: 0; width: 100%; margin: 0; border: none; box-shadow: none; }
    .ai-sw-recipe-buttons-section,
    .ai-sw-recipe-card-rating,
    .ai-sw-serving-adjuster,
    .ai-sw-timer-btn,
    .jump-box,
    .btn-jump { display: none !important; }
    .ai-sw-ingredient-done { text-decoration: none !important; opacity: 1 !important; }
}
