/* ============================================
   NEXUS OVERRIDE - Sobrescreve CSS Antigo
   Garante que o novo visual funcione corretamente
   ============================================ */

/* ==================== BODY & LAYOUT ==================== */

/* Force novo background */
body {
    background: var(--nexus-bg-primary) !important;
    background-color: var(--nexus-bg-primary) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Remove backgrounds antigos */
.bg-gray-600,
.bg-dark,
.dark-version {
    background: transparent !important;
}

/* Oculta elementos antigos */
.sidenav,
.navbar-main,
aside.sidenav {
    display: none !important;
}

/* Remove padding/margin antigos do main */
main.main-content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    position: static !important;
}

/* Container fluido */
.container-fluid {
    max-width: 100% !important;
    padding: 0 !important;
}

/* Remove row margins */
.row {
    margin: 0 !important;
}

/* Remove col padding excessivo */
.col-12,
.col-md-6,
.col-xl-4 {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* Fix card backgrounds no antigo sistema */
.card {
    background: var(--nexus-bg-elevated) !important;
    border: 1px solid var(--nexus-glass-border) !important;
}

.card-header {
    background: var(--nexus-glass) !important;
    border-bottom: 1px solid var(--nexus-glass-border) !important;
}

/* Text colors */
.text-white,
.text-white-50 {
    color: var(--nexus-text-primary) !important;
}

/* Buttons do sistema antigo */
.btn-outline-light {
    background: var(--nexus-glass) !important;
    border-color: var(--nexus-glass-border) !important;
    color: var(--nexus-text-primary) !important;
}

.btn-outline-light:hover {
    background: var(--nexus-glass-hover) !important;
    border-color: var(--nexus-primary) !important;
}

.btn-success {
    background: linear-gradient(135deg, var(--nexus-success), #059669) !important;
    border: none !important;
}

.btn-outline-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    border-color: var(--nexus-warning) !important;
    color: #fbbf24 !important;
}

.btn-outline-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--nexus-danger) !important;
    color: #f87171 !important;
}

/* Form controls */
.form-control,
.form-control-sm,
.form-select {
    background: var(--nexus-glass) !important;
    border: 1px solid var(--nexus-glass-border) !important;
    color: var(--nexus-text-primary) !important;
}

.form-control::placeholder {
    color: var(--nexus-text-muted) !important;
}

.form-control:focus {
    background: var(--nexus-glass-hover) !important;
    border-color: var(--nexus-primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* Tables */
.table {
    color: var(--nexus-text-primary) !important;
}

.table thead {
    background: var(--nexus-glass) !important;
}

.table th {
    color: var(--nexus-text-secondary) !important;
    border-color: var(--nexus-glass-border) !important;
}

.table td {
    border-color: var(--nexus-glass-border) !important;
}

.table tbody tr:hover {
    background: var(--nexus-glass) !important;
}

/* Spinners */
.spinner-border {
    border-color: var(--nexus-glass-border) !important;
    border-top-color: var(--nexus-primary) !important;
}

/* Breadcrumb antigo */
.breadcrumb {
    background: transparent !important;
}

/* Remove horizontal rules antigas */
.horizontal {
    display: none !important;
}

/* Fix min-height */
.min-height-300 {
    display: none !important;
}

/* Dropdown menus */
.dropdown-menu {
    background: var(--nexus-bg-elevated) !important;
    border: 1px solid var(--nexus-glass-border) !important;
    box-shadow: var(--nexus-shadow-xl) !important;
}

.dropdown-item {
    color: var(--nexus-text-secondary) !important;
}

.dropdown-item:hover {
    background: var(--nexus-glass) !important;
    color: var(--nexus-text-primary) !important;
}

/* Pagination antiga */
.page-link {
    background: var(--nexus-glass) !important;
    border-color: var(--nexus-glass-border) !important;
    color: var(--nexus-text-primary) !important;
}

.page-link:hover {
    background: var(--nexus-glass-hover) !important;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--nexus-primary), var(--nexus-secondary)) !important;
    border-color: transparent !important;
}

/* Remove sombras antigas */
.shadow-none {
    box-shadow: none !important;
}

/* Text muted */
.text-muted,
.text-secondary {
    color: var(--nexus-text-tertiary) !important;
}

/* Badges antigos */
.badge {
    background: var(--nexus-glass) !important;
    color: var(--nexus-text-primary) !important;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

/* Alerts antigos */
.alert {
    background: var(--nexus-glass) !important;
    border: 1px solid var(--nexus-glass-border) !important;
    color: var(--nexus-text-primary) !important;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-left: 4px solid var(--nexus-success) !important;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-left: 4px solid var(--nexus-warning) !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border-left: 4px solid var(--nexus-danger) !important;
}

/* Links */
a {
    color: var(--nexus-primary-light);
    transition: color var(--nexus-transition-fast);
}

a:hover {
    color: var(--nexus-primary);
}

/* Progress bars */
.progress {
    background: var(--nexus-glass) !important;
}

.progress-bar {
    background: linear-gradient(135deg, var(--nexus-primary), var(--nexus-secondary)) !important;
}

/* List groups */
.list-group-item {
    background: var(--nexus-bg-elevated) !important;
    border-color: var(--nexus-glass-border) !important;
    color: var(--nexus-text-primary) !important;
}

.list-group-item:hover {
    background: var(--nexus-glass) !important;
}

/* Input groups */
.input-group-text {
    background: var(--nexus-glass) !important;
    border-color: var(--nexus-glass-border) !important;
    color: var(--nexus-text-secondary) !important;
}

/* Nav tabs antigas */
.nav-tabs {
    border-bottom: 1px solid var(--nexus-glass-border) !important;
}

.nav-tabs .nav-link {
    color: var(--nexus-text-secondary) !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
}

.nav-tabs .nav-link:hover {
    color: var(--nexus-text-primary) !important;
}

.nav-tabs .nav-link.active {
    background: transparent !important;
    color: var(--nexus-text-primary) !important;
    border-bottom-color: var(--nexus-primary) !important;
}

/* Fix z-index issues */
.nexus-sidebar,
.nexus-header {
    position: fixed !important;
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */

@media (max-width: 1024px) {
    /* Em mobile, remove margin do content */
    body > div[style*="margin-left"] {
        margin-left: 0 !important;
    }
}

/* ==================== TYPOGRAPHY ==================== */

h1, h2, h3, h4, h5, h6 {
    color: var(--nexus-text-primary) !important;
}

p {
    color: var(--nexus-text-secondary) !important;
}

small {
    color: var(--nexus-text-tertiary) !important;
}

/* ==================== BORDERS & DIVIDERS ==================== */

hr {
    border-color: var(--nexus-glass-border) !important;
    opacity: 1 !important;
}

/* ==================== MODALS (Bootstrap) ==================== */

.modal-content {
    background: var(--nexus-bg-elevated) !important;
    border: 1px solid var(--nexus-glass-border) !important;
    border-radius: var(--nexus-radius-lg) !important;
}

.modal-header {
    border-bottom: 1px solid var(--nexus-glass-border) !important;
    background: var(--nexus-glass) !important;
}

.modal-footer {
    border-top: 1px solid var(--nexus-glass-border) !important;
    background: var(--nexus-glass) !important;
}

.modal-title {
    color: var(--nexus-text-primary) !important;
}

/* ==================== TOASTS ==================== */

.toast {
    background: var(--nexus-bg-elevated) !important;
    border: 1px solid var(--nexus-glass-border) !important;
    color: var(--nexus-text-primary) !important;
}

/* ==================== POPOVERS ==================== */

.popover {
    background: var(--nexus-bg-elevated) !important;
    border: 1px solid var(--nexus-glass-border) !important;
}

.popover-header {
    background: var(--nexus-glass) !important;
    border-bottom: 1px solid var(--nexus-glass-border) !important;
    color: var(--nexus-text-primary) !important;
}

.popover-body {
    color: var(--nexus-text-secondary) !important;
}

/* ==================== ACCORDION ==================== */

.accordion-item {
    background: var(--nexus-bg-elevated) !important;
    border: 1px solid var(--nexus-glass-border) !important;
}

.accordion-button {
    background: var(--nexus-glass) !important;
    color: var(--nexus-text-primary) !important;
}

/* ==================== CHATS PAGE ==================== */

.accordion-button:not(.collapsed) {
    background: var(--nexus-glass-hover) !important;
    color: var(--nexus-text-primary) !important;
}

/* ==================== UTILITIES ==================== */

.bg-white {
    background: var(--nexus-bg-elevated) !important;
}

.bg-light {
    background: var(--nexus-glass) !important;
}

.bg-dark {
    background: var(--nexus-bg-secondary) !important;
}

.text-dark {
    color: var(--nexus-text-primary) !important;
}

.border {
    border-color: var(--nexus-glass-border) !important;
}

/* ==================== FIXES ESPECÍFICOS ==================== */

/* Remove elementos vazios ou desnecessários */
.min-height-300.bg-dark.position-absolute {
    display: none !important;
}

/* Ajusta espaçamento do conteúdo */
main {
    min-height: calc(100vh - 160px) !important;
}

/* Cards dentro de rows precisam de padding correto */
.row.g-4 > [class*="col-"] {
    padding: 8px !important;
}

/* Text truncate */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status indicators */
.status-online {
    width: 8px;
    height: 8px;
    background: var(--nexus-success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--nexus-success);
    animation: pulse 2s infinite;
}

.status-offline {
    width: 8px;
    height: 8px;
    background: var(--nexus-danger);
    border-radius: 50%;
    display: inline-block;
}

/* Garante visibilidade de texto em todos elementos */
* {
    color: inherit;
}

/* Input file */
input[type="file"] {
    color: var(--nexus-text-primary) !important;
}

/* Select options */
option {
    background: var(--nexus-bg-elevated) !important;
    color: var(--nexus-text-primary) !important;
}

/* Disabled states */
:disabled,
[disabled] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Focus rings modernos */
*:focus-visible {
    outline: 2px solid var(--nexus-primary) !important;
    outline-offset: 2px !important;
}

