/**
 * GilGamez BlackBox Framework — Central UX & Motion Orchestrator Engine Styles
 * Path: engine/Ux/css/ux.css
 * Provides hardware-accelerated motion tokens, easing curves, and FLIP container classes.
 * Strictly conforms to BlackBox Framework Laws (BF-01 to BF-25).
 */

:root {
    --ux-ease-spring: cubic-bezier(0.2, 0, 0, 1);
    --ux-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --ux-ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
    --ux-ease-decelerate: cubic-bezier(0, 0, 0.2, 1);
    --ux-dur-fast: 160ms;
    --ux-dur-normal: 280ms;
    --ux-dur-slow: 420ms;
}

/* ─── FLIP Morph Overlay & Container ─── */
.ux-morph-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 26, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    pointer-events: auto;
    opacity: 1 !important;
    transition: background-color var(--ux-dur-normal) var(--ux-ease-spring),
                backdrop-filter var(--ux-dur-normal) var(--ux-ease-spring),
                -webkit-backdrop-filter var(--ux-dur-normal) var(--ux-ease-spring);
    animation: none !important;
}

.ux-morph-overlay.open {
    background: rgba(10, 15, 26, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ux-morph-card {
    position: relative;
    background: var(--bg-surface, #0d121c);
    border: 1px solid var(--border-gold, rgba(197, 160, 89, 0.28));
    border-radius: 16px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 100%;
    max-height: min(92dvh, 620px);
    display: flex;
    flex-direction: column;
    padding: 20px 20px 18px;
    box-sizing: border-box;
    color: var(--text-primary, #f8fafc);
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform, border-radius, box-shadow;
    opacity: 1 !important;
    animation: none !important;
}

@media (max-width: 480px) {
    .ux-morph-card {
        padding: 16px 14px 14px;
        border-radius: 14px;
        max-height: min(94dvh, 620px);
    }
}

/* Neutralize any static CSS popup animations from modal.css */
.ux-morph-overlay.ggz-modal-overlay,
.ux-morph-card.ggz-modal-card {
    animation: none !important;
    opacity: 1 !important;
}

.ux-morph-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-gold, #c5a059) 25%, #f5e6a3 50%, var(--primary-gold, #c5a059) 75%, transparent);
    z-index: 3;
}

.ux-morph-content {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ─── Modal Header & Close Button ─── */
.ux-morph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    margin-bottom: 14px;
    flex-shrink: 0;
}

.ux-morph-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    letter-spacing: -0.01em;
}

.ux-morph-close {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.ux-morph-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* Custom Slim Scrollbar for Modal Body */
.ux-modal-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(197, 160, 89, 0.3) rgba(15, 23, 42, 0.4);
}

.ux-modal-scroll::-webkit-scrollbar {
    width: 6px;
}

.ux-modal-scroll::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 3px;
}

.ux-modal-scroll::-webkit-scrollbar-thumb {
    background: rgba(197, 160, 89, 0.3);
    border-radius: 3px;
}

.ux-modal-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(197, 160, 89, 0.5);
}

/* Secondary Button styling within morph cards */
.ux-morph-card .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0 !important;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ux-morph-card .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-gold, rgba(197, 160, 89, 0.4));
    color: #ffffff !important;
    transform: translateY(-1px);
}

.ux-morph-card .btn-secondary:active {
    transform: translateY(1px);
}

/* Scoped Modal Form Actions Bar */
.ux-morph-card .form-actions-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.ux-morph-card .form-actions-bar > button {
    width: auto !important;
    flex: 0 0 auto;
}

/* ─── Tactile Micro-Interactions ─── */
.ux-tactile {
    transition: transform 0.14s var(--ux-ease-spring), box-shadow 0.14s ease, filter 0.14s ease;
    user-select: none;
    -webkit-user-select: none;
}

.ux-tactile:active {
    transform: scale(0.975) translateY(1px);
}

/* ─── Obsidian Gold Shimmer Text Token (BF-31) ─── */
.ux-shimmer-text {
    background: linear-gradient(
        90deg,
        var(--cc-text-muted, #64748b) 0%,
        var(--cc-primary-gold, #c5a059) 35%,
        #fef08a 50%,
        var(--cc-primary-gold, #c5a059) 65%,
        var(--cc-text-muted, #64748b) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: uxTextShimmer 8s ease-in-out infinite;
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none !important;
    font-variant: normal !important;
    user-select: none;
    display: inline-block;
    line-height: 1.25;
}

@keyframes uxTextShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ux-shimmer-text {
        animation: none;
        -webkit-text-fill-color: var(--cc-primary-gold, #c5a059);
        color: var(--cc-primary-gold, #c5a059);
    }
}

