/* ==========================================================================
   Social media size preview modal
   Renders the selected image inside mock platform chrome. Every crop box
   uses object-fit: cover with an exact aspect-ratio, so the preview matches
   the centre-cropped file produced by the download handler.
   ========================================================================== */

.smp-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.smp-overlay.is-open {
    display: flex;
}

body.smp-lock {
    overflow: hidden;
}

.smp-dialog {
    position: relative;
    width: 100%;
    max-width: 1080px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
    animation: smp-rise 0.22s ease;
}

@keyframes smp-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Header ---------- */

.smp-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px 0;
}

.smp-head-text {
    flex: 1 1 auto;
    min-width: 0;
}

.smp-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smp-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
}

.smp-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s ease;
}

.smp-close:hover {
    background: #e2e8f0;
}

.smp-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
}

/* ---------- Platform tabs ---------- */

.smp-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 16px 24px;
    border-bottom: 1px solid #e9eef5;
}

.smp-tab {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.smp-tab:hover {
    border-color: #cbd5e1;
    color: #0f172a;
}

.smp-tab.is-active {
    background: var(--smp-accent, #2f7cf6);
    border-color: var(--smp-accent, #2f7cf6);
    color: #fff;
}

/* ---------- Preview grid ---------- */

.smp-body {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    align-items: stretch;
}

.smp-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e9eef5;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

/* Grow so every footer in a row lines up regardless of mock height. */
.smp-stage {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #f7f9fc;
    min-height: 200px;
}

.smp-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-top: 1px solid #eef2f7;
}

.smp-foot-text {
    flex: 1 1 auto;
    min-width: 0;
}

.smp-size-label {
    display: block;
    font-size: 14px;
    font-weight: 650;
    color: #0f172a;
}

.smp-size-dims {
    display: block;
    font-size: 12px;
    color: #7c8798;
    margin-top: 1px;
}

.smp-dl {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 9px;
    background: #2f7cf6;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.smp-dl:hover {
    background: #1f66db;
}

.smp-dl[disabled] {
    opacity: 0.65;
    cursor: default;
}

.smp-dl svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Shared crop box ---------- */

.smp-crop {
    position: relative;
    width: 100%;
    aspect-ratio: var(--smp-ar, 1);
    overflow: hidden;
    background: #e8edf4;
}

.smp-crop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ==========================================================================
   Mock chrome
   ========================================================================== */

.smp-mock {
    width: 100%;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.smp-mock-sheet {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}

.smp-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.smp-avatar {
    border-radius: 50%;
    overflow: hidden;
    background: #dbe2ec;
    flex: 0 0 auto;
}

.smp-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.smp-bar {
    background: #e4e9f1;
    border-radius: 999px;
    height: 8px;
}

.smp-bar.sm { height: 6px; }

/* ---------- Facebook cover ---------- */

.smp-fbcover .smp-cover-wrap {
    position: relative;
}

.smp-fbcover .smp-crop {
    border-radius: 12px 12px 0 0;
}

.smp-fbcover .smp-cover-avatar {
    position: absolute;
    left: 18px;
    bottom: -26px;
    width: 76px;
    height: 76px;
    border: 4px solid #fff;
    border-radius: 50%;
    overflow: hidden;
    background: #dbe2ec;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.smp-fbcover .smp-cover-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.smp-fbcover .smp-cover-info {
    padding: 34px 18px 16px;
}

.smp-fbcover .smp-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.smp-fbcover .smp-meta {
    font-size: 12px;
    color: #7c8798;
    margin-top: 3px;
}

.smp-fbcover .smp-btn-row {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.smp-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 7px;
    background: #eef2f7;
    color: #334155;
}

.smp-pill.primary {
    background: #1877f2;
    color: #fff;
}

/* ---------- Feed post (Facebook / Twitter) ---------- */

.smp-feed .smp-feed-head {
    padding: 12px 13px;
}

.smp-feed .smp-avatar {
    width: 38px;
    height: 38px;
}

.smp-feed .smp-name {
    font-size: 13.5px;
    font-weight: 650;
    color: #0f172a;
}

.smp-feed .smp-meta {
    font-size: 11.5px;
    color: #8b95a5;
    margin-top: 2px;
}

.smp-feed .smp-feed-text {
    padding: 0 13px 11px;
    font-size: 13px;
    color: #253449;
    line-height: 1.45;
}

.smp-feed .smp-feed-actions {
    display: flex;
    justify-content: space-around;
    padding: 9px 13px;
    border-top: 1px solid #eef2f7;
}

.smp-feed .smp-feed-actions span {
    font-size: 11.5px;
    font-weight: 600;
    color: #7c8798;
}

.smp-feed.smp-tw .smp-crop {
    border-radius: 14px;
    margin: 0 13px 11px;
    width: calc(100% - 26px);
}

/* ---------- Instagram post ---------- */

.smp-ig .smp-ig-head {
    padding: 10px 12px;
}

.smp-ig .smp-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
    flex: 0 0 auto;
}

.smp-ig .smp-ring .smp-avatar {
    width: 100%;
    height: 100%;
    border: 2px solid #fff;
}

.smp-ig .smp-name {
    font-size: 13px;
    font-weight: 650;
    color: #0f172a;
}

.smp-ig .smp-dots {
    margin-left: auto;
    letter-spacing: 2px;
    color: #64748b;
    font-size: 15px;
    line-height: 1;
}

.smp-ig .smp-ig-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 12px 6px;
}

.smp-ig .smp-ig-actions svg {
    width: 21px;
    height: 21px;
    stroke: #0f172a;
    stroke-width: 1.8;
    fill: none;
}

.smp-ig .smp-ig-actions .smp-spacer {
    margin-left: auto;
}

.smp-ig .smp-ig-likes {
    padding: 0 12px 12px;
    font-size: 12.5px;
    font-weight: 650;
    color: #0f172a;
}

/* ---------- Story / Reel phone frame ---------- */

.smp-story {
    width: 248px;
    max-width: 100%;
    padding: 9px;
    background: #14181f;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.3);
}

.smp-story-screen {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: #000;
}

.smp-story-screen .smp-crop {
    border-radius: 0;
    background: #000;
}

.smp-story-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px 11px 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent);
}

.smp-story-progress {
    display: flex;
    gap: 4px;
}

.smp-story-progress i {
    flex: 1 1 auto;
    height: 2.5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
}

.smp-story-progress i:first-child {
    background: #fff;
}

.smp-story-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 11px;
}

.smp-story-user .smp-avatar {
    width: 27px;
    height: 27px;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
}

.smp-story-user b {
    font-size: 11.5px;
    color: #fff;
    font-weight: 600;
}

.smp-story-user span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.smp-story-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 11px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
}

.smp-story-reply {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.85);
}

/* ---------- Avatar / profile picture ---------- */

.smp-avatarmock {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
}

.smp-avatarmock .smp-avatar-big {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
    flex: 0 0 auto;
}

.smp-avatarmock .smp-avatar-big .smp-crop {
    border-radius: 50%;
}

.smp-avatarmock .smp-avatar-small {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
}

.smp-avatarmock .smp-avatar-small .smp-crop {
    border-radius: 50%;
}

.smp-avatarmock .smp-avatar-text {
    min-width: 0;
}

.smp-avatarmock .smp-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.smp-avatarmock .smp-meta {
    font-size: 12px;
    color: #7c8798;
    margin-top: 3px;
}

/* ---------- Twitter header ---------- */

.smp-twheader .smp-crop {
    border-radius: 12px 12px 0 0;
}

.smp-twheader .smp-header-wrap {
    position: relative;
}

.smp-twheader .smp-header-avatar {
    position: absolute;
    left: 16px;
    bottom: -30px;
    width: 68px;
    height: 68px;
    border: 4px solid #fff;
    border-radius: 50%;
    overflow: hidden;
    background: #dbe2ec;
}

.smp-twheader .smp-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.smp-twheader .smp-header-info {
    padding: 14px 16px 16px;
    display: flex;
    align-items: flex-start;
}

.smp-twheader .smp-header-text {
    margin-top: 24px;
}

.smp-twheader .smp-name {
    font-size: 15px;
    font-weight: 750;
    color: #0f172a;
}

.smp-twheader .smp-meta {
    font-size: 12.5px;
    color: #7c8798;
    margin-top: 2px;
}

.smp-twheader .smp-follow {
    margin-left: auto;
    background: #0f172a;
    color: #fff;
    font-size: 12.5px;
    font-weight: 650;
    padding: 7px 16px;
    border-radius: 999px;
}

/* ---------- Pinterest pin ---------- */

.smp-pin {
    width: 216px;
    max-width: 100%;
}

.smp-pin-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
}

.smp-pin-save {
    position: absolute;
    top: 9px;
    right: 9px;
    background: #e60023;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 999px;
}

.smp-pin-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 2px 0;
}

.smp-pin-info .smp-avatar {
    width: 26px;
    height: 26px;
}

.smp-pin-info b {
    font-size: 12px;
    font-weight: 650;
    color: #0f172a;
}

/* ---------- States ---------- */

.smp-empty {
    grid-column: 1 / -1;
    padding: 40px 0;
    text-align: center;
    color: #7c8798;
    font-size: 14px;
}

.smp-note {
    grid-column: 1 / -1;
    display: flex;
    gap: 9px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f1f6ff;
    border: 1px solid #d8e6ff;
    color: #2c4d80;
    font-size: 12.5px;
    line-height: 1.5;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
    .smp-overlay {
        padding: 0;
    }

    .smp-dialog {
        border-radius: 0;
        min-height: 100%;
    }

    .smp-body {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 18px;
    }

    .smp-head,
    .smp-tabs {
        padding-left: 16px;
        padding-right: 16px;
    }
}
