
/* =========================================================
   KINOWATCH — USERCOLLECTIONS POPUP
   Complete production stylesheet
   ========================================================= */

body.mk-usercollections-open{
    overflow:hidden;
}

/* Overlay root */
.mk-usercollections-modal{
    position:fixed;
    inset:0;
    z-index:999999;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:
        opacity .18s ease,
        visibility .18s ease;
}

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

/* Backdrop */
.mk-collections-backdrop{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.72);
    backdrop-filter:blur(3px);
}

/* Modal window */
.mk-usercollections-window{
    position:relative;
    z-index:2;
    width:min(480px, 100%);
    max-height:min(82vh, 760px);
    overflow:auto;
    padding:30px 24px 24px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:18px;
    background:#251c19;
    box-shadow:0 28px 80px rgba(0,0,0,.55);
    color:#fff;
    transform:translateY(10px) scale(.985);
    transition:transform .18s ease;
}

.mk-usercollections-modal.is-open
.mk-usercollections-window{
    transform:translateY(0) scale(1);
}

/* Close */
.mk-collections-close{
    position:absolute;
    top:11px;
    right:13px;
    display:flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    padding:0;
    border:0;
    border-radius:50%;
    background:#2f2623;
    color:#fff;
    cursor:pointer;
    font-size:27px;
    line-height:1;
    transition:background .18s ease, transform .18s ease;
}

.mk-collections-close:hover{
    background:#3c3330;
    transform:rotate(4deg);
}

/* Header */
.mk-collections-header{
    padding-right:48px;
    margin-bottom:20px;
}

.mk-collections-title{
    font-size:21px;
    font-weight:800;
    line-height:1.25;
}

.mk-collections-subtitle{
    margin-top:6px;
    color:rgba(255,255,255,.5);
    font-size:12px;
}

/* Loading / empty */
.mk-collections-loading,
.mk-collections-empty{
    padding:24px 14px;
    border:1px dashed rgba(255,255,255,.1);
    border-radius:12px;
    color:rgba(255,255,255,.48);
    text-align:center;
    font-size:12px;
    line-height:1.65;
}

/* Collection list */
.mk-collections-list{
    display:flex;
    flex-direction:column;
    gap:9px;
}

.mk-collection-item{
    display:flex;
    align-items:center;
    gap:13px;
    min-height:68px;
    padding:12px 14px;
    border:1px solid rgba(255,255,255,.09);
    border-radius:12px;
    background:#281f1c;
    cursor:pointer;
    user-select:none;
    transition:
        border-color .18s ease,
        background .18s ease,
        transform .18s ease,
        opacity .18s ease;
}

.mk-collection-item:hover{
    border-color:rgba(220,164,0,.35);
    background:#2e2522;
}

.mk-collection-item:active{
    transform:scale(.995);
}

.mk-collection-item.is-saving{
    opacity:.55;
    pointer-events:none;
}

/* Checkbox */
.mk-collection-check{
    position:relative;
    flex:0 0 auto;
}

.mk-collection-check input{
    position:absolute;
    width:1px;
    height:1px;
    opacity:0;
    pointer-events:none;
}

.mk-checkmark{
    display:flex;
    align-items:center;
    justify-content:center;
    width:24px;
    height:24px;
    border:2px solid rgba(255,255,255,.28);
    border-radius:7px;
    background:transparent;
    color:#7e7e7e;
    font-size:14px;
    font-weight:900;
    transition:
        background .18s ease,
        border-color .18s ease,
        color .18s ease;
}

.mk-collection-check input:checked + .mk-checkmark{
    border-color:#ff783e;
    background:#ff783e;
    color:#111;
}

.mk-collection-info{
    min-width:0;
    flex:1 1 auto;
}

.mk-collection-name{
    overflow:hidden;
    color:#fff;
    font-size:13px;
    font-weight:700;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.mk-collection-meta{
    display:flex;
    align-items:center;
    gap:6px;
    margin-top:5px;
    color:rgba(255,255,255,.45);
    font-size:11px;
}

/* Create section */
.mk-create-wrap{
    margin-top:20px;
    padding-top:17px;
    border-top:1px solid rgba(255,255,255,.08);
}

.mk-create-toggle{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:0;
    border:0;
    background:none;
    color:#fff;
    cursor:pointer;
    font-size:13px;
    font-weight:700;
}

.mk-create-toggle:hover{
    color:#ff783e;
}

.mk-create-toggle-plus{
    display:flex;
    align-items:center;
    justify-content:center;
    width:25px;
    height:25px;
    border:1px solid rgba(255,255,255,.15);
    border-radius:7px;
    background:rgba(255,255,255,.05);
    font-size:18px;
    line-height:1;
    padding: 0px 0px 5px 0;
    transition:
        transform .2s ease,
        background .2s ease,
        border-color .2s ease;
}

.mk-create-toggle.is-open
.mk-create-toggle-plus{
    transform:rotate(45deg);
    border-color:rgba(220,164,0,.35);
    background:rgba(220,164,0,.12);
    color:#ff783e;
}

.mk-collections-create[hidden]{
    display:none !important;
}

.mk-collections-create:not([hidden]){
    display:grid;
    grid-template-columns:minmax(0,1fr) 105px auto;
    gap:8px;
    margin-top:15px;
    animation:mkCreateOpen .18s ease;
}

@keyframes mkCreateOpen{
    from{
        opacity:0;
        transform:translateY(-4px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

.mk-create-title{
    grid-column:1 / -1;
    margin-bottom:3px;
    color:rgba(255,255,255,.8);
    font-size:12px;
    font-weight:700;
}

.mk-collections-create input,
.mk-collections-create select{
    min-width:0;
    height:42px;
    padding:0 12px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:9px;
    outline:none;
    background:#281f1c;
    color:#fff;
    font:inherit;
    font-size:12px;
}

.mk-collections-create input::placeholder{
    color:rgba(255,255,255,.36);
}

.mk-collections-create input:focus,
.mk-collections-create select:focus{
    border-color:rgba(220,164,0,.58);
}

.mk-collections-create button[type="submit"]{
    height:42px;
    padding:0 16px;
    border:0;
    border-radius:9px;
    background:#ff783e;
    color:#111;
    cursor:pointer;
    font-size:12px;
    font-weight:800;
}

.mk-collections-create button[type="submit"]:hover{
    filter:brightness(1.06);
}

.mk-collections-create button[type="submit"]:disabled{
    cursor:wait;
    opacity:.6;
}

/* Toast */
.mk-usercollections-toast{
    position:absolute;
    left:50%;
    bottom:18px;
    z-index:20;
    display:flex;
    align-items:center;
    gap:9px;
    min-width:220px;
    max-width:calc(100% - 36px);
    padding:11px 14px;
    border:1px solid rgba(255,255,255,.1);
    border-radius:10px;
    background:rgba(28,19,16,.97);
    box-shadow:0 12px 35px rgba(0,0,0,.35);
    color:#fff;
    font-size:12px;
    font-weight:600;
    opacity:0;
    visibility:hidden;
    transform:translate(-50%,8px);
    transition:
        opacity .2s ease,
        transform .2s ease,
        visibility .2s ease;
    pointer-events:none;
}

.mk-usercollections-toast.is-visible{
    opacity:1;
    visibility:visible;
    transform:translate(-50%,0);
}

.mk-toast-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:24px;
    height:24px;
    flex:0 0 24px;
    border-radius:50%;
    background:#ff783e;
    color:#111;
    font-size:14px;
    font-weight:900;
}

.mk-usercollections-toast.is-remove
.mk-toast-icon{
    background:#3c3330;
    color:#fff;
}

/* Scrollbar */
.mk-usercollections-window{
    scrollbar-width:thin;
    scrollbar-color:#55483e transparent;
}

.mk-usercollections-window::-webkit-scrollbar{
    width:7px;
}

.mk-usercollections-window::-webkit-scrollbar-thumb{
    border-radius:10px;
    background:#55483e;
}

/* Mobile */
@media(max-width:600px){

    .mk-usercollections-modal{
        align-items:flex-end;
        padding:10px;
    }

    .mk-usercollections-window{
        width:100%;
        max-height:88vh;
        padding:26px 16px 22px;
        border-radius:17px;
    }

    .mk-collections-create:not([hidden]){
        grid-template-columns:1fr;
    }

    .mk-create-title{
        grid-column:auto;
    }

    .mk-usercollections-toast{
        bottom:14px;
        min-width:0;
        width:calc(100% - 28px);
    }
}


/* =========================================================
   KINOWATCH MOBILE POPUP — FINAL POSITION + THEME OVERRIDE
   ========================================================= */

.mk-usercollections-modal{
    background:transparent;
}

/* Main popup window follows KinoWatch's dark-blue panel language. */
.mk-usercollections-window{
    border-color:rgba(255,255,255,.08);
    background:
        linear-gradient(
            145deg,
            rgba(40,31,28,.99),
            rgba(31,22,19,.99)
        );
    box-shadow:
        0 24px 70px rgba(0,0,0,.52);
}

/* Cyan focus/hover accents */
.mk-collection-item:hover{
    border-color:rgba(255,120,62,.32);
}

.mk-create-toggle:hover{
    color:#ff783e;
}

.mk-create-toggle.is-open
.mk-create-toggle-plus{
    border-color:rgba(255,120,62,.30);
    background:rgba(255,120,62,.10);
    color:#ff783e;
}

.mk-collections-create input:focus,
.mk-collections-create select:focus{
    border-color:rgba(255,120,62,.42);
    box-shadow:0 0 0 3px rgba(255,120,62,.05);
}

.mk-checkmark{
    background:#261d1a;
}

.mk-collection-check input:checked + .mk-checkmark{
    border-color:#ff783e;
    background:#ff783e;
    color:#1b120f;
}

.mk-collections-create button[type="submit"]{
    background:#ff783e;
    color:#1b120f;
}

.mk-toast-icon{
    background:#ff783e;
    color:#1b120f;
}


/*
   MOBILE:
   Do not anchor the dialog to the bottom.
   Start it just below the fixed header and keep the whole
   window scrollable inside the viewport.
*/
@media(max-width:600px){

    .mk-usercollections-modal{
        align-items:flex-start !important;

        padding:
            calc(var(--header-h, 58px) + 16px)
            12px
            max(16px, env(safe-area-inset-bottom)) !important;

        overflow-y:auto;
    }

    .mk-usercollections-window{
        width:100% !important;

        max-height:
            calc(
                100dvh -
                var(--header-h, 58px) -
                34px
            ) !important;

        margin:0 auto !important;

        padding:24px 15px 20px !important;

        border-radius:13px !important;

        overflow-y:auto !important;

        transform:translateY(-6px) scale(.99);
    }

    .mk-usercollections-modal.is-open
    .mk-usercollections-window{
        transform:translateY(0) scale(1);
    }

    .mk-collections-header{
        padding-right:42px;
        margin-bottom:16px;
    }

    .mk-collections-title{
        font-size:18px;
    }

    .mk-collections-subtitle{
        font-size:11px;
    }

    .mk-collection-item{
        min-height:62px;
        padding:10px 11px;
        border-radius:9px;
        background:#281f1c;
    }

    .mk-collection-name{
        font-size:12px;
    }

    .mk-collection-meta{
        font-size:10px;
    }

    .mk-collections-close{
        top:10px;
        right:10px;
        width:34px;
        height:34px;
        border-radius:8px;
        background:#332a27;
        font-size:23px;
    }

    .mk-create-wrap{
        margin-top:15px;
        padding-top:14px;
    }

    .mk-create-toggle{
        font-size:12px;
    }

    .mk-usercollections-toast{
        position:sticky;
        left:auto;
        bottom:0;

        width:100%;

        margin-top:12px;

        transform:translateY(6px);
    }

    .mk-usercollections-toast.is-visible{
        transform:translateY(0);
    }
}
