:root {
    --bg-color-admin: #0a0a0a;
    --text-color-admin: #f7f7f7;
    --bg-color-default: #1a120b;
    --text-color-default: #FEF8E6;
}

html[data-theme="admin"] {
    --current-bg: var(--bg-color-admin);
    --current-text: var(--text-color-admin);
    --complementary-bg: #0d0d0d;
    --contrast-color: #ff2400;
    color-scheme: dark !important;
}

html[data-theme="default"] {
    --current-bg: var(--bg-color-default);
    --current-text: var(--text-color-default);
    color-scheme: dark light !important;
}

html[data-theme="index"] {
    --current-bg: var(--bg-color-admin);
    --current-text: var(--text-color-admin);
    --complementary-bg: #0d0d0d;
    color-scheme: dark !important;
}

html[data-theme="admin-fundinho"] {
    --current-bg: #1a120b;
    --current-text: #FEF8E6;
    --complementary-bg: #B18560;
    --contrast-color: #CD7C32;
    color-scheme: dark !important;
}

/* FOUC flash shield e Fade-in no carregamento inicial */
html {
    background-color: var(--current-bg) !important;
    color: var(--current-text);
}

body {
    background-color: var(--current-bg) !important;
    color: var(--current-text);
}

@view-transition {
    navigation: auto;
}

/* Animação global de fade/scale apenas para pages NÃO-admin.
   O admin tem animações direcionais próprias definidas em admin.css */
html:not([data-theme="admin"]) ::view-transition-old(root) {
    animation: 350ms cubic-bezier(0.4, 0, 0.2, 1) both fade-out-scale;
}

html:not([data-theme="admin"]) ::view-transition-new(root) {
    animation: 350ms cubic-bezier(0.4, 0, 0.2, 1) both fade-in-scale;
}

@keyframes fade-in-scale {
    from { opacity: 0; transform: scale(0.95) translateX(30px); }
    to { opacity: 1; transform: scale(1) translateX(0); }
}

@keyframes fade-out-scale {
    from { opacity: 1; transform: scale(1) translateX(0); }
    to { opacity: 0; transform: scale(1.05) translateX(-30px); }
}

::view-transition,
::view-transition-group(root),
::view-transition-image-pair(root),
::view-transition-old(root),
::view-transition-new(root) {
    background-color: #0a0a0a !important;
}

::view-transition-image-pair(*) {
    mix-blend-mode: normal !important;
}

html[data-theme="admin"] aside {
    background-color: rgba(10, 10, 11, 0.6) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    color: var(--current-text) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}

html[data-theme="admin"] nav,
html[data-theme="admin"] .navbar {
    background-color: rgba(10, 10, 11, 0.6) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    height: 65px !important;
    box-sizing: border-box !important;
}

html[data-theme="admin"] .card, 
html[data-theme="admin"] .shortcut-card, 
html[data-theme="admin"] .quick-filters-bar, 
html[data-theme="admin"] .table, 
html[data-theme="admin"] .form-control, 
html[data-theme="admin"] .modal-content {
    background-color: var(--complementary-bg) !important;
    color: var(--current-text) !important;
    border-color: rgba(255,255,255,0.05) !important;
}

html[data-theme="admin-fundinho"] aside {
    background-color: rgba(43, 31, 25, 0.6) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    color: var(--current-text) !important;
    border-right: 1px solid rgba(177, 133, 96, 0.2) !important;
}

html[data-theme="admin-fundinho"] nav,
html[data-theme="admin-fundinho"] .navbar {
    background-color: rgba(43, 31, 25, 0.6) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(177, 133, 96, 0.2) !important;
    height: 65px !important;
    box-sizing: border-box !important;
}

html[data-theme="admin-fundinho"] .card, 
html[data-theme="admin-fundinho"] .shortcut-card, 
html[data-theme="admin-fundinho"] .quick-filters-bar, 
html[data-theme="admin-fundinho"] .table, 
html[data-theme="admin-fundinho"] .form-control,
html[data-theme="admin-fundinho"] .modal-content {
    background-color: rgba(43, 31, 25, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    color: var(--current-text) !important;
    border-color: rgba(205, 124, 50, 0.3) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

/* Utilitários Globais */
p, li, span, a, div, figcaption {
    text-wrap: pretty;
}

h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}
.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon-box {
    background: var(--primary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #000;
    font-size: 1rem;
}

.margin-right-1rem {
    margin-right: 1rem;
}

.text-secondary-color {
    color: var(--text-secondary);
}

.texto-tremulo {
    display: inline-block;
}

.texto-tremulo span {
    display: inline-block;
    animation: wave 1.5s ease-in-out infinite;
}

.texto-tremulo span:nth-child(1) {
    animation-delay: 0s;
}
.texto-tremulo span:nth-child(2) {
    animation-delay: 0.1s;
}
.texto-tremulo span:nth-child(3) {
    animation-delay: 0.2s;
}
.texto-tremulo span:nth-child(4) {
    animation-delay: 0.3s;
}
.texto-tremulo span:nth-child(5) {
    animation-delay: 0.4s;
}
.texto-tremulo span:nth-child(6) {
    animation-delay: 0.5s;
}
.texto-tremulo span:nth-child(7) {
    animation-delay: 0.6s;
}
.texto-tremulo span:nth-child(8) {
    animation-delay: 0.7s;
}
.texto-tremulo span:nth-child(9) {
    animation-delay: 0.8s;
}

@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* BADGE DE VERSÃO */
.version-badge {
    position: fixed;
    bottom: 8px;
    right: 12px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.2);
    font-family: monospace;
    z-index: 99999;
    pointer-events: none;
    user-select: none;
}
