:root {
    --vert-fonce: #003e00;
    --vert-principal: #006400;
    --vert-clair: #e8f5e9;
    --blanc: #ffffff;
    --vert-footer: #007700;
    --police-principale: 'Josefin Sans', 'Open Sans', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--police-principale), serif;
    background-color: var(--vert-clair);
    margin: 0;
    padding-top: 70px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nom-avec-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.badge-certifie {
    color: #27ae60 !important;
    font-size: 0.9em;
    cursor: help;
    position: relative;
    display: inline-block;
}

.badge-certifie::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background-color: #1e293b;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
    z-index: 999;
    font-family: var(--police-principale), sans-serif;
}

.badge-certifie:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}



.global-nav {
    background-color: var(--vert-principal);
    height: 70px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.nav-logo {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: 5px;
}

.nav-search {
    width: 280px;
}

.search-form-live {
    background-color: #f0f2f5;
    border-radius: 20px;
    padding: 2px 15px;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: 32px;
    background: none;
    border: none;
    outline: none;
    font-size: 14px;
    color: #1c1e21;
}

.nav-right {
    display: flex;
    align-items: center;
}

.nav-right ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-right li a,
.nav-right .nav-btn-logout {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    padding: 0 14px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-weight: 400;
    font-size: 11px;
    transition: color 0.2s, border-bottom 0.2s;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.nav-right li a:hover,
.nav-right li a.active,
.nav-right .nav-btn-logout:hover {
    color: var(--blanc);
    background-color: transparent;
    border-bottom: 2px solid var(--blanc);
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
}

.conv-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #eeeeee;
}

.conv-item:last-child {
    border-bottom: none;
}

.conv-item:hover, .conv-item.active {
    border-bottom-color: transparent;
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin-left: 12px;
    flex-shrink: 0;
}

.nav-hamburger span {
    display: block;
    height: 3px;
    background-color: var(--blanc);
    border-radius: 3px;
    transition: 0.3s;
}

.nav-link-badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-green {
    position: absolute;
    top: -3px;
    right: -5px;
    width: 9px;
    height: 9px;
    background-color: #99dc9b;
    border-radius: 50%;
    border: 1.5px solid var(--vert-principal);
    z-index: 10;
}

.search-wrapper {
    position: relative;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-label {
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
}

.nav-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-form {
    display: flex;
    align-items: stretch;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    overflow: hidden;
    min-width: 300px;
}

.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.search-dropdown-item:hover {
    background: #f5f5f5;
}

.search-dropdown-item img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.search-dropdown-item .item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a1a;
}

.search-dropdown-item .item-role {
    font-size: 0.78rem;
    color: #888;
}

.search-dropdown-footer {
    padding: 10px 16px;
    border-top: 1px solid #eee;
    text-align: center;
}

.search-dropdown-footer a {
    display: inline-block;
    background-color: var(--vert-clair);
    color: var(--vert-principal);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}

.search-dropdown-footer a:hover {
    background-color: var(--vert-principal);
    color: var(--blanc);
}

.search-dropdown-loading {
    padding: 12px 16px;
    color: #888;
    font-size: 0.85rem;
    text-align: center;
}

.search-dropdown-empty {
    padding: 12px 16px;
    color: #888;
    font-size: 0.85rem;
    text-align: center;
}

.search-dropdown-content {
    max-height: 400px;
    overflow-y: auto;
}

.comment-author-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.comment-date {
    font-size: 12px;
    color: #888888;
    margin-top: 2px;
}

@media (max-width: 896px) {
    body { padding-top: 70px; }

    .global-nav {
        height: auto;
        flex-wrap: wrap;
        padding: 0 15px;
        align-items: center;
    }

    .nav-left {
        height: 70px;
        flex: 1;
        min-width: 0;
    }

    .nav-hamburger { display: flex; }

    .nav-right {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-right.open { max-height: 400px; }

    .nav-right ul {
        flex-direction: column;
        padding: 6px 0 10px;
        gap: 2px;
        align-items: flex-start;
    }

    .nav-right li {
        width: 100%;
    }

    .nav-right li form {
        width: 100%;
        margin: 0;
    }

    .nav-right li a,
    .nav-right .nav-btn-logout {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        height: 48px;
        padding: 0 18px;
        font-size: 14px;
        font-weight: 500;
        color: var(--blanc);
        border-bottom: none;
        border-radius: 8px;
        width: 100%;
    }

    .nav-icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        opacity: 0.9;
    }

    .nav-label {
        font-size: 14px;
        font-weight: 500;
    }

    .nav-link-badge {
        justify-content: flex-start !important;
    }

    .nav-icon-wrapper .badge-red {
        top: -4px;
        right: -6px;
        left: auto;
    }

    .nav-right li a:hover,
    .nav-right li a.active,
    .nav-right .nav-btn-logout:hover {
        background-color: rgba(255, 255, 255, 0.15);
        border-bottom: none;
    }

    .content-wrapper { padding: 10px !important; }
    .results-grid { grid-template-columns: 1fr !important; }
    .app-container { flex-direction: column; }
    .sidebar { width: 100% !important; height: auto; }
    .chat-bubble { max-width: 85% !important; }
}