@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700;900&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: 'Rubik', Arial, sans-serif; direction: rtl; background: #f0f2f5; }

/* ── My Card Layout ─────────────────────────────────── */
#my-card-app {
    display: grid;
    grid-template-columns: 220px 1fr 380px;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
#mc-sidebar {
    background: #dbeafe;
    color: #1a3a6e;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
}
.mc-logo {
    font-size: 16px;
    font-weight: 800;
    color: #4a90d9;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mc-nav { flex: 1; padding: 8px 0; }
.mc-nav-btn {
    color: #1a3a6e !important;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.65);
    text-align: right;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Rubik', Arial, sans-serif;
}
.mc-nav-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.mc-nav-btn.active { background: rgba(74,144,217,0.2); color: #4a90d9; border-right: 3px solid #4a90d9; }
.mc-sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mc-sidebar-footer a {
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    text-decoration: none;
    text-align: center;
}
.mc-sidebar-footer a:hover { color: #4a90d9; }
#mc-save-btn {
    width: 100%;
    padding: 10px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Rubik', Arial, sans-serif;
}
#mc-save-btn:hover { background: #357abd; }
#mc-view-btn {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
}
#mc-status {
    font-size: 12px;
    text-align: center;
    min-height: 16px;
    color: #2e7d32;
}

/* Content */
#mc-content {
    overflow-y: auto;
    padding: 28px;
    background: #f8faff;
}
.mc-section { display: none; }
.mc-section.active { display: block; }
.mc-section h2 {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8ecf5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mc-field { margin-bottom: 16px; }
.mc-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #445;
    margin-bottom: 6px;
}
.mc-field input[type=text],
.mc-field input[type=email],
.mc-field textarea,
.mc-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #dde;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Rubik', Arial, sans-serif;
    outline: none;
    transition: border-color 0.2s;
    direction: rtl;
}
.mc-field input:focus,
.mc-field textarea:focus,
.mc-field select:focus { border-color: #4a90d9; }
.mc-field input[type=color] {
    width: 60px; height: 36px;
    border: 1.5px solid #dde;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
}
.mc-field input[type=file] { font-size: 13px; }
.mc-hint { font-size: 12px; color: #8a9aaa; margin-top: 4px; }
.mc-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #334;
    cursor: pointer;
    margin-bottom: 8px;
}
.mc-btn-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eef;
}
.mc-btn-row label { min-width: 80px; font-size: 13px; font-weight: 600; }
.mc-btn-row input[type=text] {
    flex: 1; padding: 8px 10px;
    border: 1px solid #dde; border-radius: 6px;
    font-size: 13px; font-family: 'Rubik', Arial, sans-serif; direction: ltr;
}
.mc-add-btn {
    padding: 9px 18px;
    background: #4a90d9; color: #fff;
    border: none; border-radius: 8px;
    font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: 'Rubik', Arial, sans-serif;
}

/* Preview panel */
#mc-preview-panel {
    background: #e8f0fa;
    border-right: 1px solid #d0daea;
    overflow: hidden;
}

/* ── Public Card ────────────────────────────────────── */
#public-card-app {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
}
#pc-loading {
    text-align: center;
    padding: 60px;
    font-size: 16px;
    color: #8a9aaa;
}
#pc-save-contact {
    width: calc(100% - 32px);
    margin: 16px;
    padding: 13px;
    background: #4a90d9; color: #fff;
    border: none; border-radius: 10px;
    font-size: 15px; font-weight: 700;
    cursor: pointer; font-family: 'Rubik', Arial, sans-serif;
}

/* ── Leads ──────────────────────────────────────────── */
#leads-app { max-width: 800px; margin: 0 auto; padding: 24px; }
.leads-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.leads-header h1 { font-size: 24px; font-weight: 800; }
.leads-header a { color: #4a90d9; text-decoration: none; font-size: 14px; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
    #my-card-app { grid-template-columns: 1fr; grid-template-rows: 52px 1fr; height: auto; min-height: 100vh; }
    .mc-logo { display: none; }
    #mc-save-btn { font-size: 13px !important; padding: 16px 16px !important; white-space: nowrap; min-width: auto; height: auto !important; }
    #mc-preview-panel { display: block; height: 600px; border-top: 2px solid #e8ecf5; flex-shrink: 0; }
    #mc-sidebar { flex-direction: row; overflow-x: auto; height: 52px; min-height: 52px; max-height: 52px; overflow-y: hidden; flex-shrink: 0; }
    .mc-nav { display: flex; flex-direction: row; padding: 0; }
    .mc-nav-btn { padding: 12px; white-space: nowrap; border-right: none !important; border-bottom: 3px solid transparent; }
    .mc-nav-btn.active { border-bottom: 3px solid #4a90d9; }
    .mc-sidebar-footer { flex-direction: row; align-items: center; }
    .mc-sidebar-footer #mc-save-btn { display: flex; align-items: center; justify-content: center; }

}

/* ── Public Card ────────────────────────────────────── */
body.page-template-templates-public-card {
    background: #f0f4ff;
    margin: 0;
    padding: 0;
}

#public-card-app {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff;
    min-height: 100vh;
}

#pc-card {
    width: 100% !important;
    max-width: 100% !important;
}

#pc-card iframe {
    width: 100% !important;
    max-width: 100% !important;
}

#pc-card iframe {
    display: block;
    width: 100%;
    border: none;
    transition: height 0.2s ease;
}

/* Default heights — will be overridden by JS auto-resize */
#pc-header-embed   { height: 260px; }
#pc-social-embed   { height: 90px; margin-bottom: 8px; }
#pc-bio-embed      { height: 80px; margin-top: 16px; }
#pc-products-embed { height: 280px; }
#pc-qa-embed       { height: 200px; }
#pc-reviews-embed  { height: 280px; }
#pc-gallery-embed  { height: 300px; }
#pc-contact-embed  { height: 400px; }

#pc-save-contact {
    width: calc(100% - 32px);
    margin: 8px 16px 24px;
    padding: 13px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Rubik', Arial, sans-serif;
}

/* ── Public card section widths ─────────────────────── */
#pc-bio-embed,
#pc-contact-embed,
#pc-qa-embed {
    width: 60% !important;
    margin: 0 auto !important;
    display: block;
}

#pc-products-embed,
#pc-reviews-embed {
    width: 90% !important;
    margin: 0 auto !important;
    display: block;
}

#pc-gallery-embed {
    width: 85% !important;
    margin: 0 auto !important;
    display: block;
}

.mc-align-btn {
    padding: 6px 14px; border: 1.5px solid #dde; border-radius: 8px;
    background: #fff; color: #445; font-size: 13px; cursor: pointer;
    font-family: 'Rubik', Arial, sans-serif; transition: all 0.15s;
}
.mc-align-btn:hover { border-color: #4a90d9; color: #4a90d9; }
.mc-align-btn.active { background: #4a90d9; color: #fff; border-color: #4a90d9; }

/* ── Mobile widths ──────────────────────────────────── */
@media (max-width: 768px) {
    .pc-section-wrap {
        width: 95% !important;
    }
    div[style*="width:95%"] {
        width: 95% !important;
    }
}

@media (max-width: 768px) {
    .pc-section-wrap,
    .pc-section-wrap iframe {
        width: 95% !important;
        max-width: 95% !important;
    }
}

@media (max-width: 768px) {
    div.pc-section-wrap {
        width: 95% !important;
        max-width: 95% !important;
    }
    div.pc-section-wrap iframe {
        width: 100% !important;
    }
    #pc-bio-embed {
        width: 95% !important;
        margin: 0 auto !important;
    }
}

@media (max-width: 768px) {
    .pc-section-wrap {
        overflow: hidden !important;
    }
    .pc-section-wrap iframe {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
    }
}
