/*
 * Unity VIP — Overworld / Qode integration
 *
 * Designed to sit naturally inside an Edge-Themes / Qode single-product
 * WooCommerce form: compact, typography-led, minimal radius, no oversized
 * cards or floating dashboard styling.
 */

.unity-vip-duration-selector {
    --unity-vip-accent: #8b2de2;
    --unity-vip-accent-strong: #6f19bd;
    --unity-vip-accent-soft: rgba(139, 45, 226, 0.08);
    --unity-vip-accent-line: rgba(139, 45, 226, 0.42);
    --unity-vip-red: #e84b63;
    --unity-vip-text: inherit;
    --unity-vip-muted: rgba(60, 60, 60, 0.52);
    --unity-vip-border: rgba(20, 20, 20, 0.16);
    --unity-vip-border-hover: rgba(20, 20, 20, 0.32);
    --unity-vip-surface: transparent;
    --unity-vip-menu-surface: #ffffff;
    --unity-vip-option-hover: rgba(139, 45, 226, 0.055);

    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px;
    padding: 0;
    z-index: 100;
}

.unity-vip-duration-selector,
.unity-vip-duration-selector * {
    box-sizing: border-box;
}

.unity-vip-duration-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 8px;
}

.unity-vip-duration-label {
    display: inline-block;
    margin: 0;
    padding: 0;
    color: var(--unity-vip-text);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.unity-vip-duration-required {
    color: var(--unity-vip-accent);
    font-size: 12px;
    line-height: 1;
}

.unity-vip-duration-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.unity-vip-select {
    position: relative;
    width: 100%;
}

.unity-vip-select-trigger {
    position: relative;
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 0 14px 0 16px;
    border: 1px solid var(--unity-vip-border);
    border-radius: 2px;
    background: var(--unity-vip-surface);
    color: var(--unity-vip-text);
    box-shadow: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.unity-vip-select-trigger::before {
    content: '';
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: -1px;
    width: 2px;
    background: transparent;
    transition: background 180ms ease;
}

.unity-vip-select-trigger:hover,
.unity-vip-select.is-open .unity-vip-select-trigger {
    border-color: var(--unity-vip-border-hover);
    background: var(--unity-vip-option-hover);
}

.unity-vip-select-trigger:hover::before,
.unity-vip-select.is-open .unity-vip-select-trigger::before {
    background: linear-gradient(180deg, var(--unity-vip-accent), var(--unity-vip-red));
}

.unity-vip-select-trigger:focus-visible {
    outline: 0;
    border-color: var(--unity-vip-accent);
    box-shadow: 0 0 0 2px rgba(139, 45, 226, 0.11);
}

/* The outer/closed selector always shows which value is currently selected. */
.unity-vip-select.has-selection .unity-vip-select-trigger {
    border-color: rgba(139, 45, 226, 0.42);
}

.unity-vip-select.has-selection .unity-vip-select-trigger::before {
    background: linear-gradient(180deg, var(--unity-vip-accent), var(--unity-vip-red));
}

.unity-vip-select.has-selection .unity-vip-select-value {
    color: var(--unity-vip-text);
}

.unity-vip-select.has-selection .unity-vip-select-chevron {
    color: var(--unity-vip-accent);
}

.unity-vip-select-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.unity-vip-select-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(139, 45, 226, 0.26);
    border-radius: 50%;
    background: var(--unity-vip-accent-soft);
    color: var(--unity-vip-accent);
}

.unity-vip-select-icon-star {
    margin-top: -1px;
    font-size: 10px;
    line-height: 1;
}

.unity-vip-select-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.unity-vip-select-value {
    overflow: hidden;
    color: var(--unity-vip-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Keep the duration helper text bright on Overworld/Qode themes. */
.unity-vip-select-subtext {
    color: #eeeeee !important;
    opacity: 1 !important;
}

.unity-vip-option-meta {
    color: #9f96a8 !important;
    opacity: 1 !important;
}

.unity-vip-select-subtext {
    margin-top: 2px;
    overflow: hidden;
    color: #eeeeee !important;
    opacity: 1 !important;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.unity-vip-select-end {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
    margin-left: auto;
}

.unity-vip-select-price,
.unity-vip-select-price .woocommerce-Price-amount {
    color: var(--unity-vip-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.unity-vip-select-price:not(:empty)::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 10px 3px 10px;
    border-radius: 50%;
    background: var(--unity-vip-accent);
}

.unity-vip-select-price:empty {
    display: none;
}

.unity-vip-select-chevron {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    color: var(--unity-vip-muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 180ms ease, color 180ms ease;
}

.unity-vip-select.is-open .unity-vip-select-chevron {
    color: var(--unity-vip-accent);
    transform: rotate(225deg) translate(-1px, -2px);
}

.unity-vip-select-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    max-height: 310px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--unity-vip-border-hover);
    border-radius: 2px;
    background: var(--unity-vip-menu-surface);
    box-shadow: 0 14px 35px rgba(20, 10, 30, 0.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transform-origin: top center;
    transition: opacity 140ms ease, visibility 140ms ease, transform 140ms ease;
}

.unity-vip-select.is-open .unity-vip-select-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.unity-vip-select-option {
    position: relative;
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 8px 12px 8px 14px;
    border: 0;
    border-radius: 1px;
    background: transparent;
    color: var(--unity-vip-text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 130ms ease, color 130ms ease;
}

.unity-vip-select-option::before {
    content: '';
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 2px;
    background: transparent;
}

.unity-vip-select-option:hover,
.unity-vip-select-option:focus-visible,
.unity-vip-select-option.is-selected {
    outline: none;
    background: var(--unity-vip-option-hover);
}

.unity-vip-select-option.is-selected::before {
    background: linear-gradient(180deg, var(--unity-vip-accent), var(--unity-vip-red));
}

.unity-vip-option-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.unity-vip-option-check {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(40, 40, 40, 0.18);
    border-radius: 50%;
    background: transparent;
    color: transparent;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}

.unity-vip-select-option.is-selected .unity-vip-option-check {
    border-color: var(--unity-vip-accent);
    background: var(--unity-vip-accent);
    color: #fff;
}

.unity-vip-option-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.unity-vip-option-title {
    overflow: hidden;
    color: var(--unity-vip-text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unity-vip-option-meta {
    margin-top: 2px;
    overflow: hidden;
    color: #9f96a8 !important;
    opacity: 1 !important;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.unity-vip-option-price,
.unity-vip-option-price .woocommerce-Price-amount {
    flex: 0 0 auto;
    color: var(--unity-vip-text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.unity-vip-select-option.is-selected .unity-vip-option-price,
.unity-vip-select-option.is-selected .unity-vip-option-price .woocommerce-Price-amount {
    color: var(--unity-vip-accent);
}

.unity-vip-option-price-empty {
    color: var(--unity-vip-muted);
    font-size: 10px;
    font-weight: 600;
}

.unity-vip-duration-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 8px 0 0;
    color: #eeeeee !important;
    opacity: 1 !important;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.5;
}

.unity-vip-note-dot {
    width: 4px;
    height: 4px;
    flex: 0 0 4px;
    border-radius: 50%;
    background: var(--unity-vip-accent);
}

/*
 * Overworld uses bold, dark, purple/red gaming styling. These overrides are
 * intentionally conservative: inherit the theme typography and form width.
 * The theme is documented as purple/red with a dark, bold esports visual
 * language and WooCommerce support.
 */
.unity-vip-duration-selector--overworld {
    width: 100%;
    max-width: 100%;
}

.woocommerce div.product form.cart .unity-vip-duration-selector--overworld,
.woocommerce div.product form.cart .unity-vip-duration-selector--overworld .unity-vip-select {
    width: 100%;
}

@media (prefers-color-scheme: dark) {
    .unity-vip-duration-selector {
        --unity-vip-muted: rgba(255, 255, 255, 0.72);
        --unity-vip-border: rgba(255, 255, 255, 0.16);
        --unity-vip-border-hover: rgba(255, 255, 255, 0.34);
        --unity-vip-menu-surface: #15121b;
        --unity-vip-option-hover: rgba(139, 45, 226, 0.12);
    }

    .unity-vip-option-check {
        border-color: rgba(255, 255, 255, 0.2);
    }
}

@media (max-width: 767px) {
    .unity-vip-duration-selector {
        margin-bottom: 16px;
    }

    .unity-vip-select-trigger {
        min-height: 54px;
        padding-left: 13px;
        padding-right: 12px;
        gap: 12px;
    }

    .unity-vip-select-icon {
        width: 23px;
        height: 23px;
        flex-basis: 23px;
    }

    .unity-vip-select-main {
        gap: 9px;
    }

    .unity-vip-select-value {
        font-size: 12px;
    }

    .unity-vip-select-subtext,
    .unity-vip-option-meta {
        font-size: 9px;
    }

    .unity-vip-select-end {
        gap: 8px;
    }

    .unity-vip-select-price,
    .unity-vip-select-price .woocommerce-Price-amount {
        font-size: 12px;
    }

    .unity-vip-select-price:not(:empty)::after {
        margin-left: 7px;
        margin-right: 7px;
    }
}

@media (max-width: 420px) {
    .unity-vip-select-price:not(:empty)::after {
        display: none;
    }

    .unity-vip-select-trigger {
        padding-right: 10px;
    }

    .unity-vip-select-end {
        gap: 7px;
    }

    .unity-vip-select-price,
    .unity-vip-select-price .woocommerce-Price-amount {
        font-size: 11px;
    }
}

/* Server selector uses the exact same visual treatment as the VIP duration selector. */
.unity-vip-field-group + .unity-vip-field-group {
    margin-top: 14px;
}

.unity-vip-server-selector {
    width: 100%;
}

.unity-vip-server-selector .unity-vip-select,
.unity-vip-server-selector .unity-vip-select-trigger,
.unity-vip-server-selector .unity-vip-select-menu {
    width: 100%;
}

.unity-vip-server-selector .unity-vip-select-trigger {
    min-height: 58px;
}

.unity-vip-server-selector .unity-vip-select-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border-radius: 50%;
}

.unity-vip-server-selector .unity-vip-select-icon-star {
    margin-top: -1px;
    font-size: 10px;
    line-height: 1;
    transform: none;
}

.unity-vip-server-selector .unity-vip-select-subtext,
.unity-vip-server-selector .unity-vip-option-meta {
    color: #9f96a8 !important;
    opacity: 1 !important;
}

/* Keep the open server list cleanly above the next WooCommerce field. */
.unity-vip-server-selector .unity-vip-select-menu {
    z-index: 10050;
}
