/* DOUKANI - Navbar Styles - Fichier séparé pour meilleure maintenance
 * Styles extraits de index.html pour les modals hover et navbar
 */

 /* Navbar en haut */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #1a1a1a;
    text-decoration: none;
}

.logo-svg {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.features-navbar {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
}

.nav-btn:hover {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border-bottom-color: #2563eb;
    transform: translateY(-1px);
}

.nav-btn i {
    font-size: 1rem;
}

/* Modal au hover - VERSION PROFESSIONNELLE SANS SCROLLBAR */
.nav-btn:hover + .modal-hover,
.modal-hover:hover {
    display: block;
    opacity: 1;
    visibility: visible;
}

.modal-hover {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1001;
    min-width: 350px;
    max-width: 500px; /* Réduit pour éviter débordement */
    width: max-content; /* S'adapte au contenu */
    max-width: min(500px, 90vw); /* Maximum 500px ou 90% de la largeur d'écran */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: hidden; /* Empêche tout débordement */
}

.modal-hover-content {
    padding: 1.25rem;
}

.modal-hover-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.modal-hover-header h3 {
    font-family: var(--font-heading);
    font-size: 1.125rem; /* Remettre taille normale */
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: var(--letter-spacing-normal);
    line-height: var(--line-height-tight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.modal-hover-body {
    font-family: var(--font-primary);
    color: #666666;
    line-height: 1.5;
    font-size: 0.8125rem;
    letter-spacing: var(--letter-spacing-normal);
    font-weight: 400;
    max-height: 180px;
    overflow: hidden;
}

.modal-hover-body p {
    margin-bottom: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-hover-body ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.modal-hover-body li {
    padding: 0.375rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.875rem; /* Remettre taille normale */
}

.modal-hover-body li:last-child {
    border-bottom: none;
}

.modal-hover-body strong {
    color: #1a1a1a;
    font-weight: 600;
    letter-spacing: var(--letter-spacing-normal);
}

/* CTA Button */
.cta-section {
    text-align: center;
    margin-top: 2rem;
}

.btn-login {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Tous les modals sont centrés par défaut */
.nav-btn .modal-hover {
    left: 50%;
    transform: translateX(-50%);
}

/* Pour les boutons de droite : positionner à droite du bouton pour éviter débordement */
.nav-btn[data-modal="reports"] .modal-hover,
.nav-btn[data-modal="devices"] .modal-hover {
    left: auto;
    right: 0;
    transform: none;
    /* Le modal s'ouvre vers la gauche depuis le bouton */
}

@media (max-width: 768px) {
    .modal-hover {
        max-width: 90vw !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }
}

/* Responsive pour un affichage propre sur mobile */
@media (max-width: 768px) {
    .top-navbar {
        padding: 1rem;
        height: auto;
        flex-direction: column;
        gap: 1rem;
    }

    .features-navbar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .nav-btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }

    .modal-hover {
        left: 0;
        right: 0;
        transform: none;
        margin-top: 0.25rem;
        min-width: auto;
        max-width: calc(100vw - 1rem);
        width: calc(100vw - 1rem);
        position: fixed;
        top: auto;
        bottom: 1rem;
        margin-top: 0;
    }

    .modal-hover-content {
        padding: 1rem;
    }

    .modal-hover-header h3 {
        font-size: 0.95rem;
    }

    .modal-hover-body {
        font-size: 0.75rem;
        max-height: 140px;
    }

    .modal-hover-body li {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .top-navbar {
        padding: 0.75rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .logo-svg {
        width: 35px;
        height: 35px;
    }

    .modal-hover {
        max-width: calc(100vw - 0.5rem);
        width: calc(100vw - 0.5rem);
        bottom: 0.5rem;
    }

    .modal-hover-content {
        padding: 0.875rem;
    }

    .modal-hover-body {
        max-height: 120px;
    }
}
