/* =====================================================
   LIQUID GLASS (GLASSMORPHISM) GLOBAL THEME
   Kaiabi - Integração em todo o sistema
   ===================================================== */

/* 1. Base Transparent Wrappers */
body,
#main-wrapper,
.page-wrapper,
.body-wrapper,
.container-fluid {
    background-color: transparent !important;
    background: transparent !important;
}

/* 2. Global background on HTML to avoid overriding */
html {
    background:
        radial-gradient(circle at 10% 20%, rgba(124, 77, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(19, 222, 185, 0.1) 0%, transparent 40%),
        #f5f7fc !important;
    background-attachment: fixed !important;
    min-height: 100vh;
}

/* 3. Liquid blobs (pseudo-elements on main-wrapper) */
#main-wrapper {
    position: relative;
    /* REMOVIDO z-index: 1 - criava stacking context que prendia modais atrás do backdrop */
}

/* Blobs decorativos aplicados no html para não criar stacking context no main-wrapper */
html::before {
    content: '';
    position: fixed;
    top: -150px;
    right: -100px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(124, 77, 255, 0.07);
    filter: blur(60px);
    z-index: -1;
    pointer-events: none;
}

html::after {
    content: '';
    position: fixed;
    bottom: -150px;
    left: -100px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(19, 222, 185, 0.08);
    filter: blur(60px);
    z-index: -1;
    pointer-events: none;
}

/* 4. Glass Sidebar */
.left-sidebar,
aside.left-sidebar {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.03) !important;
}

/* Remove backgrounds from elements inside sidebar */
.left-sidebar>div,
.scroll-sidebar,
.sidebar-nav,
.brand-logo,
.fixed-profile {
    background: transparent !important;
    background-color: transparent !important;
}

/* Sidebar Menu Tweaks for contrast */
.sidebar-nav ul .sidebar-item:hover,
#sidebarnav .sidebar-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.4) !important;
}

/* 5. Glass Topbar */
.topbar,
header.topbar {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.7) !important;
}

/* Remove internal white backgrounds in topbar */
.topbar .with-vertical,
.topbar .navbar,
.topbar .collapse {
    background: transparent !important;
    background-color: transparent !important;
}

/* 6. Standard Cards to Glass (Globally applying to all generic cards) */
/* We carefully exclude contextual cards like bg-primary, etc */
.card:not(.bg-primary):not(.bg-success):not(.bg-warning):not(.bg-danger):not(.bg-info):not(.bg-dark):not(.solid-card):not(.modal .card) {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.03) !important;
}

/* ========== MODAL FIX: impedir que glassmorphism quebre z-index ========== */
.modal,
.modal-dialog,
.modal-content,
.modal-backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.modal-content {
    background: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.175) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.modal-backdrop.show {
    opacity: 0.5 !important;
}

.card-header,
.card-footer {
    background: rgba(255, 255, 255, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-top: 1px inset rgba(255, 255, 255, 0.5) !important;
}

/* 7. Dropdowns */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1) !important;
}

/* Fix z-index stacking */
.preloader {
    z-index: 99999;
}