/* ============================================================
   Urun Detay Sosyal Medya Sablonu & Paylasim Merkezi Modal
   - Harici modul: inline style veya gomulu <style> kullanilmaz.
   - GPU dostu gecisler (opacity + transform).
   ============================================================ */

body.ps-modal-open {
    overflow: hidden;
}

.ps-is-hidden {
    display: none !important;
}

.ps-sr-copy-ta {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Modal Arka Plan Overlay */
.ps-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 17, 40, 0.64);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.22s;
}

.ps-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0s;
}

/* Modal Kart Konteyneri */
.ps-modal {
    position: relative;
    width: 100%;
    max-width: 1020px;
    max-height: 92vh;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(13, 27, 62, 0.14);
    border-radius: 20px;
    box-shadow: 0 28px 72px rgba(5, 12, 30, 0.42), 0 8px 24px rgba(13, 27, 62, 0.14);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #0f172a;
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.98);
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.ps-modal-overlay.is-open .ps-modal {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

/* Modal Ust Baslik */
.ps-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.ps-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ps-header-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(13, 27, 62, 0.06);
    border: 1px solid rgba(13, 27, 62, 0.1);
    color: #0d1b3e;
}

.ps-header-titles {
    min-width: 0;
}

.ps-header-title {
    margin: 0;
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: #0d1b3e;
    letter-spacing: -0.01em;
}

.ps-header-subtitle {
    margin: 2px 0 0;
    font-size: 12.5px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-close-btn {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ps-close-btn:hover {
    background: #0d1b3e;
    border-color: #0d1b3e;
    color: #ffffff;
    transform: translateY(-1px);
}

.ps-close-btn:focus-visible,
.ps-pill-btn:focus-visible,
.ps-action-btn:focus-visible,
.ps-channel-btn:focus-visible,
.ps-mini-btn:focus-visible,
.ps-thumb-btn:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

/* Modal Govde (Masaustu: 2 Kolon, Mobil: Tek Kolon Kaydirilabilir) */
.ps-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 0;
}

.ps-modal-body::-webkit-scrollbar {
    width: 8px;
}

.ps-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid #ffffff;
}

/* Sol Kolon: Sosyal Medya Sablon Onizleme Alani */
.ps-stage-col {
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 22px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
}

.ps-controls-bar {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ps-segmented {
    max-width: 100%;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: #e2e8f0;
    border-radius: 10px;
}

.ps-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 10px;
    background: transparent;
    border: none;
    border-radius: 7px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.ps-pill-btn:hover {
    color: #0d1b3e;
}

.ps-pill-btn.is-active {
    background: #ffffff;
    color: #0d1b3e;
    box-shadow: 0 1px 3px rgba(13, 27, 62, 0.12);
}

.ps-pill-dim {
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.ps-pill-btn.is-active .ps-pill-dim {
    color: #059669;
}

/* Canvas Onizleme Cercevesi */
.ps-canvas-stage {
    position: relative;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: #eef2f7;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    min-height: 340px;
}

.ps-stage-meta {
    max-width: 100%;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.ps-stage-meta-strong {
    color: #0d1b3e;
    font-weight: 700;
}

.ps-stage-sep {
    color: #cbd5e1;
}

.ps-canvas-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-height: 390px;
}

.ps-canvas-el {
    display: block;
    max-width: 100%;
    max-height: 380px;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 1px solid rgba(13, 27, 62, 0.1);
    box-shadow: 0 14px 30px -8px rgba(13, 27, 62, 0.18), 0 4px 12px rgba(13, 27, 62, 0.08);
    background: #faf9f5;
}

.ps-canvas-el.is-format-post {
    aspect-ratio: 1 / 1;
}

.ps-canvas-el.is-format-story {
    aspect-ratio: 9 / 16;
}

.ps-canvas-el.is-format-landscape {
    aspect-ratio: 1200 / 630;
}

/* Galeri Gorseli Secici */
.ps-thumbs-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ps-thumbs-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    margin-right: 4px;
}

.ps-thumb-btn {
    width: 44px;
    height: 44px;
    padding: 2px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.ps-thumb-btn:hover {
    border-color: #0d1b3e;
    transform: translateY(-1px);
}

.ps-thumb-btn.is-active {
    border-color: #059669;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.ps-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

/* Gorsel Aksiyon Butonlari (PNG Indir + Gorsel Kopyala) */
.ps-stage-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.ps-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.ps-action-btn.is-primary {
    background: #0d1b3e;
    border: 1.5px solid #0d1b3e;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 27, 62, 0.18);
}

.ps-action-btn.is-primary:hover {
    background: #172e66;
    border-color: #172e66;
    transform: translateY(-1px);
}

.ps-action-btn.is-secondary {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #0d1b3e;
}

.ps-action-btn.is-secondary:hover {
    background: #f1f5f9;
    border-color: #0d1b3e;
    transform: translateY(-1px);
}

.ps-action-btn.is-emerald {
    background: #059669;
    border: 1.5px solid #059669;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.24);
}

.ps-action-btn.is-emerald:hover {
    background: #047857;
    border-color: #047857;
    transform: translateY(-1px);
}

/* Sag Kolon: Mesaj, Baglanti ve Paylasim Kanallari */
.ps-share-col {
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 22px;
    background: #ffffff;
}

.ps-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.ps-section-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0d1b3e;
}

.ps-section-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ps-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 5px 10px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ps-mini-btn:hover {
    background: #eef2f7;
    border-color: #0d1b3e;
    color: #0d1b3e;
}

.ps-mini-btn.is-copied {
    background: #ecfdf5;
    border-color: #059669;
    color: #047857;
}

/* Dogrudan Baglanti Kutusu */
.ps-link-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 14px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
}

.ps-link-url {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: #0d1b3e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sosyal Platformlar Izgarasi */
.ps-channels-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ps-channel-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    color: #0f172a;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.ps-channel-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
}

.ps-channel-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #ffffff;
}

.ps-channel-icon.is-wa {
    background: #25d366;
}

.ps-channel-icon.is-mail {
    background: #0d1b3e;
}

.ps-channel-icon.is-li {
    background: #0a66c2;
}

.ps-channel-icon.is-x {
    background: #0f1419;
}

.ps-channel-icon.is-fb {
    background: #1877f2;
}

.ps-channel-icon.is-ig {
    background: linear-gradient(135deg, #833ab4 0%, #e1306c 55%, #f77737 100%);
}

.ps-channel-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ps-channel-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.ps-channel-hint {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Native Web Share Butonu (Desteklenen Tarayicilar) */
.ps-native-wrap {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ps-native-btn {
    width: 100%;
}

/* Canli Bildirim Alani (CLS = 0: sabit yukseklik / yumusak opacity) */
.ps-status-banner {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.ps-status-banner.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive: Tablet & Mobil */
@media (max-width: 960px) {
    .ps-modal-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .ps-stage-col {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .ps-canvas-wrap {
        max-height: 320px;
    }

    .ps-canvas-el {
        max-height: 310px;
    }
}

@media (max-width: 560px) {
    .ps-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .ps-modal {
        max-height: 94vh;
        max-height: 94dvh;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
    }

    .ps-modal-header {
        padding: 14px 16px;
    }

    .ps-header-title {
        font-size: 15.5px;
    }

    .ps-stage-col,
    .ps-share-col {
        padding: 14px 16px;
        gap: 14px;
    }

    .ps-canvas-stage {
        min-height: 240px;
        padding: 12px;
    }

    .ps-canvas-wrap {
        max-height: 260px;
    }

    .ps-canvas-el {
        max-height: 250px;
    }

    .ps-stage-meta {
        font-size: 10.5px;
        padding: 4px 10px;
    }

    .ps-stage-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .ps-channels-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ps-controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .ps-segmented {
        width: 100%;
        justify-content: space-between;
    }

    .ps-pill-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px 6px;
        font-size: 11px;
        gap: 4px;
        justify-content: center;
    }

    .ps-pill-dim {
        font-size: 10px;
    }

    .ps-link-box {
        padding: 8px 8px 8px 12px;
        gap: 8px;
    }
}
