/**
 * assets/css/profile/publisher.mobile.css
 *
 * DROPX PRIME SYSTEM — MOBIL / APP-SZERŰ POSZT KÖZZÉTEVŐ
 *
 * Ez a fájl kizárólag 768px és az alatti nézetre vonatkozik.
 * A fájl a közös HEADER-ből, a publisher.css UTÁN töltendő be.
 * Minden szabály mobil media query alatt van, ezért PC-n nincs hatása.
 *
 * Cél:
 * - Facebook-szerű, teljes képernyős mobil szerkesztő
 * - nincs kártya a kártyán belül
 * - nincs alsó sheet / lebegő desktop panel
 * - tiszta, rendezett, high-tech app UI
 * - biztonságos viewport kezelés (dvh + safe-area)
 * - könnyen használható érintési célpontok
 * - a háttér csak nagyon enyhén blur-ölt
 */

@media (max-width: 768px) {
    :root {
        --dx-mobile-gold: #d6a52b;
        --dx-mobile-gold-soft: rgba(214, 165, 43, 0.18);
        --dx-mobile-line: rgba(255, 255, 255, 0.09);
        --dx-mobile-line-soft: rgba(255, 255, 255, 0.055);
        --dx-mobile-surface: rgba(13, 16, 19, 0.97);
        --dx-mobile-surface-2: rgba(18, 21, 24, 0.96);
        --dx-mobile-text: #f3f5f7;
        --dx-mobile-muted: rgba(214, 219, 224, 0.58);
    }

    /* ---------------------------------------------------------------------
       LAUNCHER — mobilon kompakt, de továbbra is prémium
       --------------------------------------------------------------------- */
    .post-publisher-shell {
        width: 100%;
        margin: 0 0 10px;
    }

    .post-publisher-launcher {
        min-height: 56px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px;
        padding: 8px 9px;
        border-radius: 14px;
        background:
            radial-gradient(circle at 90% 0%, rgba(214,165,43,0.075), transparent 38%),
            linear-gradient(135deg, rgba(21,24,27,0.90), rgba(8,10,12,0.88));
        border-color: rgba(214,165,43,0.20);
        box-shadow:
            0 10px 26px rgba(0,0,0,0.20),
            inset 0 1px 0 rgba(255,255,255,0.045);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .publisher-launcher-avatar-wrap {
        width: 35px;
        height: 35px;
        flex-basis: 35px;
    }

    .publisher-launcher-avatar {
        border-color: rgba(214,165,43,0.50);
    }

    .publisher-launcher-prompt {
        min-width: 0;
        padding: 9px 12px;
        font-size: 0.82rem;
        line-height: 1.15;
    }

    .publisher-launcher-actions {
        gap: 3px;
        padding-left: 0;
    }

    .publisher-launcher-icon {
        width: 30px;
        height: 30px;
        border-radius: 9px;
    }

    .publisher-launcher-icon svg {
        width: 15px;
        height: 15px;
    }

    /* ---------------------------------------------------------------------
       BODY LOCK
       --------------------------------------------------------------------- */
    body.post-publisher-modal-open {
        overflow: hidden;
        overscroll-behavior: none;
    }

    /* ---------------------------------------------------------------------
       FULLSCREEN MODAL
       --------------------------------------------------------------------- */
    .post-publisher-modal {
        position: fixed;
        inset: 0;
        z-index: 100500;
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        max-width: none;
        max-height: none;
        margin: 0;
        padding: 0;
        display: block;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .16s ease, visibility .16s ease;
    }

    .post-publisher-modal.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Csak enyhe üveg/blur hatás — nincs sötét overlay. */
    .post-publisher-modal-backdrop {
        position: absolute;
        inset: 0;
        z-index: 0;
        display: block;
        background: rgba(6, 8, 10, 0.015);
        backdrop-filter: blur(1px);
        -webkit-backdrop-filter: blur(1px);
    }

    /* ---------------------------------------------------------------------
       APP FELÜLET — nincs kártyaérzet, nincs lekerekített modal
       --------------------------------------------------------------------- */
    .post-publisher-modal-panel {
        position: relative;
        z-index: 1;
        inset: auto;
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        max-width: none;
        max-height: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border: 0;
        border-radius: 0;
        background:
            radial-gradient(circle at 100% 0%, rgba(214,165,43,0.065), transparent 30%),
            radial-gradient(circle at 0% 100%, rgba(39,91,130,0.045), transparent 34%),
            linear-gradient(180deg, rgba(12,15,18,0.985), rgba(7,9,11,0.99));
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        transform: none;
        transform-origin: center;
        transition: opacity .16s ease;
    }

    .post-publisher-modal.is-open .post-publisher-modal-panel {
        transform: none;
    }

    /* Finom felső fénycsík — ettől lesz "app shell" érzete. */
    .post-publisher-modal-panel::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        z-index: 4;
        background: linear-gradient(90deg, transparent, rgba(214,165,43,0.70), transparent);
        pointer-events: none;
    }

    /* ---------------------------------------------------------------------
       FEJLÉC — FB-szerű, egyszerű és stabil
       --------------------------------------------------------------------- */
    .post-publisher-modal-header {
        position: relative;
        z-index: 5;
        flex: 0 0 auto;
        min-height: 58px;
        padding:
            calc(9px + env(safe-area-inset-top))
            14px
            9px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid var(--dx-mobile-line);
        background: rgba(10, 13, 16, 0.90);
        box-shadow: 0 5px 18px rgba(0,0,0,0.16);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .post-publisher-modal-heading {
        min-width: 0;
    }

    .post-publisher-modal-kicker {
        margin: 0 0 3px;
        color: var(--dx-mobile-gold);
        font-family: 'Orbitron', sans-serif;
        font-size: 0.48rem;
        font-weight: 800;
        letter-spacing: 1.8px;
        line-height: 1;
    }

    .post-publisher-modal-heading h2 {
        margin: 0;
        color: var(--dx-mobile-text);
        font-family: 'Chakra Petch', sans-serif;
        font-size: 1.08rem;
        font-weight: 800;
        line-height: 1.1;
        letter-spacing: 0.25px;
    }

    .post-publisher-modal-close {
        width: 36px;
        height: 36px;
        min-width: 36px;
        flex: 0 0 36px;
        border-radius: 50%;
        border: 1px solid rgba(255,255,255,0.11);
        background: rgba(255,255,255,0.045);
        color: rgba(255,255,255,0.74);
    }

    .post-publisher-modal-close:hover {
        color: #fff;
        border-color: rgba(214,165,43,0.45);
        background: rgba(214,165,43,0.09);
        transform: none;
    }

    .post-publisher-modal-close:active {
        transform: scale(0.94);
    }

    /* ---------------------------------------------------------------------
       FŐ TARTALOM — szabad, táblamentes felület
       --------------------------------------------------------------------- */
    .post-publisher-modal-body {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        padding: 12px 12px 18px;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .post-publisher-modal-body::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    /* A desktop kártyát mobilon teljesen "leemeljük" a UI-ról. */
    .post-publisher-modal-body .post-publisher-card {
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* A belső fejléc legyen egyszerű, ne legyen még egy kártyakeret. */
    .post-publisher-modal-body .publisher-header {
        gap: 10px;
        align-items: flex-start;
    }

    .post-publisher-modal-body .publisher-avatar {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    /* ---------------------------------------------------------------------
       SZÖVEGSZERKESZTŐ
       --------------------------------------------------------------------- */
    .post-publisher-modal-body .publisher-formatting-toolbar {
        min-height: 46px;
        padding: 6px 7px;
        gap: 2px;
        border: 1px solid var(--dx-mobile-line);
        border-bottom: 0;
        border-radius: 12px 12px 0 0;
        background: rgba(4,6,8,0.78);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .post-publisher-modal-body .publisher-formatting-toolbar::-webkit-scrollbar {
        display: none;
    }

    .post-publisher-modal-body .format-tag-btn {
        flex: 0 0 34px;
        width: 34px;
        min-width: 34px;
        height: 34px;
        padding: 0;
        border-radius: 9px;
        font-size: 0.86rem;
        color: rgba(240,243,246,0.78);
        background: rgba(255,255,255,0.025);
    }

    .post-publisher-modal-body .format-tag-btn:active {
        background: rgba(214,165,43,0.12);
        border-color: rgba(214,165,43,0.35);
        transform: scale(0.95);
    }

    .post-publisher-modal-body .toolbar-sep {
        flex: 0 0 1px;
        margin: 0 2px;
        height: 20px;
    }

    .post-publisher-modal-body .post-editor-textarea {
        display: block;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        min-height: 150px;
        max-height: 48dvh;
        padding: 14px 14px 16px;
        border: 1px solid var(--dx-mobile-line);
        border-radius: 0 0 12px 12px;
        background: rgba(3,5,7,0.72);
        color: var(--dx-mobile-text);
        font-size: 1rem;
        line-height: 1.55;
        resize: vertical;
        -webkit-appearance: none;
        appearance: none;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.018);
    }

    .post-publisher-modal-body .post-editor-textarea:focus {
        border-color: rgba(214,165,43,0.52);
        box-shadow: 0 0 0 2px rgba(214,165,43,0.06);
    }

    /* ---------------------------------------------------------------------
       MÉDIA ELŐNÉZET
       --------------------------------------------------------------------- */
    .post-publisher-modal-body .publisher-media-preview-container {
        margin-top: 10px;
        padding: 10px;
        border-radius: 12px;
        background: rgba(8,10,12,0.72);
        border-color: rgba(214,165,43,0.20);
        box-shadow: none;
    }

    .post-publisher-modal-body .publisher-preview-grid {
        gap: 8px;
    }

    .post-publisher-modal-body .publisher-preview-item {
        width: 70px;
        height: 70px;
        border-radius: 9px;
    }

    .post-publisher-modal-body .publisher-preview-item .preview-video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .post-publisher-modal-body .publisher-preview-video-badge {
        position: absolute;
        left: 6px;
        bottom: 6px;
        width: 20px;
        height: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        background: rgba(0,0,0,.68);
        border: 1px solid rgba(214,165,43,.48);
        color: var(--dx-mobile-gold);
        pointer-events: none;
    }

    .post-publisher-modal-body .publisher-preview-video-badge svg {
        width: 12px;
        height: 12px;
    }

    /* ---------------------------------------------------------------------
       ESZKÖZÖK / SELECTEK — mobilon szabályos rács
       --------------------------------------------------------------------- */
    .post-publisher-modal-body .publisher-footer {
        gap: 10px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--dx-mobile-line-soft);
    }

    .post-publisher-modal-body .publisher-tools-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        justify-content: stretch;
        align-items: stretch;
    }

    .post-publisher-modal-body .publisher-tools-row .tool-btn,
    .post-publisher-modal-body .publisher-tools-row .settings-input.select-compact,
    .post-publisher-modal-body .publisher-tools-row select.select-compact,
    .post-publisher-modal-body .publisher-tools-row .settings-input.select-compact-wide,
    .post-publisher-modal-body .publisher-tools-row select.select-compact-wide {
        width: 100%;
        min-width: 0;
        height: 42px;
        min-height: 42px;
        padding: 0 11px;
        border-radius: 10px;
        font-size: 0.82rem;
        box-sizing: border-box;
    }

    .post-publisher-modal-body .publisher-tools-row .settings-input.select-compact-wide,
    .post-publisher-modal-body .publisher-tools-row select.select-compact-wide {
        grid-column: span 1;
    }

    .post-publisher-modal-body .publisher-action-row {
        margin-top: 2px;
    }

    .post-publisher-modal-body .publish-submit-btn.full-width-submit {
        min-height: 46px;
        height: 46px;
        border-radius: 12px;
        font-size: 0.94rem;
        letter-spacing: 0.8px;
        box-shadow: 0 8px 22px rgba(214,165,43,0.08);
    }

    /* ---------------------------------------------------------------------
       FOOTER — mobilon tiszta app-státusz
       --------------------------------------------------------------------- */
    .post-publisher-modal-footer {
        position: relative;
        flex: 0 0 auto;
        min-height: 38px;
        padding: 7px 12px calc(8px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--dx-mobile-line-soft);
        background: rgba(8,10,12,0.90);
        color: rgba(205,209,213,0.42);
        font-size: 0.57rem;
        line-height: 1.25;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .post-publisher-modal-footer-status {
        display: none;
    }

    /* ---------------------------------------------------------------------
       EMOJI / GIF POPOVER — mobilon a kijelzőn belül maradjon
       --------------------------------------------------------------------- */
    .emoji-floating-popover {
        width: min(340px, calc(100vw - 20px));
        max-width: calc(100vw - 20px);
        border-radius: 14px;
        box-shadow: 0 18px 44px rgba(0,0,0,0.42), 0 0 20px rgba(214,165,43,0.08);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
}

@media (max-width: 420px) {
    .post-publisher-modal-header {
        min-height: 55px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .post-publisher-modal-heading h2 {
        font-size: 1rem;
    }

    .post-publisher-modal-body {
        padding: 10px 9px 16px;
    }

    .post-publisher-modal-body .publisher-formatting-toolbar {
        min-height: 44px;
    }

    .post-publisher-modal-body .format-tag-btn {
        flex-basis: 32px;
        width: 32px;
        min-width: 32px;
        height: 32px;
    }

    .post-publisher-modal-body .post-editor-textarea {
        min-height: 138px;
        font-size: 0.97rem;
    }

    .post-publisher-modal-body .publisher-tools-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 360px) {
    .post-publisher-launcher {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .publisher-launcher-actions {
        display: none;
    }

    .post-publisher-modal-body .publisher-tools-row .tool-btn,
    .post-publisher-modal-body .publisher-tools-row .settings-input.select-compact,
    .post-publisher-modal-body .publisher-tools-row select.select-compact {
        font-size: 0.80rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .post-publisher-modal,
    .post-publisher-modal-panel,
    .post-publisher-modal-close,
    .post-publisher-launcher,
    .post-publisher-launcher-icon {
        transition: none;
    }
}
