/*
 * From Uiverse.io by zeeshan_2112 - https://uiverse.io/zeeshan_2112/shy-rattlesnake-3
 * MIT License, Copyright (c) zeeshan_2112 (zeeshan khan)
 */

.ed-ticket-wrapper {
    --ticket-main: #1e1e24;
    --ticket-stub: #2b2b36;
    --ticket-accent: #7c3aed;
    --ticket-glow: rgb(124 58 237 / 50%);
    --ticket-text: #f8fafc;
    --ticket-muted: #a1adc0;
    --ticket-notch: 10px;
    --ticket-padding: clamp(12px, 1.55vw, 21px);
    min-width: 0;
    display: flex;
    perspective: 1000px;
}

.ed-page .ed-ticket {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    border-radius: 10px;
    color: var(--ticket-text);
    isolation: isolate;
    transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.23, 1, .32, 1), filter .6s ease;
    filter: drop-shadow(0 16px 18px rgb(0 0 0 / 55%));
}

.ed-ticket::after {
    content: '';
    position: absolute;
    z-index: 3;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 40%, rgb(255 255 255 / 10%) 45%, rgb(255 255 255 / 30%) 50%, rgb(255 255 255 / 10%) 55%, transparent 60%);
    background-size: 250% 250%;
    background-position: 100% 100%;
    transition: background-position .6s cubic-bezier(.23, 1, .32, 1);
    mix-blend-mode: overlay;
    pointer-events: none;
}

.ed-ticket-main {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: var(--ticket-padding);
    padding-bottom: calc(var(--ticket-padding) + 5px);
    border-radius: 10px 10px 0 0;
    background: var(--ticket-main);
    mask: radial-gradient(circle at bottom left, transparent var(--ticket-notch), #000 calc(var(--ticket-notch) + 1px)) left bottom / 51% 100% no-repeat,
          radial-gradient(circle at bottom right, transparent var(--ticket-notch), #000 calc(var(--ticket-notch) + 1px)) right bottom / 51% 100% no-repeat;
}

.ed-ticket-main::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgb(124 58 237 / 15%) 1px, transparent 1px),
                      linear-gradient(90deg, rgb(124 58 237 / 15%) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: .6;
    transform: perspective(500px) rotateX(20deg) scale(1.5);
    animation: ed-ticket-grid-scroll 20s linear infinite;
    pointer-events: none;
}

@keyframes ed-ticket-grid-scroll {
    from { background-position: 0 0; }
    to { background-position: 0 40px; }
}

.ed-ticket-content { position: relative; min-width: 0; width: 100%; display: flex; flex-direction: column; }
.ed-ticket-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 5px 8px; }
.ed-ticket-brand { display: inline-flex; gap: 6px; align-items: center; color: #fff; font-weight: 900; font-size: 12px; letter-spacing: -.025em; }
.ed-ticket-brand svg { fill: var(--ticket-accent); color: #ceb9ff; animation: ed-ticket-logo-pulse 3s ease-in-out infinite alternate; }

@keyframes ed-ticket-logo-pulse {
    from { filter: drop-shadow(0 0 2px var(--ticket-accent)); }
    to { filter: drop-shadow(0 0 10px var(--ticket-accent)) brightness(1.2); }
}

.ed-ticket-type {
    display: inline-block;
    padding: 3px 7px;
    border: 1px solid #9c6cff;
    border-radius: 99px;
    color: #d1b9ff;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: .08em;
    font-weight: 700;
    text-transform: uppercase;
}

.ed-ticket-cover { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; margin-block: 12px; border-radius: 5px; }

.ed-ticket-title {
    margin-block: 0 6px;
    font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    font-size: clamp(18px, 1.75vw, 25px);
    font-weight: 900;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
}

.ed-ticket-summary { padding-bottom: 15px; color: var(--ticket-muted); font-size: 13px; line-height: 1.6; }
.ed-ticket-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: auto 0 0; }
.ed-ticket-details dt { margin: 0 0 3px; color: var(--ticket-muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.ed-ticket-details dd { margin: 0; font-size: 12px; font-weight: 700; line-height: 1.3; }

.ed-ticket-perforation { position: absolute; inset: auto var(--ticket-padding) 0; }
.ed-ticket-perforation span { display: block; border-top: 2px dashed rgb(255 255 255 / 20%); }

.ed-ticket-stub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 13px var(--ticket-padding);
    border-radius: 0 0 10px 10px;
    background: var(--ticket-stub);
    mask: radial-gradient(circle at top left, transparent var(--ticket-notch), #000 calc(var(--ticket-notch) + 1px)) left top / 51% 100% no-repeat,
          radial-gradient(circle at top right, transparent var(--ticket-notch), #000 calc(var(--ticket-notch) + 1px)) right top / 51% 100% no-repeat;
    transition: transform .2s ease, opacity .2s ease;
}

.ed-ticket-barcode {
    display: block;
    width: min(100px, 42%);
    height: 24px;
    background: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 4px, #fff 4px 5px, transparent 5px 8px, #fff 8px 12px, transparent 12px 15px, #fff 15px 16px, transparent 16px 18px);
    opacity: .8;
}

.ed-ticket-read { display: flex; align-items: center; gap: 5px; color: #d1b9ff; font-size: 12px; font-weight: 750; }
.ed-ticket-read svg { width: 24px; height: 24px; color: #b789ff; filter: drop-shadow(0 0 8px var(--ticket-glow)); }

@media (hover: hover) and (pointer: fine) {
    .ed-ticket-wrapper:hover .ed-ticket {
        transform: rotateX(5deg) rotateY(-10deg) scale(1.02);
        filter: drop-shadow(12px 14px 18px rgb(0 0 0 / 64%)) drop-shadow(-4px -4px 12px var(--ticket-glow));
    }
    .ed-ticket-wrapper:hover .ed-ticket::after { background-position: 0 0; }
}
.ed-ticket-wrapper .ed-ticket:active { transform: rotateX(15deg) rotateY(-5deg) scale(.98); }
.ed-ticket:active .ed-ticket-stub { transform: translateY(5px) rotateZ(2deg); opacity: .8; }

@media (prefers-reduced-motion: reduce) {
    .ed-page .ed-ticket, .ed-ticket::after, .ed-ticket .ed-ticket-stub { transition: none; }
    .ed-ticket-main::before, .ed-ticket-brand svg { animation: none; }
    .ed-page .ed-ticket:is(:hover, :active), .ed-page .ed-ticket:active .ed-ticket-stub { transform: none; }
}
@media (forced-colors: active) {
    .ed-ticket-title { background: none; color: LinkText; }
    .ed-ticket { outline: 1px solid CanvasText; }
}
