/* ==========================================================
   STREAMCORE R174B
   Production SCP7 Playout responsive polish
   + R173 workspace/channel menu polish
   CSS only
   ========================================================== */


/* ----------------------------------------------------------
   SCP7 ROOT
   ---------------------------------------------------------- */

.scp7-studio{
    box-sizing:border-box;
    width:100%;
    min-width:0;
    max-width:1920px;
    margin:0 auto;
    padding-bottom:30px;
}

.scp7-studio *,
.scp7-studio *::before,
.scp7-studio *::after{
    box-sizing:border-box;
}

.scp7-view,
.scp7-view>*{
    min-width:0;
    max-width:100%;
}


/* ----------------------------------------------------------
   TOP TOOLBAR
   ---------------------------------------------------------- */

.scp7-toolbar{
    width:100%;
    min-width:0;

    display:grid;

    grid-template-columns:
        minmax(250px,310px)
        minmax(260px,1fr)
        minmax(150px,185px);

    gap:10px;
    align-items:center;

    padding:10px;
    margin:0 0 10px;

    border:
        1px solid
        rgba(47,69,98,.68);

    border-radius:10px;

    background:
        linear-gradient(
            180deg,
            rgba(8,20,34,.96),
            rgba(5,14,26,.96)
        );

    box-shadow:
        0 10px 30px
        rgba(0,0,0,.13);
}


/* ----------------------------------------------------------
   INTERNAL PLAYOUT CHANNEL PICKER
   ---------------------------------------------------------- */

.scp7-channel-picker{
    width:100%;
    min-width:0;
    min-height:46px;

    display:grid;

    grid-template-columns:
        30px minmax(0,1fr);

    gap:8px;
    align-items:center;

    padding:6px 9px;

    border:
        1px solid
        rgba(47,68,96,.62);

    border-radius:8px;

    background:
        linear-gradient(
            180deg,
            rgba(12,27,44,.96),
            rgba(7,19,33,.96)
        );
}

.scp7-channel-picker label{
    min-width:0;
    overflow:hidden;
}

.scp7-channel-picker label small{
    display:block;

    margin:0 0 3px;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    color:#8290a4;

    font-size:8.5px;
    line-height:1;

    font-weight:700;

    letter-spacing:.045em;
    text-transform:uppercase;
}

.scp7-channel-picker select{
    display:block;

    width:100%;
    max-width:100%;
    min-width:0;

    height:24px;

    padding:0 23px 0 0;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    border:0;
    outline:0;

    background:transparent;

    color:#edf2f8;

    font:inherit;
    font-size:11px;
    font-weight:720;

    cursor:pointer;
}


/* ----------------------------------------------------------
   SEARCH
   ---------------------------------------------------------- */

.scp7-search{
    width:100%;
    min-width:0;
}

.scp7-search input{
    width:100%;
    min-width:0;
}


/* ----------------------------------------------------------
   MAIN TABS
   ---------------------------------------------------------- */

.scp7-tabs{
    display:flex !important;
    align-items:stretch;

    width:100%;
    min-width:0;
    max-width:100%;

    gap:4px;

    padding:4px;
    margin:0 0 10px;

    overflow-x:auto;
    overflow-y:hidden;

    border:
        1px solid
        rgba(37,56,82,.65);

    border-radius:9px;

    background:
        rgba(5,15,27,.78);

    scrollbar-width:thin;
    scrollbar-color:
        rgba(139,76,226,.42)
        transparent;

    overscroll-behavior-inline:contain;
    scroll-snap-type:x proximity;
}

.scp7-tabs button{
    flex:1 0 auto;

    min-width:102px;
    min-height:39px;

    padding:0 10px;

    border-radius:7px;

    white-space:nowrap;

    scroll-snap-align:start;
}

.scp7-tabs button.active{
    box-shadow:
        inset 0 0 0 1px
        rgba(157,79,245,.28),
        0 5px 17px
        rgba(91,36,163,.14);
}


/* ----------------------------------------------------------
   VIEW / PANELS
   ---------------------------------------------------------- */

.scp7-view{
    width:100%;
    min-width:0;

    padding:
        clamp(10px,1vw,18px);
}

.scp7-panel,
.scp7-library-main,
.scp7-asset-detail,
.scp7-playlist-list,
.scp7-playlist-editor,
.scp7-playlist-config,
.scp7-rule-list,
.scp7-rule-editor,
.scp7-simulation,
.scp7-history-detail,
.scp7-event-detail,
.scp7-settings-side{
    min-width:0;

    border-radius:9px;
}

.scp7-panel{
    box-shadow:
        0 8px 28px
        rgba(0,0,0,.09);
}

.scp7-panel-body{
    min-width:0;
}


/* ----------------------------------------------------------
   METRICS
   ---------------------------------------------------------- */

.scp7-metrics-row{
    gap:8px;
}

.scp7-metric{
    min-width:0;
    min-height:70px;

    padding:10px;

    border-radius:8px;
}


/* ----------------------------------------------------------
   VIDEO / PREVIEW
   ---------------------------------------------------------- */

.scp7-video-stage{
    width:100%;
    max-width:100%;
    min-width:0;

    overflow:hidden;

    border-radius:8px;

    background:#01060c;
}

.scp7-video,
.scp7-preview-video{
    display:block;

    width:100%;
    max-width:100%;
    height:auto;

    aspect-ratio:16/9;

    object-fit:contain;

    background:#01050a;
}


/* ----------------------------------------------------------
   LARGE WORK AREA GRIDS
   ---------------------------------------------------------- */

.scp7-library-grid,
.scp7-playlist-layout,
.scp7-rules-layout,
.scp7-schedule-layout,
.scp7-history-layout,
.scp7-events-grid,
.scp7-settings-layout{
    min-width:0;
    max-width:100%;

    gap:12px;
}


/* ----------------------------------------------------------
   TABLES
   ---------------------------------------------------------- */

.scp7-asset-table,
.scp7-editor-table,
.scp7-history-table,
.scp7-audit-table{
    width:100%;
    max-width:100%;
    min-width:0;
}

.scp7-asset-table,
.scp7-editor-table,
.scp7-history-table,
.scp7-audit-table{
    overflow-x:auto;
    overflow-y:visible;

    -webkit-overflow-scrolling:touch;
    overscroll-behavior-inline:contain;
}


/* ----------------------------------------------------------
   FORM CONTROLS
   ---------------------------------------------------------- */

.scp7-input,
.scp7-field input,
.scp7-field select,
.scp7-field textarea{
    max-width:100%;
}

.scp7-btn{
    min-width:0;
}


/* ==========================================================
   R173 MAIN WORKSPACE / CHANNEL SELECTOR
   ========================================================== */

.sc-shell.client .workspace-select{
    min-width:0;
    min-height:42px;

    border-radius:9px;

    transition:
        border-color .14s ease,
        background .14s ease,
        box-shadow .14s ease;
}

.sc-shell.client .workspace-select:hover{
    border-color:
        rgba(145,73,238,.48);

    box-shadow:
        0 0 0 2px
        rgba(145,73,238,.055);
}

.sc-shell.client .workspace-select span{
    min-width:0;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    font-weight:720;
}


/* R173 popup */

.sc-mt-menu-r168c.sc-r173-unified-menu{
    box-sizing:border-box;

    width:
        clamp(
            286px,
            21vw,
            360px
        ) !important;

    max-width:
        calc(100vw - 24px);

    max-height:
        min(
            620px,
            calc(100vh - 28px)
        );

    padding:7px;

    overflow-x:hidden;
    overflow-y:auto;

    overscroll-behavior:contain;

    border:
        1px solid
        rgba(126,66,205,.70);

    border-radius:12px;

    background:
        linear-gradient(
            180deg,
            rgba(8,13,25,.995),
            rgba(5,10,19,.995)
        );

    box-shadow:
        0 24px 65px
        rgba(0,0,0,.58),
        inset 0 1px
        rgba(255,255,255,.024);

    scrollbar-width:thin;
    scrollbar-color:
        rgba(139,76,226,.52)
        transparent;
}

.sc-mt-menu-r168c.sc-r173-unified-menu
.sc-mt-title-r168c{
    padding:7px 9px 9px;

    color:#8f9bad;

    font-size:9px;
    line-height:1;

    font-weight:850;

    letter-spacing:.06em;
    text-transform:uppercase;
}

.sc-mt-menu-r168c.sc-r173-unified-menu
>button{
    min-height:49px;

    margin:0 0 4px;
    padding:8px 10px;

    border-radius:9px;
}

.sc-mt-menu-r168c.sc-r173-unified-menu
.sc-r173-workspace-row{
    background:
        linear-gradient(
            90deg,
            rgba(105,48,179,.28),
            rgba(65,29,117,.15)
        );

    border-color:
        rgba(142,72,224,.42);
}

.sc-r173-channel-list{
    position:relative;

    margin:
        2px 0
        7px 13px;

    padding:
        2px 0
        2px 10px;

    border-left:
        1px solid
        rgba(151,81,239,.30);
}

.sc-mt-menu-r168c
.sc-r173-channel-row{
    width:
        calc(100% - 2px);

    min-height:45px;

    margin:2px 0;
    padding:7px 9px;

    border-radius:8px;

    transition:
        background .13s ease,
        border-color .13s ease,
        transform .13s ease;
}

.sc-mt-menu-r168c
.sc-r173-channel-row:hover{
    transform:translateX(1px);

    background:
        rgba(114,55,190,.17);
}

.sc-mt-menu-r168c
.sc-r173-channel-row.active-channel{
    background:
        linear-gradient(
            90deg,
            rgba(119,55,199,.34),
            rgba(76,32,137,.25)
        );

    border-color:
        rgba(158,79,243,.52);
}

.sc-mt-menu-r168c
.sc-r173-channel-row strong{
    display:block;

    max-width:100%;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    color:#edf1f7;

    font-size:11px;
    line-height:1.25;

    font-weight:760;
}

.sc-mt-menu-r168c
.sc-r173-channel-row small{
    display:block;

    max-width:100%;

    margin-top:2px;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    color:#78869a;

    font-size:8.5px;
}


/* ==========================================================
   LAPTOP / 1366 / 1440
   ========================================================== */

@media(max-width:1500px){

    .scp7-toolbar{
        grid-template-columns:
            minmax(225px,285px)
            minmax(220px,1fr)
            155px;

        gap:8px;
    }

    .scp7-view{
        padding:12px;
    }

    .scp7-library-grid,
    .scp7-history-layout,
    .scp7-events-grid{
        gap:10px;
    }

    .scp7-playlist-layout,
    .scp7-rules-layout,
    .scp7-schedule-layout,
    .scp7-settings-layout{
        gap:10px;
    }
}


/* ==========================================================
   <= 1180
   Small laptop / tablet landscape
   ========================================================== */

@media(max-width:1180px){

    .scp7-toolbar{
        grid-template-columns:
            minmax(220px,1fr)
            minmax(145px,auto);
    }

    .scp7-search{
        grid-column:1/-1;
        grid-row:2;
    }

    .scp7-library-grid,
    .scp7-playlist-layout,
    .scp7-rules-layout,
    .scp7-schedule-layout,
    .scp7-history-layout,
    .scp7-events-grid,
    .scp7-settings-layout{
        grid-template-columns:
            1fr !important;
    }

    .scp7-asset-detail,
    .scp7-playlist-config,
    .scp7-simulation,
    .scp7-history-detail,
    .scp7-event-detail,
    .scp7-settings-side{
        position:relative !important;

        top:auto !important;
        right:auto !important;
        bottom:auto !important;
        left:auto !important;
    }
}


/* ==========================================================
   <= 860
   Tablet portrait / mobile
   ========================================================== */

@media(max-width:860px){

    .scp7-studio{
        padding-bottom:
            calc(
                86px +
                env(safe-area-inset-bottom)
            );
    }

    .scp7-toolbar{
        grid-template-columns:1fr;

        gap:8px;

        padding:8px;

        border-radius:9px;
    }

    .scp7-search{
        grid-column:auto;
        grid-row:auto;
    }

    .scp7-channel-picker{
        min-height:48px;
    }

    .scp7-tabs{
        gap:3px;

        padding:4px;

        border-radius:8px;
    }

    .scp7-tabs button{
        flex:0 0 auto;

        min-width:92px;
        min-height:43px;

        padding:0 9px;

        font-size:10px;
    }

    .scp7-view{
        padding:8px 0;
    }

    .scp7-panel{
        border-radius:8px;
    }

    .scp7-metrics-row,
    .scp7-metrics-row.four,
    .scp7-metrics-row.five{
        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            ) !important;

        gap:7px;
    }

    .scp7-metric{
        min-height:66px;

        padding:9px;
    }

    .scp7-form-grid,
    .scp7-filter-grid,
    .scp7-trigger-grid,
    .scp7-detail-columns,
    .scp7-meter-columns{
        grid-template-columns:
            1fr !important;
    }

    .scp7-video,
    .scp7-preview-video{
        aspect-ratio:16/9;
    }

    .sc-mt-menu-r168c.sc-r173-unified-menu{
        width:
            calc(100vw - 24px) !important;

        max-width:
            calc(100vw - 24px);

        max-height:
            min(
                72vh,
                580px
            );
    }

    .sc-mt-menu-r168c
    .sc-r173-channel-row{
        min-height:48px;
    }
}


/* ==========================================================
   <= 600
   Phones
   ========================================================== */

@media(max-width:600px){

    .scp7-toolbar{
        margin-left:0;
        margin-right:0;
    }

    .scp7-tabs button{
        min-width:86px;
    }

    .scp7-metrics-row,
    .scp7-metrics-row.four,
    .scp7-metrics-row.five{
        grid-template-columns:
            1fr !important;
    }

    .scp7-video,
    .scp7-preview-video{
        aspect-ratio:16/10;
    }

    .scp7-asset-table .head,
    .scp7-asset-table .row,

    .scp7-editor-table .head,
    .scp7-editor-table .row,

    .scp7-history-table .head,
    .scp7-history-table .row,

    .scp7-audit-table .head,
    .scp7-audit-table .row{
        min-width:520px;
    }

    .scp7-btn,
    .scp7-field input,
    .scp7-field select{
        min-height:42px;
    }

    .sc-r173-channel-list{
        margin-left:9px;

        padding-left:8px;
    }
}


/* ==========================================================
   <= 420
   Small phones
   ========================================================== */

@media(max-width:420px){

    .scp7-toolbar{
        padding:7px;
    }

    .scp7-channel-picker{
        padding-left:8px;
        padding-right:8px;
    }

    .scp7-tabs button{
        min-width:82px;

        font-size:9.5px;
    }

    .sc-mt-menu-r168c.sc-r173-unified-menu{
        width:
            calc(100vw - 16px) !important;

        max-width:
            calc(100vw - 16px);

        padding:6px;
    }
}


/* ==========================================================
   LARGE SCREENS / 4K
   ========================================================== */

@media(min-width:1800px){

    .scp7-studio{
        max-width:1880px;
    }

    .scp7-toolbar,
    .scp7-tabs,
    .scp7-view{
        max-width:1880px;

        margin-left:auto;
        margin-right:auto;
    }
}


/* ----------------------------------------------------------
   REDUCED MOTION
   ---------------------------------------------------------- */

@media(prefers-reduced-motion:reduce){

    .sc-shell.client
    .workspace-select,

    .sc-mt-menu-r168c
    .sc-r173-channel-row{
        transition:none !important;
    }
}
