/* ============================================================
   Everything Dancing — Event Editor Dance Styles Step
   File: css/step-dance-styles.css
   Unified Editor Design System
============================================================ */

.w2d-card.w2d-style-step,
.w2d-card.w2d-style-step * {
    box-sizing: border-box;
}

.w2d-card.w2d-style-step {
    --w2d-purple: var(--ed-primary, #7C4DFF);
    --w2d-purple-dark: var(--ed-primary, #7C4DFF);
    --w2d-purple-soft: rgb(var(--ed-primary-rgb, 124 77 255) / 0.12);
    --w2d-text: var(--ed-text-main, #151515);
    --w2d-muted: var(--ed-text-muted, #98A1B3);
    --w2d-border: var(--ed-border-light, #E8E8EF);
    --w2d-shadow: 0 18px 45px rgb(var(--ed-bg-dark-rgb, 11 16 32) / 0.08);
    --w2d-shadow-soft: 0 10px 28px rgb(var(--ed-bg-dark-rgb, 11 16 32) / 0.06);

    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px !important;
    border-radius: 30px !important;
    border: 1px solid var(--w2d-border) !important;
    background: var(--ed-surface-light, #FFFFFF) !important;
    box-shadow: var(--w2d-shadow) !important;
    color: var(--w2d-text);
    overflow: visible;
}

/* ------------------------------------------------------------
   Header / Typography
------------------------------------------------------------ */

.w2d-card.w2d-style-step .w2d-style-step__eyebrow,
.w2d-card.w2d-style-step .w2d-dates-eyebrow {
    margin: 0 0 8px !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
    color: var(--w2d-purple) !important;
}

.w2d-card.w2d-style-step h1,
.w2d-card.w2d-style-step h2,
.w2d-card.w2d-style-step h3.w2d-style-step__title,
.w2d-card.w2d-style-step .w2d-style-step__title,
.w2d-card.w2d-style-step .w2d-dates-h {
    margin: 0 !important;
    font-size: clamp(30px, 4vw, 44px) !important;
    line-height: 1.05 !important;
    letter-spacing: 0 !important;
    font-weight: 950 !important;
    color: var(--w2d-text) !important;
}

.w2d-card.w2d-style-step .w2d-style-step__intro,
.w2d-card.w2d-style-step .w2d-muted {
    margin: 10px 0 0 !important;
    max-width: 760px;
    color: var(--w2d-muted) !important;
    font-size: 16px !important;
    line-height: 1.65 !important;
    opacity: 1 !important;
}

/* ------------------------------------------------------------
   Search
------------------------------------------------------------ */

.w2d-card.w2d-style-step .w2d-style-search-inline {
    margin-top: 26px;
    position: relative;
}

.w2d-card.w2d-style-step .w2d-style-search {
    margin: 0;
    position: relative;
}

.w2d-card.w2d-style-step .w2d-style-search-inline span,
.w2d-card.w2d-style-step .w2d-style-search span {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .52;
    pointer-events: none;
    font-size: 15px;
}

.w2d-card.w2d-style-step .w2d-style-search-inline input,
.w2d-card.w2d-style-step .w2d-style-search input {
    width: 100%;
    min-height: 56px;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, .10);
    background: #FFFFFF;
    padding: 0 18px 0 48px;
    font-size: 14px;
    font-weight: 850;
    color: var(--w2d-text);
    outline: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.w2d-card.w2d-style-step .w2d-style-search-inline input:focus,
.w2d-card.w2d-style-step .w2d-style-search input:focus {
    border-color: rgba(124, 58, 237, .34);
    box-shadow:
        0 0 0 4px rgba(124, 58, 237, .08),
        0 10px 24px rgba(15, 23, 42, .05);
}

/* ------------------------------------------------------------
   Category folders
------------------------------------------------------------ */

.w2d-card.w2d-style-step .w2d-style-folders {
    margin-top: 24px;
}

.w2d-card.w2d-style-step .w2d-style-folder-head {
    margin-top: 26px;
}

.w2d-card.w2d-style-step .w2d-style-folder-head h4,
.w2d-card.w2d-style-step .w2d-style-search-results__head strong {
    margin: 0;
    font-size: 21px;
    font-weight: 950;
    letter-spacing: -.03em;
    color: var(--w2d-text);
}

.w2d-card.w2d-style-step .w2d-style-folder-head p {
    margin: 8px 0 0;
    color: var(--w2d-muted);
    font-size: 15px;
    line-height: 1.55;
}

.w2d-card.w2d-style-step .w2d-style-folder-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.w2d-card.w2d-style-step .w2d-style-folder {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 140px;
    padding: 0;
    border-radius: 28px;
    border: 1px solid rgba(17, 24, 39, .08);
    background: #FFFFFF;
    color: var(--w2d-text);
    cursor: pointer;
    text-align: left;
    box-shadow: var(--w2d-shadow-soft);
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.w2d-card.w2d-style-step .w2d-style-folder:hover,
.w2d-card.w2d-style-step .w2d-style-folder:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(124, 58, 237, .24);
    box-shadow:
        0 20px 40px rgba(15, 23, 42, .10),
        0 0 0 4px rgba(124, 58, 237, .05);
    outline: none;
}

.w2d-card.w2d-style-step .w2d-style-folder.is-highlighted {
    border-color: rgba(124, 58, 237, .42);
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, .12), transparent 44%),
        rgba(250, 245, 255, .96);
}

.w2d-card.w2d-style-step .w2d-style-folder__image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(15, 23, 42, .04);
}

.w2d-card.w2d-style-step .w2d-style-folder__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease, filter .35s ease;
}

.w2d-card.w2d-style-step .w2d-style-folder:hover .w2d-style-folder__image img {
    transform: scale(1.04);
}

.w2d-card.w2d-style-step .w2d-style-folder__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px 18px 18px;
    text-align: left;
    min-width: 0;
}

.w2d-card.w2d-style-step .w2d-style-folder__body strong {
    display: block;
    font-size: 18px;
    font-weight: 950;
    line-height: 1.15;
    letter-spacing: -.03em;
    color: var(--w2d-text);
}

.w2d-card.w2d-style-step .w2d-style-folder__body small {
    color: var(--w2d-muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
}

.w2d-card.w2d-style-step .w2d-style-folder__icon {
    width: 74px;
    height: 74px;
    margin: 20px auto 0;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, .18), rgba(124, 58, 237, .08));
    color: #7C4DFF;
    font-size: 26px;
    font-weight: 900;
}

/* ------------------------------------------------------------
   Search results
------------------------------------------------------------ */

.w2d-card.w2d-style-step .w2d-style-search-results {
    margin-top: 18px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(124, 58, 237, .14);
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, .06), transparent 40%),
        rgba(250, 245, 255, .62);
    box-shadow: var(--w2d-shadow-soft);
}

.w2d-card.w2d-style-step .w2d-style-search-results__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.w2d-card.w2d-style-step .w2d-style-search-results__head span {
    color: rgba(17, 24, 39, .55);
    font-size: 12px;
    font-weight: 850;
}

.w2d-card.w2d-style-step .w2d-style-search-results__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.w2d-card.w2d-style-step .w2d-style-search-result {
    appearance: none;
    -webkit-appearance: none;
    min-height: 64px;
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(17, 24, 39, .08);
    background: #FFFFFF;
    text-align: left;
    cursor: pointer;
    display: grid;
    gap: 4px;
    box-shadow: var(--w2d-shadow-soft);
    transition:
        transform .14s ease,
        box-shadow .14s ease,
        border-color .14s ease,
        background .14s ease;
}

.w2d-card.w2d-style-step .w2d-style-search-result:hover {
    transform: translateY(-1px);
}

.w2d-card.w2d-style-step .w2d-style-search-result strong {
    color: var(--w2d-text);
    font-size: 15px;
    font-weight: 950;
    letter-spacing: -.02em;
}

.w2d-card.w2d-style-step .w2d-style-search-result span {
    color: var(--w2d-muted);
    font-size: 12px;
    font-weight: 800;
}

.w2d-card.w2d-style-step .w2d-style-search-result.is-selected {
    border-color: rgba(124, 58, 237, .36);
    background: rgba(124, 58, 237, .10);
}

/* ------------------------------------------------------------
   Selected styles
------------------------------------------------------------ */

.w2d-card.w2d-style-step .w2d-style-selected {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 68px;
    padding: 18px;
    border-radius: 24px;
    border: 1px dashed rgba(17, 24, 39, .14);
    background: rgba(248, 250, 252, .9);
}

.w2d-card.w2d-style-step .w2d-style-selected::before {
    content: "Selected styles";
    flex-basis: 100%;
    font-size: 13px;
    font-weight: 950;
    color: rgba(17, 24, 39, .76);
    margin-bottom: 4px;
    letter-spacing: .02em;
}

.w2d-card.w2d-style-step .w2d-style-selected__empty {
    color: rgba(17, 24, 39, .54);
    font-size: 14px;
    font-weight: 800;
}

.w2d-card.w2d-style-step .w2d-style-pill,
.w2d-card.w2d-style-step .w2d-style-chip {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(17, 24, 39, .08);
    background: rgba(255, 255, 255, .88);
    color: rgba(17, 24, 39, .78);
    border-radius: 999px;
    min-height: 42px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(15, 23, 42, .05);
    transition:
        transform .14s ease,
        box-shadow .14s ease,
        border-color .14s ease,
        background .14s ease,
        color .14s ease;
}

.w2d-card.w2d-style-step .w2d-style-pill:hover,
.w2d-card.w2d-style-step .w2d-style-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
}

.w2d-card.w2d-style-step .w2d-style-pill.is-selected,
.w2d-card.w2d-style-step .w2d-style-chip.is-selected {
    border-color: rgba(124, 58, 237, .38);
    background:
        linear-gradient(135deg, rgba(124, 58, 237, .14), rgba(236, 72, 153, .08));
    color: var(--w2d-purple-dark);
    box-shadow:
        inset 0 0 0 1px rgba(124, 58, 237, .22),
        0 8px 16px rgba(15, 23, 42, .05);
}

.w2d-card.w2d-style-step .w2d-style-hidden-inputs,
.w2d-card.w2d-style-step .w2d-style-summary {
    display: none !important;
}

/* ------------------------------------------------------------
   Panel / modal
------------------------------------------------------------ */

body.w2d-style-panel-open {
    overflow: hidden;
}

.w2d-style-panel {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

.w2d-style-panel.is-open {
    opacity: 1;
    pointer-events: auto;
}

.w2d-style-panel__overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .56);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity .22s ease;
}

.w2d-style-panel.is-open .w2d-style-panel__overlay {
    opacity: 1;
}

.w2d-style-panel__sheet {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(760px, calc(100vw - 28px));
    max-height: min(780px, calc(100vh - 28px));
    max-height: min(780px, calc(100dvh - 28px));
    transform: translate(-50%, -48%) scale(.98);
    opacity: 0;
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 30px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    transition:
        transform .24s cubic-bezier(.22, 1, .36, 1),
        opacity .18s ease;
}

.w2d-style-panel.is-open .w2d-style-panel__sheet {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.w2d-style-panel__head {
    padding: 22px 24px 16px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    border-bottom: 1px solid rgba(15, 23, 42, .07);
}

.w2d-style-panel__eyebrow {
    margin: 0 0 6px !important;
    font-size: 11px !important;
    font-weight: 950 !important;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(124, 58, 237, .72) !important;
}

.w2d-style-panel__head h3 {
    margin: 0;
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.05;
    letter-spacing: -.05em;
    font-weight: 950;
}

.w2d-style-panel__head p {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(17, 24, 39, .58);
    font-weight: 850;
}

.w2d-style-panel__close {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 44px;
    border-radius: 999px !important;
    border: 1px solid rgba(15, 23, 42, .10);
    background: #FFFFFF;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: rgba(17, 24, 39, .78);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        background .16s ease,
        border-color .16s ease;
}

.w2d-style-panel__close:hover,
.w2d-style-panel__close:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(124, 58, 237, .22);
    background: rgba(124, 58, 237, .08);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .12);
}

.w2d-style-panel__tools {
    padding: 16px 24px 0;
    display: grid;
    gap: 10px;
}

.w2d-style-panel__quick {
    display: flex;
    justify-content: flex-end;
}

.w2d-style-panel__quick button {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    color: rgba(124, 58, 237, .9);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.w2d-style-category-panels {
    min-height: 0;
    overflow: auto;
    padding: 20px 24px;
}

.w2d-style-category-panel {
    display: none;
}

.w2d-style-category-panel.is-active {
    display: block;
}

.w2d-style-chipgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.w2d-style-chip {
    position: relative;
    min-height: 66px;
    border-radius: 999px;
    padding: 14px 58px 14px 26px;
    background: transparent;
    display: grid;
    align-content: center;
    justify-items: start;
    text-align: left;
}

.w2d-style-chip.is-selected {
    border-color: rgba(124, 58, 237, .42);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(124, 58, 237, .14), rgba(236, 72, 153, .08));
    color: var(--w2d-purple-dark, #5b21b6);
    box-shadow:
        inset 0 0 0 1px rgba(124, 58, 237, .20),
        0 10px 24px rgba(124, 58, 237, .10);
}

.w2d-style-chip.is-selected::after {
    content: "✓";
    position: absolute;
    right: 18px;
    top: 50%;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #ffffff;
    font-size: 13px;
    font-weight: 950;
    transform: translateY(-50%);
    box-shadow: 0 8px 16px rgba(124, 58, 237, .20);
}

.w2d-style-chip span {
    font-size: 15px;
    font-weight: 950;
    letter-spacing: -.02em;
}

.w2d-style-chip small {
    margin-top: 4px;
    color: rgba(17, 24, 39, .52);
    font-size: 12px;
    font-weight: 800;
}

.w2d-style-panel__foot {
    border-top: 1px solid rgba(15, 23, 42, .07);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    background: rgba(248, 250, 252, .92);
}

.w2d-style-panel__selected {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 84px;
    overflow: auto;
}

.w2d-style-panel__selected span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(124, 58, 237, .10);
    color: #7C4DFF;
    font-size: 12px;
    font-weight: 850;
}

.is-hidden {
    display: none !important;
}

.w2d-card.w2d-style-step .w2d-actions {
    margin-top: 22px;
}

/* ------------------------------------------------------------
   Responsive
------------------------------------------------------------ */

@media (max-width: 980px) {
    .w2d-card.w2d-style-step .w2d-style-folder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 819px) {
    .w2d-card.w2d-style-step {
        padding: 20px !important;
        border-radius: 26px !important;
    }

    .w2d-card.w2d-style-step h1,
    .w2d-card.w2d-style-step h2,
    .w2d-card.w2d-style-step h3.w2d-style-step__title,
    .w2d-card.w2d-style-step .w2d-style-step__title,
    .w2d-card.w2d-style-step .w2d-dates-h {
        font-size: 34px !important;
    }

    .w2d-card.w2d-style-step .w2d-style-folder-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .w2d-card.w2d-style-step .w2d-style-folder {
        min-height: auto;
    }

    .w2d-card.w2d-style-step .w2d-style-folder__image {
        aspect-ratio: 16 / 8;
    }

    .w2d-card.w2d-style-step .w2d-style-search-results__list,
    .w2d-style-chipgrid {
        grid-template-columns: 1fr;
    }

    .w2d-style-panel__sheet {
        position: absolute;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 82vh;
        height: 82dvh;
        max-height: 82vh;
        max-height: 82dvh;
        border-radius: 30px 30px 0 0;
        transform: translate3d(0, 105%, 0);
        opacity: 1;
        transition: transform .28s cubic-bezier(.22, 1, .36, 1);
        will-change: transform;
    }

    .w2d-style-panel.is-open .w2d-style-panel__sheet {
        transform: translate3d(0, 0, 0);
    }

    .w2d-style-category-panels {
        max-height: none;
        padding: 18px;
    }

    .w2d-style-panel__head,
    .w2d-style-panel__tools,
    .w2d-style-panel__foot {
        padding-left: 18px;
        padding-right: 18px;
    }

    .w2d-style-panel__foot {
        align-items: stretch;
        flex-direction: column;
    }

    .w2d-style-panel__foot .w2d-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 620px) {
    .w2d-card.w2d-style-step {
        padding: 16px !important;
    }

    .w2d-card.w2d-style-step h1,
    .w2d-card.w2d-style-step h2,
    .w2d-card.w2d-style-step h3.w2d-style-step__title,
    .w2d-card.w2d-style-step .w2d-style-step__title,
    .w2d-card.w2d-style-step .w2d-dates-h {
        font-size: 30px !important;
    }

    .w2d-style-panel__sheet {
        height: 84vh;
        height: 84dvh;
        max-height: 84vh;
        max-height: 84dvh;
    }

    .w2d-style-panel__head h3 {
        font-size: 22px;
    }
}

/* Dark mode depth: dance style picker sheet */

html[data-ed-theme="dark"] .w2d-event-wrap :where(
    .w2d-style-panel__sheet,
    .w2d-style-panel__head,
    .w2d-style-panel__tools,
    .w2d-style-panel__foot,
    .w2d-style-category-panel,
    .w2d-style-panel__selected,
    .w2d-style-folder,
    .w2d-style-chip,
    .w2d-style-search-results
) {
    border-color: var(--ed-border, #30364D) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
        var(--ed-surface, #1B1E2D) !important;
    color: var(--ed-text, #F6F7FB) !important;
}

html[data-ed-theme="dark"] .w2d-event-wrap .w2d-style-panel__sheet {
    border-color: var(--ed-border-strong, #414865) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
        var(--ed-sheet, #252A3D) !important;
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.46),
        0 0 0 1px rgba(255, 255, 255, 0.035),
        0 0 36px rgb(var(--ed-primary-dark-rgb, 167 139 250) / 0.10) !important;
}

html[data-ed-theme="dark"] .w2d-event-wrap :where(.w2d-style-panel__head, .w2d-style-panel__foot) {
    border-color: var(--ed-border, #30364D) !important;
    background: var(--ed-sheet-raised, #2B3046) !important;
}

html[data-ed-theme="dark"] .w2d-event-wrap :where(.w2d-style-chip.is-selected, .w2d-style-folder.is-selected, .w2d-style-panel__quick button.is-active) {
    border-color: rgb(var(--ed-primary-dark-rgb, 167 139 250) / 0.42) !important;
    background: rgb(var(--ed-primary-dark-rgb, 167 139 250) / 0.16) !important;
    color: var(--ed-primary-live, #A78BFA) !important;
}
