/**
 * SWADS Tron surfaces — panels & form fields (canonical Jul 2026)
 * Loaded globally from partials/head after variables.css.
 * See DEVELOPMENT_RULES.md §5 — Tron Theme panels & inputs.
 *
 * Skips wedding-theme and light theme. Does not restyle checkboxes,
 * radios, ranges, file inputs, or color pickers.
 */

/* —— Panels —— */
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .ui-card,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .glass-card,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .form-section,
.dark-theme .ui-card,
.dark-theme .glass-card,
.dark-theme .form-section,
body.games-tron .ui-card,
body.games-tron .glass-card,
body.games-tron .form-section {
    background:
        radial-gradient(ellipse 55% 50% at 12% 0%, rgba(255, 255, 255, 0.08) 0%, transparent 55%),
        rgba(0, 0, 0, 0.55) !important;
    border: 1px solid rgba(255, 107, 0, 0.35) !important;
    border-radius: 16px !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(255, 107, 0, 0.12),
        0 12px 28px rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* —— Text-like fields —— */
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="color"]),
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) textarea,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) select,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .form-input-glass,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .field-input,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .form-control,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .games-tron-input,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .games-tron-select,
.dark-theme input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="color"]),
.dark-theme textarea,
.dark-theme select,
.dark-theme .form-input-glass,
.dark-theme .field-input,
.dark-theme .form-control,
body.games-tron input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="color"]),
body.games-tron textarea,
body.games-tron select,
body.games-tron .form-input-glass,
body.games-tron .field-input,
body.games-tron .form-control,
body.games-tron .games-tron-input,
body.games-tron .games-tron-select {
    background: rgba(255, 255, 255, 0.075) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    color-scheme: dark;
    border-radius: 12px !important;
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Native <select> popup (especially desktop): closed field uses white text but the OS
   list is often light — inherited color makes options invisible until hover. */
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) select,
.dark-theme select,
body.games-tron select {
    color-scheme: dark;
}

html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) select option,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) select optgroup,
.dark-theme select option,
.dark-theme select optgroup,
body.games-tron select option,
body.games-tron select optgroup {
    background-color: #ffffff !important;
    color: #111111 !important;
}

html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) select option:checked,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) select option:hover,
.dark-theme select option:checked,
.dark-theme select option:hover,
body.games-tron select option:checked,
body.games-tron select option:hover {
    background-color: #ffe0b2 !important;
    color: #111111 !important;
}

html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="color"]):focus,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) textarea:focus,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) select:focus,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .form-input-glass:focus,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .field-input:focus,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .form-control:focus,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .games-tron-input:focus,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .games-tron-select:focus,
.dark-theme input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="color"]):focus,
.dark-theme textarea:focus,
.dark-theme select:focus,
.dark-theme .form-input-glass:focus,
.dark-theme .field-input:focus,
.dark-theme .form-control:focus,
body.games-tron input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="color"]):focus,
body.games-tron textarea:focus,
body.games-tron select:focus,
body.games-tron .form-input-glass:focus,
body.games-tron .field-input:focus,
body.games-tron .form-control:focus,
body.games-tron .games-tron-input:focus,
body.games-tron .games-tron-select:focus {
    outline: none !important;
    border-color: rgba(255, 107, 0, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.2), 0 0 14px rgba(255, 107, 0, 0.14) !important;
}

html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) input::placeholder,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) textarea::placeholder,
.dark-theme input::placeholder,
.dark-theme textarea::placeholder,
body.games-tron input::placeholder,
body.games-tron textarea::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
}

/* Readonly / muted fields stay quieter */
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) input[readonly],
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .form-input-readonly,
.dark-theme input[readonly],
.dark-theme .form-input-readonly,
body.games-tron input[readonly],
body.games-tron .form-input-readonly {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

/* Labels — soft orange when using common form label classes */
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .form-label,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .field-label,
html:not(.wedding-theme) body:not(.wedding-theme):not([data-theme="light"]) .games-tron-label,
.dark-theme .form-label,
.dark-theme .field-label,
body.games-tron .form-label,
body.games-tron .field-label,
body.games-tron .games-tron-label {
    color: rgba(255, 183, 125, 0.85) !important;
}

/* QR / print / light paper exceptions — leave white QR wrappers alone */
.share-qr-wrap {
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}

/* —— Tron orb chrome CTA ——
 * Named effect: black 3D chrome + orange glow pulse + shine sweep.
 * Canonical refs: Explore browse-mode pills, floating cart, checkout CTAs.
 */
@keyframes tron-orb-chrome-throb {
    0%, 100% {
        box-shadow:
            inset 0 -8px 16px rgba(0, 0, 0, 0.7),
            inset 0 5px 10px rgba(255, 255, 255, 0.08),
            inset 0 0 0 1px rgba(255, 255, 255, 0.08),
            0 0 0 1px rgba(255, 107, 0, 0.35),
            0 6px 16px rgba(0, 0, 0, 0.45),
            0 0 14px rgba(255, 107, 0, 0.28),
            0 0 28px rgba(255, 107, 0, 0.12);
    }
    50% {
        box-shadow:
            inset 0 -8px 16px rgba(0, 0, 0, 0.7),
            inset 0 5px 10px rgba(255, 255, 255, 0.08),
            inset 0 0 0 1px rgba(255, 255, 255, 0.08),
            0 0 0 1px rgba(255, 107, 0, 0.55),
            0 6px 16px rgba(0, 0, 0, 0.45),
            0 0 22px rgba(255, 107, 0, 0.42),
            0 0 40px rgba(255, 107, 0, 0.2);
    }
}

@keyframes tron-orb-chrome-glow {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

@keyframes tron-orb-chrome-glisten {
    0% { transform: translateX(-130%) skewX(-12deg); opacity: 0; }
    12% { opacity: 0.85; }
    45% { transform: translateX(130%) skewX(-12deg); opacity: 0; }
    100% { transform: translateX(130%) skewX(-12deg); opacity: 0; }
}

.tron-orb-chrome-btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 107, 0, 0.55);
    color: #fff;
    font-family: inherit;
    font-weight: 900;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
    background:
        radial-gradient(ellipse 42% 55% at 28% 22%, rgba(255, 255, 255, 0.28) 0%, transparent 58%),
        radial-gradient(circle at 50% 110%, rgba(0, 0, 0, 0.85) 0%, transparent 55%),
        radial-gradient(circle at 50% 48%, #2c2c2c 0%, #161616 45%, #070707 100%);
    box-shadow:
        inset 0 -8px 16px rgba(0, 0, 0, 0.7),
        inset 0 5px 10px rgba(255, 255, 255, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(255, 107, 0, 0.4),
        0 6px 16px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(255, 107, 0, 0.35),
        0 0 32px rgba(255, 107, 0, 0.16);
    animation: tron-orb-chrome-throb 2.6s ease-in-out infinite;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.tron-orb-chrome-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.tron-orb-chrome-btn:disabled {
    opacity: 0.65;
    cursor: wait;
    animation: none;
}

.tron-orb-chrome-btn:disabled::before,
.tron-orb-chrome-btn:disabled .tron-orb-chrome-btn__shine::after {
    animation: none;
}

.tron-orb-chrome-btn::before {
    content: '';
    position: absolute;
    inset: -35% -8% -55%;
    border-radius: inherit;
    background: radial-gradient(
        ellipse 70% 80% at 50% 55%,
        rgba(255, 107, 0, 0.45) 0%,
        rgba(255, 107, 0, 0.12) 42%,
        transparent 70%
    );
    filter: blur(2px);
    z-index: -1;
    pointer-events: none;
    animation: tron-orb-chrome-glow 2.6s ease-in-out infinite;
}

.tron-orb-chrome-btn__shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.tron-orb-chrome-btn__shine::after {
    content: '';
    position: absolute;
    top: -20%;
    left: 0;
    width: 42%;
    height: 140%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 35%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.08) 65%,
        transparent 100%
    );
    animation: tron-orb-chrome-glisten 3.2s ease-in-out infinite;
}

.tron-orb-chrome-btn__specular {
    position: absolute;
    top: 8%;
    left: 12%;
    width: 36%;
    height: 48%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.tron-orb-chrome-btn__label {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Auto-width for toolbars / side-by-side modal actions */
.tron-orb-chrome-btn--inline {
    width: auto;
    display: inline-flex;
    padding: 10px 16px;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
}

.tron-orb-chrome-btn--sm {
    padding: 8px 14px;
    font-size: 0.625rem;
    border-radius: 12px;
    letter-spacing: 0.1em;
}

.tron-orb-chrome-btn--flex {
    flex: 1;
    min-width: 0;
}

/* Inactive tab / secondary chrome (paired with active tron-orb-chrome-btn) */
.tron-orb-chrome-btn--ghost {
    animation: none;
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.55);
    text-shadow: none;
    background:
        radial-gradient(ellipse 42% 55% at 28% 22%, rgba(255, 255, 255, 0.06) 0%, transparent 58%),
        rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 -4px 10px rgba(0, 0, 0, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tron-orb-chrome-btn--ghost::before,
.tron-orb-chrome-btn--ghost .tron-orb-chrome-btn__shine,
.tron-orb-chrome-btn--ghost .tron-orb-chrome-btn__specular {
    display: none;
}

.tron-orb-chrome-btn--ghost:active:not(:disabled) {
    transform: scale(0.98);
    color: #fff;
    border-color: rgba(255, 107, 0, 0.35);
}

a.tron-orb-chrome-btn {
    text-decoration: none;
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    .tron-orb-chrome-btn,
    .tron-orb-chrome-btn::before,
    .tron-orb-chrome-btn__shine::after {
        animation: none !important;
    }
}
