/*
 * Mix365 themed schedule cards.
 * Rough clipped edges, Vice-style framing and restrained glitch effects.
 */

.mix365-schedule-results {
    gap: clamp(20px, 2.6vw, 34px) !important;
}

.mix365-schedule-card {
    --mix365-card-cut: 18px;
    --mix365-card-accent: #00e2f2;

    position: relative !important;
    isolation: isolate;

    overflow: visible !important;

    border: 0 !important;
    border-radius: 0 !important;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.045),
            rgba(255,255,255,0) 32%
        ),
        linear-gradient(
            160deg,
            rgba(20,22,28,.98),
            rgba(5,6,9,.99)
        ) !important;

    clip-path: polygon(
        var(--mix365-card-cut) 0,
        calc(100% - 34px) 0,
        calc(100% - 34px) 7px,
        100% 7px,
        100% calc(100% - var(--mix365-card-cut)),
        calc(100% - var(--mix365-card-cut)) calc(100% - var(--mix365-card-cut)),
        calc(100% - var(--mix365-card-cut)) 100%,
        38px 100%,
        38px calc(100% - 7px),
        0 calc(100% - 7px),
        0 var(--mix365-card-cut),
        var(--mix365-card-cut) var(--mix365-card-cut)
    ) !important;

    box-shadow:
        0 25px 55px rgba(0,0,0,.48),
        0 0 0 1px rgba(255,255,255,.08),
        0 0 30px rgba(0,226,242,.06) !important;

    transform: translateZ(0);
    transition:
        transform 180ms ease,
        filter 180ms ease,
        box-shadow 180ms ease;
}

.mix365-schedule-card:nth-child(3n+2) {
    --mix365-card-accent: #ff1956;
}

.mix365-schedule-card:nth-child(3n+3) {
    --mix365-card-accent: #c7ff00;
}

.mix365-schedule-card::before {
    content: "";

    position: absolute;
    z-index: 8;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            var(--mix365-card-accent) 0 56px,
            transparent 56px
        ) top left / 100% 2px no-repeat,

        linear-gradient(
            180deg,
            var(--mix365-card-accent) 0 42px,
            transparent 42px
        ) top right / 2px 100% no-repeat,

        linear-gradient(
            270deg,
            rgba(255,255,255,.24) 0 76px,
            transparent 76px
        ) bottom right / 100% 1px no-repeat,

        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,.018) 0,
            rgba(255,255,255,.018) 1px,
            transparent 1px,
            transparent 4px
        );

    opacity: .82;
}

.mix365-schedule-card::after {
    content: "";

    position: absolute;
    z-index: 9;

    width: 74px;
    height: 11px;

    top: -3px;
    right: 23px;

    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            transparent 0 7px,
            var(--mix365-card-accent) 7px 52px,
            transparent 52px
        );

    opacity: .92;
    filter: drop-shadow(
        0 0 8px
        color-mix(in srgb, var(--mix365-card-accent) 55%, transparent)
    );
}

.mix365-schedule-card:hover {
    transform:
        translateY(-5px)
        rotate(-.12deg);

    filter:
        contrast(1.04)
        saturate(1.06);

    box-shadow:
        0 32px 75px rgba(0,0,0,.56),
        0 0 0 1px color-mix(
            in srgb,
            var(--mix365-card-accent) 38%,
            transparent
        ),
        0 0 38px color-mix(
            in srgb,
            var(--mix365-card-accent) 13%,
            transparent
        ) !important;
}

/* Rough image frame */

.mix365-schedule-image {
    position: relative;
    overflow: hidden !important;

    clip-path: polygon(
        0 0,
        calc(100% - 16px) 0,
        100% 16px,
        100% 100%,
        17px 100%,
        0 calc(100% - 17px)
    );
}

.mix365-schedule-image::after {
    content: "";

    position: absolute;
    z-index: 3;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            transparent 48%,
            rgba(0,0,0,.78) 100%
        ),
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,.025) 0,
            rgba(255,255,255,.025) 1px,
            transparent 1px,
            transparent 4px
        );
}

.mix365-schedule-image img {
    transition:
        transform 420ms cubic-bezier(.2,.75,.25,1),
        filter 420ms ease;
}

.mix365-schedule-card:hover
.mix365-schedule-image img {
    transform: scale(1.045);
    filter:
        contrast(1.08)
        saturate(1.08);
}

.mix365-schedule-time {
    z-index: 5 !important;

    border: 1px solid
        color-mix(
            in srgb,
            var(--mix365-card-accent) 58%,
            transparent
        ) !important;

    border-radius: 0 !important;

    background:
        rgba(4,5,8,.9) !important;

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

    box-shadow:
        0 0 18px
        color-mix(
            in srgb,
            var(--mix365-card-accent) 14%,
            transparent
        );
}

/* Content */

.mix365-schedule-card-content {
    position: relative;
    z-index: 4;

    padding-top: 22px !important;
}

.mix365-schedule-card-content::before {
    content: "MIX365 // LIVE SCHEDULE";

    display: block;

    margin-bottom: 10px;

    color: var(--mix365-card-accent);

    font-size: 8px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .18em;
    text-transform: uppercase;

    opacity: .78;
}

.mix365-schedule-card-content h2 {
    position: relative;

    display: inline-block;

    margin-bottom: 13px !important;

    color: #fff !important;

    font-size:
        clamp(23px, 2.2vw, 33px) !important;

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

    text-shadow:
        2px 0 0 rgba(255,25,86,.34),
        -2px 0 0 rgba(0,226,242,.3);
}

.mix365-schedule-card-content h2::after {
    content: "";

    display: block;

    width: 62px;
    height: 2px;

    margin-top: 10px;

    background:
        var(--mix365-card-accent);

    box-shadow:
        0 0 13px
        color-mix(
            in srgb,
            var(--mix365-card-accent) 48%,
            transparent
        );
}

.mix365-schedule-description {
    color: rgba(255,255,255,.68) !important;
    line-height: 1.65 !important;
}

/* Badges */

.mix365-schedule-badges {
    gap: 7px !important;
}

.mix365-schedule-badge {
    border:
        1px solid
        rgba(255,255,255,.12) !important;

    border-radius: 0 !important;

    color:
        rgba(255,255,255,.75) !important;

    background:
        rgba(255,255,255,.045) !important;

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

/* Action area */

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

    display: flex !important;
    flex-wrap: wrap;
    gap: 7px !important;

    padding:
        14px 18px 19px !important;

    border-top:
        1px solid
        rgba(255,255,255,.08);

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.015),
            rgba(0,0,0,.16)
        );
}

.mix365-schedule-edit-button,
.mix365-cd-action {
    border-radius: 0 !important;

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

/* Controlled glitch state. JS applies this briefly. */

.mix365-schedule-card.is-card-glitch {
    animation:
        mix365CardShift
        170ms steps(2, end);
}

.mix365-schedule-card.is-card-glitch
.mix365-schedule-card-content h2 {
    animation:
        mix365CardTitleGlitch
        170ms steps(2, end);
}

.mix365-schedule-card.is-card-glitch::before {
    animation:
        mix365CardOverlayGlitch
        170ms steps(2, end);
}

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

    25% {
        transform: translate(-2px,1px);
    }

    50% {
        transform: translate(2px,-1px);
    }

    75% {
        transform: translate(-1px,0);
    }

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

@keyframes mix365CardTitleGlitch {
    0% {
        text-shadow:
            2px 0 0 rgba(255,25,86,.5),
            -2px 0 0 rgba(0,226,242,.45);
        transform: translateX(0);
    }

    33% {
        text-shadow:
            5px 0 0 rgba(255,25,86,.7),
            -4px 0 0 rgba(0,226,242,.68);
        transform: translateX(-2px);
    }

    66% {
        text-shadow:
            -4px 0 0 rgba(255,25,86,.65),
            5px 0 0 rgba(0,226,242,.7);
        transform: translateX(2px);
    }

    100% {
        text-shadow:
            2px 0 0 rgba(255,25,86,.34),
            -2px 0 0 rgba(0,226,242,.3);
        transform: translateX(0);
    }
}

@keyframes mix365CardOverlayGlitch {
    0% {
        clip-path: inset(0 0 0 0);
        transform: translateX(0);
    }

    35% {
        clip-path: inset(12% 0 57% 0);
        transform: translateX(5px);
    }

    70% {
        clip-path: inset(64% 0 12% 0);
        transform: translateX(-5px);
    }

    100% {
        clip-path: inset(0 0 0 0);
        transform: translateX(0);
    }
}

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

@media (max-width: 640px) {
    .mix365-schedule-card {
        --mix365-card-cut: 14px;
    }

    .mix365-schedule-card:hover {
        transform: translateY(-2px);
    }

    .mix365-schedule-card-content h2 {
        font-size: 25px !important;
    }
}
