/*
 * Stack Gamer Design System - componentes base.
 * ETAPA 21.12-T.2: biblioteca global do preview administrativo.
 */

.theme-stackgamer-definitive-preview :where(.sgds-panel, .sgds-card, .sgds-modal, .sgds-table-wrap, .panel, .admin-card, .dashboard-card, .quality-panel, .bi-panel, .auth-card, .profile-section, .checkout-card, .checkout-summary, .checkout-container, .product-card, .conversion-section, .conversion-path-card, .conversion-category-card, .cyber-modal-content) {
    position: relative;
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius-medium);
    background: var(--sg-gradient-panel);
    box-shadow: var(--sg-shadow-panel);
}

.theme-stackgamer-definitive-preview :where(.sgds-panel, .sgds-card, .panel, .product-card, .conversion-section, .conversion-category-card)::before {
    position: absolute;
    top: -1px;
    right: 18px;
    width: 76px;
    height: 2px;
    content: "";
    background: var(--sg-gradient-primary);
    box-shadow: var(--sg-glow-cyan);
}

.theme-stackgamer-definitive-preview .sgds-button,
.theme-stackgamer-definitive-preview :where(button, .btn-submit, .btn-auth, .btn-nav, .btn-view, .btn-checkout, .btn-buy-primary, .btn-admin-action, .btn-back, .btn-voltar, .coupon-copy-action) {
    min-height: 42px;
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius-small);
    background: rgba(8, 11, 22, .86);
    color: var(--sg-text-primary);
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0;
    transition:
        transform var(--sg-transition-fast),
        border-color var(--sg-transition-fast),
        box-shadow var(--sg-transition-fast),
        filter var(--sg-transition-fast);
}

.theme-stackgamer-definitive-preview .sgds-button-primary,
.theme-stackgamer-definitive-preview :where(.btn-submit, .btn-auth, .btn-checkout, .btn-buy-primary, .coupon-copy-action) {
    border-color: rgba(255, 255, 255, .28);
    background: var(--sg-gradient-primary);
    color: #050711;
    box-shadow: var(--sg-glow-purple);
}

.theme-stackgamer-definitive-preview .sgds-button-secondary,
.theme-stackgamer-definitive-preview :where(.btn-nav, .btn-view, .btn-back, .btn-voltar) {
    border-color: var(--sg-border-cyan);
    background: rgba(0, 240, 255, .08);
    color: var(--sg-cyan-soft);
}

.theme-stackgamer-definitive-preview .sgds-button-tertiary {
    min-height: auto;
    border-color: transparent;
    background: transparent;
    color: var(--sg-cyan-soft);
    box-shadow: none;
}

.theme-stackgamer-definitive-preview .sgds-button-success {
    border-color: rgba(34, 232, 143, .64);
    background: var(--sg-gradient-success);
    color: #03120d;
}

.theme-stackgamer-definitive-preview .sgds-button-warning {
    border-color: rgba(255, 204, 61, .64);
    background: var(--sg-gradient-warning);
    color: #171005;
}

.theme-stackgamer-definitive-preview .sgds-button-danger {
    border-color: rgba(255, 79, 109, .66);
    background: var(--sg-gradient-danger);
    color: #fff;
}

.theme-stackgamer-definitive-preview :where(.sgds-button, button, .btn-submit, .btn-auth, .btn-nav, .btn-view, .btn-checkout, .btn-buy-primary, .btn-admin-action, .btn-back, .btn-voltar):not(:disabled):hover {
    border-color: var(--sg-border-cyan);
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: var(--sg-glow-cyan);
}

.theme-stackgamer-definitive-preview :where(.sgds-button, button, .btn-submit, .btn-auth, .btn-nav, .btn-view, .btn-checkout, .btn-buy-primary):active {
    transform: translateY(0);
}

.theme-stackgamer-definitive-preview :where(.sgds-button, button, input, select, textarea, a, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--sg-cyan);
    outline-offset: 3px;
}

.theme-stackgamer-definitive-preview :where(.sgds-button, button, input, select, textarea):disabled,
.theme-stackgamer-definitive-preview :where(.sgds-button, button, input, select, textarea)[aria-disabled="true"],
.theme-stackgamer-definitive-preview :where(input, select, textarea)[readonly] {
    cursor: not-allowed;
    filter: grayscale(.55);
    opacity: .58;
}

.theme-stackgamer-definitive-preview :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea, .sgds-input) {
    min-height: 42px;
    width: 100%;
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius-small);
    background: #fff;
    color: #111;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025);
}

.theme-stackgamer-definitive-preview :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, .sgds-input)::placeholder {
    color: #6b7280;
    opacity: 1;
}

.theme-stackgamer-definitive-preview :where(input[type="date"], input[type="time"], input[type="datetime-local"], input[type="number"], input[inputmode="decimal"], .money-input, .percent-input) {
    font-variant-numeric: tabular-nums;
}

.theme-stackgamer-definitive-preview :where(input[type="file"]) {
    width: 100%;
    min-height: 42px;
    border: 1px dashed var(--sg-border-cyan);
    border-radius: var(--sg-radius-small);
    background: rgba(0, 240, 255, .045);
    color: var(--sg-text-secondary);
    padding: 9px;
}

.theme-stackgamer-definitive-preview :where(input[type="checkbox"], input[type="radio"]) {
    width: 18px;
    height: 18px;
    accent-color: var(--sg-cyan);
}

.theme-stackgamer-definitive-preview :where(.switch, .toggle, [role="switch"]) {
    border-color: var(--sg-border);
    background: rgba(8, 11, 22, .92);
}

.theme-stackgamer-definitive-preview :where(input, select, textarea):focus {
    border-color: var(--sg-border-cyan);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, .13);
}

.theme-stackgamer-definitive-preview :where(input, select, textarea)[aria-invalid="true"],
.theme-stackgamer-definitive-preview :where(input, select, textarea).error {
    border-color: var(--sg-danger);
    box-shadow: 0 0 0 3px rgba(255, 79, 109, .14);
}

.theme-stackgamer-definitive-preview :where(input, select, textarea).success,
.theme-stackgamer-definitive-preview :where(input, select, textarea)[data-state="success"] {
    border-color: var(--sg-aqua);
    box-shadow: 0 0 0 3px rgba(0, 255, 198, .12);
}

.theme-stackgamer-definitive-preview :where(label, legend, .form-label) {
    color: var(--sg-text-secondary);
    font-weight: 700;
}

.theme-stackgamer-definitive-preview .sgds-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--sg-cyan-soft);
    font-family: var(--sg-font-display);
    font-size: .72rem;
    font-weight: 800;
}

.theme-stackgamer-definitive-preview .sgds-badge-success { color: var(--sg-success); }
.theme-stackgamer-definitive-preview .sgds-badge-warning { color: var(--sg-warning); }
.theme-stackgamer-definitive-preview .sgds-badge-danger { color: var(--sg-danger); }
.theme-stackgamer-definitive-preview .sgds-badge-selected {
    background: rgba(0, 240, 255, .12);
    box-shadow: var(--sg-glow-cyan);
}

.theme-stackgamer-definitive-preview .sgds-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sg-space-2);
    border-bottom: 1px solid var(--sg-border);
}

.theme-stackgamer-definitive-preview .sgds-tab[aria-selected="true"] {
    border-color: var(--sg-border-cyan);
    color: var(--sg-cyan-soft);
}

.theme-stackgamer-definitive-preview .sgds-alert {
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius-small);
    padding: var(--sg-space-3) var(--sg-space-4);
    background: rgba(8, 11, 22, .86);
    color: var(--sg-text-secondary);
}

.theme-stackgamer-definitive-preview .sgds-alert-success { border-color: rgba(34, 232, 143, .55); color: #b8ffd9; }
.theme-stackgamer-definitive-preview .sgds-alert-warning { border-color: rgba(255, 204, 61, .58); color: #ffe69a; }
.theme-stackgamer-definitive-preview .sgds-alert-danger { border-color: rgba(255, 79, 109, .62); color: #ffb4c1; }

.theme-stackgamer-definitive-preview :where(.table-responsive, .sgds-table-wrap) {
    overflow-x: auto;
}

.theme-stackgamer-definitive-preview :where(table) {
    border-collapse: collapse;
    width: 100%;
}

.theme-stackgamer-definitive-preview :where(th) {
    color: var(--sg-cyan-soft);
    font-family: var(--sg-font-display);
    font-size: .78rem;
    letter-spacing: 0;
}

.theme-stackgamer-definitive-preview :where(td, th) {
    border-bottom: 1px solid rgba(117, 95, 170, .20);
}

.theme-stackgamer-definitive-preview :where(.breadcrumb, .breadcrumbs) {
    color: var(--sg-text-muted);
}

.theme-stackgamer-definitive-preview :where(.breadcrumb a, .breadcrumbs a) {
    color: var(--sg-cyan-soft);
}

.theme-stackgamer-definitive-preview .sgds-loader,
.theme-stackgamer-definitive-preview .sgds-skeleton {
    overflow: hidden;
    border-radius: var(--sg-radius-small);
    background: linear-gradient(90deg, #101827 20%, #16243a 45%, #101827 70%);
    background-size: 250% 100%;
    animation: sgds-loading 1.2s linear infinite;
}

.theme-stackgamer-definitive-preview .sgds-progress {
    overflow: hidden;
    min-height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
}

.theme-stackgamer-definitive-preview .sgds-progress > span {
    display: block;
    min-height: inherit;
    background: var(--sg-gradient-primary);
}

@keyframes sgds-loading {
    to { background-position: -250% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .theme-stackgamer-definitive-preview *,
    .theme-stackgamer-definitive-preview *::before,
    .theme-stackgamer-definitive-preview *::after {
        scroll-behavior: auto;
        animation-duration: .01ms;
        animation-iteration-count: 1;
        transition-duration: .01ms;
    }
}
