/*
 * Mix365 schedule header redesign
 * Removes the visible authentication panel and gives the week controls
 * a full Vice-style neon/glitch appearance.
 */

/* Completely remove the signed-in/check-again panel */

#mix365AuthDiagnostic,
.mix365-auth-diagnostic {
    display: none !important;
}

/* Main schedule shell spacing */

.mix365-schedule-shell {
    position: relative;
}

.mix365-schedule-section-heading {
    margin-bottom: clamp(34px, 5vw, 74px) !important;
}

/* Add Event button area */

.mix365-schedule-add-actions {
    position: relative;
    z-index: 10;

    display: flex !important;
    justify-content: center;
    align-items: center;

    margin:
        clamp(20px, 3vw, 42px)
        auto
        clamp(44px, 6vw, 82px) !important;
}

.mix365-schedule-add-button {
    position: relative;

    min-width: 220px;
    min-height: 60px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;

    padding: 16px 30px !important;

    border: 1px solid rgba(255,255,255,.18) !important;
    border-radius: 0 !important;

    color: #fff !important;

    background:
        linear-gradient(
            135deg,
            #ff174f 0%,
            #ef0053 54%,
            #d70059 100%
        ) !important;

    clip-path: polygon(
        14px 0,
        calc(100% - 22px) 0,
        calc(100% - 22px) 5px,
        100% 5px,
        100% calc(100% - 14px),
        calc(100% - 14px) calc(100% - 14px),
        calc(100% - 14px) 100%,
        22px 100%,
        22px calc(100% - 5px),
        0 calc(100% - 5px),
        0 14px,
        14px 14px
    );

    font-size: 18px !important;
    line-height: 1;
    font-weight: 800 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase;

    box-shadow:
        0 0 0 1px rgba(255,23,79,.22),
        0 0 26px rgba(255,23,79,.38),
        0 18px 42px rgba(0,0,0,.42);

    transition:
        transform 180ms ease,
        filter 180ms ease,
        box-shadow 180ms ease;
}

.mix365-schedule-add-button::before,
.mix365-schedule-add-button::after {
    content: "";

    position: absolute;
    pointer-events: none;
}

.mix365-schedule-add-button::before {
    inset: -5px 16px auto -7px;
    height: 2px;

    background:
        linear-gradient(
            90deg,
            transparent 0 4%,
            #00e2f2 4% 25%,
            transparent 25% 64%,
            #ff174f 64% 88%,
            transparent 88%
        );

    opacity: .9;
}

.mix365-schedule-add-button::after {
    right: -8px;
    bottom: 8px;

    width: 64px;
    height: 2px;

    background: #00e2f2;

    box-shadow:
        -18px 4px 0 #ff174f,
        -5px -5px 0 rgba(255,255,255,.5);

    opacity: .72;
}

.mix365-schedule-add-button:hover {
    transform: translateY(-4px);
    filter: brightness(1.08) saturate(1.06);

    box-shadow:
        0 0 0 1px rgba(255,23,79,.35),
        0 0 38px rgba(255,23,79,.55),
        0 24px 55px rgba(0,0,0,.5);
}

.mix365-schedule-add-button span:first-child {
    font-size: 27px;
    font-weight: 300;
    line-height: 1;
}

/* Week navigation layout */

.mix365-schedule-week {
    position: relative;
    z-index: 8;

    display: grid !important;
    grid-template-columns:
        minmax(72px, 92px)
        minmax(0, 1fr)
        minmax(72px, 92px);

    align-items: center;
    gap: clamp(20px, 4vw, 54px);

    width: min(100%, 1100px);

    margin:
        0 auto
        clamp(52px, 7vw, 92px) !important;

    padding:
        clamp(20px, 3vw, 34px)
        clamp(6px, 2vw, 20px);
}

/* Glitch lines behind heading */

.mix365-schedule-week::before,
.mix365-schedule-week::after {
    content: "";

    position: absolute;
    z-index: -1;

    top: 50%;

    width: clamp(38px, 8vw, 130px);
    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,23,79,.95)
        );

    box-shadow:
        0 6px 0 rgba(0,226,242,.38);
}

.mix365-schedule-week::before {
    left: 7%;
}

.mix365-schedule-week::after {
    right: 7%;

    transform: scaleX(-1);
}

/* Proper left and right arrows */

.mix365-week-button {
    position: relative;

    width: clamp(70px, 7vw, 90px) !important;
    height: clamp(70px, 7vw, 90px) !important;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    padding: 0 !important;

    border:
        1px solid
        rgba(0,226,242,.34) !important;

    border-radius: 0 !important;

    color: #fff !important;

    background:
        linear-gradient(
            145deg,
            rgba(17,19,25,.98),
            rgba(5,6,9,.99)
        ) !important;

    clip-path: polygon(
        14px 0,
        100% 0,
        100% calc(100% - 14px),
        calc(100% - 14px) 100%,
        0 100%,
        0 14px
    );

    font-size: 0 !important;
    line-height: 1;

    box-shadow:
        0 0 0 1px rgba(255,255,255,.025),
        0 18px 38px rgba(0,0,0,.42);

    cursor: pointer;

    transition:
        transform 170ms ease,
        border-color 170ms ease,
        box-shadow 170ms ease,
        filter 170ms ease;
}

.mix365-week-button::before {
    content: "";

    width: 21px;
    height: 21px;

    border-top: 4px solid #fff;
    border-right: 4px solid #fff;

    filter:
        drop-shadow(2px 0 0 rgba(255,23,79,.62))
        drop-shadow(-2px 0 0 rgba(0,226,242,.62));
}

#mix365SchedulePrevious::before {
    transform: rotate(-135deg);
    margin-left: 8px;
}

#mix365ScheduleNext::before {
    transform: rotate(45deg);
    margin-right: 8px;
}

.mix365-week-button::after {
    content: "";

    position: absolute;

    left: 10px;
    right: 10px;
    bottom: 7px;

    height: 2px;

    background:
        linear-gradient(
            90deg,
            #ff174f 0 32%,
            transparent 32% 67%,
            #00e2f2 67% 100%
        );

    opacity: .62;
}

.mix365-week-button:hover {
    transform: translateY(-5px);

    border-color: rgba(0,226,242,.92) !important;

    filter:
        brightness(1.1)
        saturate(1.08);

    box-shadow:
        0 0 0 1px rgba(255,23,79,.18),
        0 0 24px rgba(0,226,242,.25),
        0 0 30px rgba(255,23,79,.14),
        0 25px 48px rgba(0,0,0,.5);
}

.mix365-week-button:active {
    transform: translateY(-1px);
}

/* Centre title and date */

.mix365-week-copy {
    position: relative;

    min-width: 0;

    text-align: center;
}

#mix365ScheduleWeekTitle {
    position: relative;

    display: block;

    margin: 0;

    color: #fff !important;

    font-size:
        clamp(34px, 5.5vw, 76px) !important;

    line-height: .94 !important;
    font-weight: 950 !important;
    letter-spacing: -.055em !important;
    text-transform: uppercase;

    text-shadow:
        3px 0 0 rgba(255,23,79,.55),
        -3px 0 0 rgba(0,226,242,.5);

    transform: translateZ(0);
}

#mix365ScheduleWeekTitle::before,
#mix365ScheduleWeekTitle::after {
    content: attr(data-glitch-text);

    position: absolute;
    inset: 0;

    pointer-events: none;

    opacity: 0;
}

#mix365ScheduleWeekTitle::before {
    color: #ff174f;
    transform: translateX(4px);
}

#mix365ScheduleWeekTitle::after {
    color: #00e2f2;
    transform: translateX(-4px);
}

.mix365-schedule-week.is-week-glitch
#mix365ScheduleWeekTitle {
    animation:
        mix365WeekTitleBase
        180ms steps(2, end);
}

.mix365-schedule-week.is-week-glitch
#mix365ScheduleWeekTitle::before {
    opacity: .7;

    clip-path:
        inset(10% 0 62% 0);

    animation:
        mix365WeekTitleBefore
        180ms steps(2, end);
}

.mix365-schedule-week.is-week-glitch
#mix365ScheduleWeekTitle::after {
    opacity: .72;

    clip-path:
        inset(66% 0 8% 0);

    animation:
        mix365WeekTitleAfter
        180ms steps(2, end);
}

#mix365ScheduleWeekRange {
    position: relative;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    margin-top:
        clamp(17px, 2vw, 25px) !important;

    color: #ff2a67 !important;

    font-size:
        clamp(13px, 1.5vw, 19px) !important;

    line-height: 1.2;
    font-weight: 850 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase;

    text-shadow:
        0 0 14px rgba(255,42,103,.32);
}

#mix365ScheduleWeekRange::before,
#mix365ScheduleWeekRange::after {
    content: "";

    position: absolute;

    top: 50%;

    width:
        clamp(40px, 7vw, 110px);

    height: 2px;

    background:
        linear-gradient(
            90deg,
            transparent,
            #ff2a67
        );

    box-shadow:
        0 5px 0 rgba(0,226,242,.24);
}

#mix365ScheduleWeekRange::before {
    right: calc(100% + 18px);
}

#mix365ScheduleWeekRange::after {
    left: calc(100% + 18px);
    transform: scaleX(-1);
}

/* Animate only occasionally, not constantly */

@keyframes mix365WeekTitleBase {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-2px);
    }

    50% {
        transform: translateX(2px);
    }

    75% {
        transform: translateX(-1px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes mix365WeekTitleBefore {
    0% {
        transform: translateX(4px);
    }

    50% {
        transform: translateX(9px);
    }

    100% {
        transform: translateX(4px);
    }
}

@keyframes mix365WeekTitleAfter {
    0% {
        transform: translateX(-4px);
    }

    50% {
        transform: translateX(-9px);
    }

    100% {
        transform: translateX(-4px);
    }
}

/* Tighten the gap before tabs */

.mix365-schedule-toolbar {
    margin-top: 0 !important;
}

/* Tablet */

@media (max-width: 900px) {
    .mix365-schedule-week {
        grid-template-columns:
            68px
            minmax(0, 1fr)
            68px;

        gap: 18px;
    }

    .mix365-week-button {
        width: 68px !important;
        height: 68px !important;
    }

    .mix365-schedule-week::before,
    .mix365-schedule-week::after {
        display: none;
    }
}

/* Mobile */

@media (max-width: 640px) {
    .mix365-schedule-section-heading {
        margin-bottom: 28px !important;
    }

    .mix365-schedule-add-actions {
        margin:
            18px auto 42px !important;
    }

    .mix365-schedule-add-button {
        min-width: 190px;
        min-height: 54px;

        padding: 14px 23px !important;

        font-size: 15px !important;
    }

    .mix365-schedule-week {
        grid-template-columns:
            54px
            minmax(0, 1fr)
            54px;

        gap: 11px;

        padding-left: 0;
        padding-right: 0;

        margin-bottom: 50px !important;
    }

    .mix365-week-button {
        width: 54px !important;
        height: 60px !important;
    }

    .mix365-week-button::before {
        width: 16px;
        height: 16px;

        border-width: 3px;
    }

    #mix365ScheduleWeekTitle {
        font-size:
            clamp(27px, 9vw, 42px) !important;

        letter-spacing: -.045em !important;
    }

    #mix365ScheduleWeekRange {
        margin-top: 14px !important;

        font-size: 11px !important;
        letter-spacing: .07em !important;
    }

    #mix365ScheduleWeekRange::before,
    #mix365ScheduleWeekRange::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mix365-schedule-week *,
    .mix365-schedule-add-button {
        animation: none !important;
        transition: none !important;
    }
}

/* MIX365_ADD_EVENT_ROLE_GUARD_START */

/*
 * Hide Add Event from guests and standard users.
 * It becomes visible only for DJs, Admins and Owners.
 */

#mix365ScheduleAddActions,
.mix365-schedule-add-actions,
#openAddEventBtn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* DJ */

body[data-mix365-role="dj" i]
#mix365ScheduleAddActions,

body[data-mix365-role="dj" i]
.mix365-schedule-add-actions,

body[data-mix365-role="dj" i]
#openAddEventBtn,

/* Admin */

body[data-mix365-role="admin" i]
#mix365ScheduleAddActions,

body[data-mix365-role="admin" i]
.mix365-schedule-add-actions,

body[data-mix365-role="admin" i]
#openAddEventBtn,

body[data-mix365-role="administrator" i]
#mix365ScheduleAddActions,

body[data-mix365-role="administrator" i]
.mix365-schedule-add-actions,

body[data-mix365-role="administrator" i]
#openAddEventBtn,

/* DJ Admin variations */

body[data-mix365-role="djadmin" i]
#mix365ScheduleAddActions,

body[data-mix365-role="djadmin" i]
.mix365-schedule-add-actions,

body[data-mix365-role="djadmin" i]
#openAddEventBtn,

body[data-mix365-role="dj-admin" i]
#mix365ScheduleAddActions,

body[data-mix365-role="dj-admin" i]
.mix365-schedule-add-actions,

body[data-mix365-role="dj-admin" i]
#openAddEventBtn,

body[data-mix365-role="dj_admin" i]
#mix365ScheduleAddActions,

body[data-mix365-role="dj_admin" i]
.mix365-schedule-add-actions,

body[data-mix365-role="dj_admin" i]
#openAddEventBtn,

/* Owner */

body[data-mix365-role="owner" i]
#mix365ScheduleAddActions,

body[data-mix365-role="owner" i]
.mix365-schedule-add-actions,

body[data-mix365-role="owner" i]
#openAddEventBtn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/*
 * The parent is a flex container, but the button itself should remain
 * inline-flex so its current styling is preserved.
 */

body[data-mix365-role="dj" i]
#openAddEventBtn,

body[data-mix365-role="admin" i]
#openAddEventBtn,

body[data-mix365-role="administrator" i]
#openAddEventBtn,

body[data-mix365-role="djadmin" i]
#openAddEventBtn,

body[data-mix365-role="dj-admin" i]
#openAddEventBtn,

body[data-mix365-role="dj_admin" i]
#openAddEventBtn,

body[data-mix365-role="owner" i]
#openAddEventBtn {
    display: inline-flex !important;
}

/* MIX365_ADD_EVENT_ROLE_GUARD_END */

/* MIX365_SHADOW_AND_LINES_FIX_START */

/*
 * The title is clean normally.
 * During a glitch it uses the same sliced cyan/pink appearance
 * as the Events Schedule heading.
 */

#mix365ScheduleWeekTitle {
    position: relative !important;

    color: #ffffff !important;

    text-shadow: none !important;
    filter: none !important;

    transform: translateZ(0);
}

#mix365ScheduleWeekTitle::before,
#mix365ScheduleWeekTitle::after {
    content:
        attr(data-mix365-glitch-text) !important;

    position: absolute !important;
    inset: 0 !important;

    display: block !important;

    margin: 0 !important;

    pointer-events: none !important;

    font: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    letter-spacing: inherit !important;
    text-align: inherit !important;
    text-transform: inherit !important;

    opacity: 0;

    overflow: hidden;
}

#mix365ScheduleWeekTitle::before {
    color: #ff165c !important;

    transform: translateX(0);
}

#mix365ScheduleWeekTitle::after {
    color: #00e2f2 !important;

    transform: translateX(0);
}

/*
 * The existing schedule JavaScript adds is-week-glitch briefly.
 */

.mix365-schedule-week.is-week-glitch
#mix365ScheduleWeekTitle {
    animation:
        mix365ThemeWeekMainGlitch
        280ms steps(2, end) !important;
}

.mix365-schedule-week.is-week-glitch
#mix365ScheduleWeekTitle::before {
    opacity: .9;

    animation:
        mix365ThemeWeekPinkGlitch
        280ms steps(2, end) !important;
}

.mix365-schedule-week.is-week-glitch
#mix365ScheduleWeekTitle::after {
    opacity: .9;

    animation:
        mix365ThemeWeekCyanGlitch
        280ms steps(2, end) !important;
}

@keyframes mix365ThemeWeekMainGlitch {
    0% {
        transform:
            translate(0, 0)
            skewX(0);
    }

    12% {
        transform:
            translate(-3px, 1px)
            skewX(-1deg);
    }

    28% {
        transform:
            translate(4px, -1px)
            skewX(1deg);
    }

    46% {
        transform:
            translate(-2px, 0)
            skewX(0);
    }

    65% {
        transform:
            translate(3px, 1px)
            skewX(-.7deg);
    }

    82% {
        transform:
            translate(-1px, -1px)
            skewX(.7deg);
    }

    100% {
        transform:
            translate(0, 0)
            skewX(0);
    }
}

@keyframes mix365ThemeWeekPinkGlitch {
    0% {
        opacity: 0;

        clip-path:
            inset(0 0 100% 0);

        transform:
            translateX(0);
    }

    10% {
        opacity: .92;

        clip-path:
            inset(5% 0 78% 0);

        transform:
            translateX(10px);
    }

    24% {
        opacity: .75;

        clip-path:
            inset(33% 0 46% 0);

        transform:
            translateX(-7px);
    }

    42% {
        opacity: .92;

        clip-path:
            inset(68% 0 12% 0);

        transform:
            translateX(12px);
    }

    58% {
        opacity: .7;

        clip-path:
            inset(18% 0 65% 0);

        transform:
            translateX(-5px);
    }

    76% {
        opacity: .88;

        clip-path:
            inset(52% 0 27% 0);

        transform:
            translateX(8px);
    }

    90% {
        opacity: .62;

        clip-path:
            inset(82% 0 4% 0);

        transform:
            translateX(-4px);
    }

    100% {
        opacity: 0;

        clip-path:
            inset(0 0 100% 0);

        transform:
            translateX(0);
    }
}

@keyframes mix365ThemeWeekCyanGlitch {
    0% {
        opacity: 0;

        clip-path:
            inset(100% 0 0 0);

        transform:
            translateX(0);
    }

    10% {
        opacity: .9;

        clip-path:
            inset(75% 0 7% 0);

        transform:
            translateX(-10px);
    }

    24% {
        opacity: .74;

        clip-path:
            inset(12% 0 70% 0);

        transform:
            translateX(7px);
    }

    42% {
        opacity: .92;

        clip-path:
            inset(43% 0 36% 0);

        transform:
            translateX(-12px);
    }

    58% {
        opacity: .7;

        clip-path:
            inset(62% 0 18% 0);

        transform:
            translateX(5px);
    }

    76% {
        opacity: .88;

        clip-path:
            inset(25% 0 55% 0);

        transform:
            translateX(-8px);
    }

    90% {
        opacity: .62;

        clip-path:
            inset(4% 0 82% 0);

        transform:
            translateX(4px);
    }

    100% {
        opacity: 0;

        clip-path:
            inset(100% 0 0 0);

        transform:
            translateX(0);
    }
}

/*
 * Keep the decorative horizontal lines removed.
 */

.mix365-schedule-week::before,
.mix365-schedule-week::after,
#mix365ScheduleWeekRange::before,
#mix365ScheduleWeekRange::after {
    content: none !important;

    display: none !important;

    background: none !important;
    box-shadow: none !important;
}

/* MIX365_SHADOW_AND_LINES_FIX_END */

