/* ==========================================
   MIST DEVICE MONITOR - TECH THEME
   Fichier CSS centralisé pour un thème tech moderne
   Version: 1.0
   ========================================== */

/* Variables CSS pour le thème tech */
:root {
    /* Tech Color Palette */
    --tech-primary: #0066ff;
    --tech-secondary: #00d4ff;
    --tech-accent: #ff6b35;
    --tech-success: #00ff88;
    --tech-warning: #ffaa00;
    --tech-danger: #ff3366;
    --tech-dark: #0a0e27;
    --tech-darker: #050817;
    --tech-gray: #1a1f3a;
    --tech-light-gray: #2a2f4a;
    --tech-border: #3a4f7a;
    --tech-text-primary: #e8f0ff;
    --tech-text-secondary: #b8c5e0;
    --tech-glow: 0 0 20px rgba(0, 212, 255, 0.3);
    --tech-gradient: linear-gradient(135deg, var(--tech-primary), var(--tech-secondary));
}

/* ==========================================
   STYLES GLOBAUX
   ========================================== */

body {
    background: linear-gradient(135deg, var(--tech-dark) 0%, var(--tech-darker) 100%);
    color: var(--tech-text-primary);
    min-height: 100vh;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--tech-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--tech-primary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--tech-secondary);
}

/* ==========================================
   NAVBAR ET NAVIGATION - CORRECTION Z-INDEX
   ========================================== */

.navbar {
    background: rgba(10, 14, 39, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--tech-border);
    z-index: 1030 !important;
    position: relative !important;
    transform: none !important;
    will-change: auto !important;
}

.navbar-nav {
    position: relative;
}

.navbar-nav .nav-item.dropdown {
    position: relative !important;
    transform: none !important;
}

/* ULTRA-SPECIFIC DROPDOWN OVERRIDE */
.navbar .dropdown-menu,
.navbar-nav .dropdown-menu,
.dropdown-menu.dropdown-menu-end,
ul.dropdown-menu,
div.dropdown-menu {
    background: var(--tech-gray) !important;
    border: 1px solid var(--tech-border) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 999999 !important;
    position: absolute !important;
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transform: none !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8) !important;
    max-height: none !important;
    overflow: visible !important;
}

/* SHOW STATE */
.navbar .dropdown-menu.show,
.navbar-nav .dropdown-menu.show,
.dropdown-menu.dropdown-menu-end.show,
ul.dropdown-menu.show,
div.dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Éliminer tous les stacking contexts possibles */
.container-fluid,
.row,
main,
.card,
.table,
.table-responsive,
.card-body {
    position: relative !important;
    z-index: 1 !important;
    transform: none !important;
    will-change: auto !important;
}

/* Forcer le positionnement des éléments de navigation */
.navbar-nav {
    z-index: 1030 !important;
}

.nav-link.dropdown-toggle {
    position: relative !important;
    z-index: 1031 !important;
}

/* Garantir que les liens de dropdown fonctionnent */
.dropdown-toggle::after {
    display: inline-block !important;
    margin-left: 0.255em !important;
    vertical-align: 0.255em !important;
    content: "" !important;
    border-top: 0.3em solid !important;
    border-right: 0.3em solid transparent !important;
    border-bottom: 0 !important;
    border-left: 0.3em solid transparent !important;
}

.navbar-brand {
    font-weight: bold;
    background: var(--tech-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    color: var(--tech-text-secondary) !important;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--tech-secondary) !important;
    /*text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);*/
}

/* ULTRA-AGGRESSIVE DROPDOWN OVERRIDE */
html body .navbar .dropdown-menu,
html body .navbar-nav .dropdown-menu,
html body .dropdown-menu.dropdown-menu-end,
html body ul.navbar-nav .dropdown-menu,
html body .navbar .dropdown .dropdown-menu,
html body .nav-item .dropdown-menu {
    background: var(--tech-gray) !important;
    border: 1px solid var(--tech-border) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 9999999 !important;
    position: absolute !important;
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transform: translateY(-10px) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9) !important;
    max-height: none !important;
    overflow: visible !important;
    top: 100% !important;
    left: 0 !important;
    min-width: 200px !important;
}

/* FORCED SHOW STATE */
html body .navbar .dropdown-menu.show,
html body .navbar-nav .dropdown-menu.show,
html body .dropdown-menu.dropdown-menu-end.show,
html body ul.navbar-nav .dropdown-menu.show,
html body .navbar .dropdown .dropdown-menu.show,
html body .nav-item .dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* END DROPDOWN OVERRIDE */

.dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
}

/* SOLUTION FINALE - FORÇAGE ULTRA-AGGRESSIF */

html body {
    position: relative !important;
}

/* Forcer TOUS les éléments de contenu à rester en arrière-plan */
html body .container-fluid,
html body .row,
html body main,
html body .col-md-12,
html body .col-lg-12,
html body .px-md-4,
html body .card,
html body .card-body,
html body .card-header,
html body .table,
html body .table-responsive,
html body .dataTables_wrapper,
html body .spinner-overlay,
html body .alert,
html body .badge {
    position: relative !important;
    z-index: 1 !important;
    transform: none !important;
    will-change: auto !important;
    filter: none !important;
    clip: auto !important;
    overflow: visible !important;
}

/* Exceptions pour les éléments qui DOIVENT être au-dessus */
html body .navbar,
html body .navbar-nav,
html body .nav-item,
html body .nav-link,
html body .dropdown {
    position: relative !important;
    z-index: 1030 !important;
}

/* Force absolue pour les dropdowns - AUCUN élément ne peut les dépasser */
html body .navbar .dropdown-menu,
html body .navbar-nav .dropdown-menu,
html body .dropdown-menu.dropdown-menu-end,
html body .dropdown-menu,
html body ul.dropdown-menu,
html body div.dropdown-menu {
    position: fixed !important;
    z-index: 2147483647 !important; /* Valeur maximale possible */
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    background: var(--tech-gray) !important;
    border: 2px solid var(--tech-border) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(15px) !important;
    pointer-events: auto !important;
}

/* Affichage forcé avec position absolute relative au parent */
html body .navbar .dropdown-menu.show,
html body .navbar-nav .dropdown-menu.show,
html body .dropdown-menu.dropdown-menu-end.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    min-width: 220px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    z-index: 2147483647 !important;
    pointer-events: auto !important;
}

/* Forcer le dropdown-end */
html body .dropdown-menu.dropdown-menu-end.show {
    right: 0 !important;
    left: auto !important;
}

/* Assurer que le navbar reste au-dessus du contenu */
html body .navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1030 !important;
}

/* Éliminer tous les transforms potentiels */
html body *,
html body *::before,
html body *::after {
    transform: none !important;
}

/* Exception pour les éléments qui ont besoin de transform */
html body .dropdown-menu.show,
html body .navbar-toggler {
    transform: none !important;
}

.dropdown-item {
    color: var(--tech-text-secondary);
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--tech-light-gray);
    color: var(--tech-secondary);
    /*text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);*/
}

/* ==========================================
   CARTES ET COMPOSANTS
   ========================================== */

.card {
    background: rgba(26, 31, 58, 0.8);
    border: 1px solid var(--tech-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

/* Cartes statistiques */
.card-stat {
    transition: all 0.3s ease;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.card-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.2);
    border-color: var(--tech-secondary);
}

.card-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s;
}

.card-stat:hover::before {
    left: 100%;
}

.card-stat .card-title {
    font-size: 0.9rem;
    line-height: 1.2;
    height: 2.4rem;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--tech-text-secondary);
}

/* ==========================================
   TABLEAUX
   ========================================== */

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
}

.table {
    background: rgba(26, 31, 58, 0.6);
    color: var(--tech-text-primary);
}

.table thead th {
    background: var(--tech-gradient);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.table tbody tr {
    border-color: var(--tech-border);
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(0, 212, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.1);
}

/* Sites sans devices */
.sites-without-devices {
    background: rgba(42, 47, 74, 0.9) !important;
    background-color: rgba(42, 47, 74, 0.9) !important;
    border-left: 3px solid white !important;
}

.sites-without-devices td {
    color: var(--tech-text-primary) !important;
    background: transparent !important;
}

.sites-without-devices strong {
    color: var(--tech-text-primary) !important;
    font-weight: 700 !important;
    /*text-shadow: 0 0 15px rgba(255, 255, 255, 0.8) !important;*/
    font-size: 1.15rem !important;
    background: linear-gradient(45deg, #e8f0ff, #b8c5e0) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* ==========================================
   BOUTONS
   ========================================== */

.btn {
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--tech-gradient);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--tech-primary);
    color: var(--tech-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--tech-primary);
    color: white;
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.5);
}

/* ==========================================
   FORMULAIRES
   ========================================== */

.form-control, .form-select {
    background: rgba(26, 31, 58, 0.8);
    border: 1px solid var(--tech-border);
    color: var(--tech-text-primary);
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    background: rgba(26, 31, 58, 0.9);
    border-color: var(--tech-secondary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
    color: var(--tech-text-primary);
}

.form-control::placeholder {
    color: var(--tech-text-secondary);
}

/* ==========================================
   BADGES ET ÉLÉMENTS D'ÉTAT
   ========================================== */

.badge {
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-radius: 6px;
    padding: 0.4em 0.8em;
}

/* Status colors */
.status-connected {
    color: var(--tech-success);
    /*text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);*/
}

.status-disconnected {
    color: var(--tech-danger);
    /*text-shadow: 0 0 10px rgba(255, 51, 102, 0.3);*/
}

.device-status-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    /*animation: pulse 2s infinite;*/
}

.status-online {
    background-color: var(--tech-success);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.status-offline {
    background-color: var(--tech-danger);
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
}

.bg-orange {
    background: var(--tech-accent) !important;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.4);
}

/* Delta values (différences) */
.text-muted.opacity-75 {
    color: var(--tech-text-primary) !important;
    opacity: 0.9 !important;
    font-weight: 700 !important;
    /*text-shadow: 0 0 8px rgba(0, 212, 255, 0.4) !important;*/
    font-size: 0.9rem !important;
    letter-spacing: 0.5px;
    /*animation: subtle-glow 3s ease-in-out infinite alternate;*/
}

.card-stat .text-muted.opacity-75 {
    background: linear-gradient(45deg, var(--tech-secondary), var(--tech-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   ALERTES ET MESSAGES
   ========================================== */

.alert {
    border: none;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* ==========================================
   SYSTÈME D'INFORMATION
   ========================================== */

.system-info-section h6 {
    color: var(--tech-text-primary) !important;
    font-weight: 700 !important;
    /*text-shadow: 0 0 10px rgba(0, 212, 255, 0.4) !important;*/
    font-size: 1.1rem !important;
}

.system-info-section .text-muted {
    color: var(--tech-text-primary) !important;
    font-weight: 600 !important;
    /*text-shadow: 0 0 8px rgba(0, 212, 255, 0.3) !important;*/
    opacity: 1 !important;
    font-size: 1rem !important;
}

.system-info-section .fas {
    color: var(--tech-secondary) !important;
    /*text-shadow: 0 0 15px rgba(0, 212, 255, 0.6) !important;*/
}

/* Statuts spéciaux système */
#autoRefreshStatus {
    color: var(--tech-success) !important;
    font-weight: 700 !important;
    /*text-shadow: 0 0 8px rgba(0, 255, 136, 0.5) !important;*/
}

#autoRefreshCountdown {
    color: var(--tech-warning) !important;
    font-weight: 600 !important;
    /*text-shadow: 0 0 8px rgba(255, 170, 0, 0.5) !important;*/
}

/* ==========================================
   BORDURES PERSONNALISÉES
   ========================================== */

.border-success {
    border-color: var(--tech-success) !important;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.border-danger {
    border-color: var(--tech-danger) !important;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.2);
}

.border-primary {
    border-color: var(--tech-primary) !important;
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.2);
}

.border-warning {
    border-color: var(--tech-warning) !important;
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.2);
}

.border-secondary {
    border-color: var(--tech-border) !important;
}

/* ==========================================
   DATATABLES - STYLES TECH
   ========================================== */

/* Container DataTables */
.dataTables_wrapper {
    color: var(--tech-text-primary);
}

/* Textes des cellules - LISIBILITÉ AMÉLIORÉE */
.dataTables_wrapper .table tbody td {
    color: var(--tech-text-primary) !important;
    font-weight: 600 !important;
    /*text-shadow: 0 0 8px rgba(0, 212, 255, 0.4) !important;*/
    background: rgba(26, 31, 58, 0.6) !important;
    backdrop-filter: blur(5px) !important;
    border: 1px solid var(--tech-border) !important;
    transition: all 0.3s ease !important;
}

/* Filtres et contrôles */
.dataTables_wrapper .dataTables_filter input {
    background: rgba(26, 31, 58, 0.8) !important;
    border: 1px solid var(--tech-border) !important;
    color: var(--tech-text-primary) !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--tech-secondary) !important;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3) !important;
    outline: none !important;
}

.dataTables_wrapper .dataTables_filter label {
    color: var(--tech-text-primary) !important;
    font-weight: 600 !important;
    /*text-shadow: 0 0 8px rgba(0, 212, 255, 0.3) !important;*/
}

/* Sélecteur de longueur */
.dataTables_wrapper .dataTables_length select {
    background: rgba(26, 31, 58, 0.8) !important;
    border: 1px solid var(--tech-border) !important;
    color: var(--tech-text-primary) !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
}

.dataTables_wrapper .dataTables_length label {
    color: var(--tech-text-primary) !important;
    font-weight: 600 !important;
    /*text-shadow: 0 0 8px rgba(0, 212, 255, 0.3) !important;*/
}

/* Informations du tableau */
.dataTables_wrapper .dataTables_info {
    color: var(--tech-text-primary) !important;
    font-weight: 600 !important;
    /*text-shadow: 0 0 8px rgba(0, 212, 255, 0.3) !important;*/
    padding-top: 15px !important;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate {
    padding-top: 15px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: rgba(26, 31, 58, 0.8) !important;
    border: 1px solid var(--tech-border) !important;
    color: var(--tech-text-primary) !important;
    border-radius: 6px !important;
    margin: 0 2px !important;
    padding: 8px 12px !important;
    transition: all 0.3s ease !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--tech-primary) !important;
    border-color: var(--tech-secondary) !important;
    color: white !important;
    /*text-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;*/
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.4) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--tech-gradient) !important;
    border-color: var(--tech-secondary) !important;
    color: white !important;
    /*text-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;*/
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Classes spécialisées pour améliorer la lisibilité des contenus */
.dataTables_wrapper .table tbody td.badge-cell {
    font-weight: 700 !important;
    /*text-shadow: 0 0 12px rgba(255, 107, 53, 0.5) !important;*/
}

.dataTables_wrapper .table tbody td.status-cell {
    font-weight: 700 !important;
    /*text-shadow: 0 0 10px rgba(0, 255, 136, 0.5) !important;*/
}

.dataTables_wrapper .table tbody td.name-cell {
    font-weight: 700 !important;
    color: var(--tech-secondary) !important;
    /*text-shadow: 0 0 12px rgba(0, 212, 255, 0.6) !important;*/
    letter-spacing: 0.5px !important;
}

.dataTables_wrapper .table tbody td.numeric-cell {
    font-weight: 800 !important;
    color: var(--tech-accent) !important;
    /*text-shadow: 0 0 15px rgba(255, 107, 53, 0.7) !important;*/
    font-size: 1.1rem !important;
    letter-spacing: 1px !important;
}

.dataTables_wrapper .table tbody td.percentage-cell {
    font-weight: 800 !important;
    color: var(--tech-warning) !important;
    /*text-shadow: 0 0 12px rgba(255, 170, 0, 0.6) !important;*/
    font-size: 1.1rem !important;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.6); }
    100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.3); }
}

@keyframes subtle-glow {
    from {
        /*text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);*/
    }
    to {
        /*text-shadow: 0 0 12px rgba(0, 212, 255, 0.6);*/
    }
}

@keyframes delta-glow {
    0% {
        /*text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);*/
    }
    100% {
        /*text-shadow: 0 0 16px rgba(0, 212, 255, 0.8);*/
    }
}

/* ==========================================
   UTILITAIRES TECH
   ========================================== */

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

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

.text-tech-success {
    color: var(--tech-success) !important;
}

.text-tech-warning {
    color: var(--tech-warning) !important;
}

.text-tech-danger {
    color: var(--tech-danger) !important;
}

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

.bg-tech-gray {
    background: var(--tech-gray) !important;
}

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

.glow-tech {
    box-shadow: var(--tech-glow) !important;
}

