/* ====================================
   HEADER STYLES
   ==================================== */

:root {
    --color-primary: #005068;
    --gradient-primary: linear-gradient(135deg, #003d5c 0%, #00546b 100%);
}

/* Rendre de l'espace pour le header fixed */
body {
    padding-top: 105px;
}

/* Header Container */
.header {
    background: var(--gradient-primary);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 5px 20px;
    gap: 40px;
    width: 100%;
    margin: 0 auto;
}

/* Logo */
.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 60px;
    width: auto;
    display: block;
}

/* Navigation Bar */
.navbar {
    flex: 1;
}

.nav-menu {
    display: flex;
    flex-direction: row;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
    align-items: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 12px;
    transition: all 0.3s ease;
    display: block;
    border-radius: 4px;
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-menu a:active,
.nav-menu a:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* User Profile Section */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.user-info-popup {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 1100;
    display: none;
    width: max-content;
    min-width: 300px;
    max-width: min(460px, 88vw);
    padding: 15px 17px;
    border: 1px solid rgba(0, 80, 104, 0.12);
    border-radius: 12px;
    background: linear-gradient(145deg, #fff 0%, #f4fafb 100%);
    box-shadow: 0 14px 34px rgba(0, 42, 56, 0.24), 0 3px 8px rgba(0, 42, 56, 0.08);
    color: #263b42;
    white-space: normal;
    transform-origin: top right;
    animation: user-info-popup-in 150ms ease-out;
}

.user-info-popup::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 20px;
    width: 13px;
    height: 13px;
    border-top: 1px solid rgba(0, 80, 104, 0.12);
    border-left: 1px solid rgba(0, 80, 104, 0.12);
    background: #fff;
    transform: rotate(45deg);
}

@keyframes user-info-popup-in {
    from { opacity: 0; transform: translateY(-5px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-info.user-info-popup-open .user-info-popup {
    display: block;
}

.user-info-popup-row {
    display: grid;
    grid-template-columns: minmax(112px, auto) minmax(0, 1fr);
    gap: 14px;
    padding: 7px 8px;
    border-bottom: 1px solid rgba(0, 80, 104, 0.08);
    font-size: 0.84rem;
    line-height: 1.4;
}

.user-info-popup-row:last-child {
    border-bottom: 0;
}

.user-info-popup-row strong {
    color: #005068;
    font-weight: 650;
}

.user-info-popup-row span {
    overflow-wrap: anywhere;
    color: #334b52;
}

.user-language-control {
    min-width: 0;
}

.user-language-control select {
    width: 100%;
    min-width: 125px;
    padding: 7px 30px 7px 10px;
    border: 1px solid #c7d8dd;
    border-radius: 7px;
    background: #fff;
    color: #263b42;
    font: inherit;
    cursor: pointer;
}

.user-language-control select:focus {
    outline: 2px solid rgba(0, 125, 143, .25);
    border-color: #007d8f;
}

.user-language-control select:disabled {
    opacity: .65;
    cursor: wait;
}

.user-language-status {
    display: block;
    min-height: 1em;
    margin-top: 3px;
    color: #60757d;
    font-size: .75rem;
}

@media (max-width: 520px) {
    .user-info-popup {
        position: fixed;
        top: 72px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .user-info-popup::before {
        right: 24px;
    }
}

.user-avatar {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
}

.user-role {
    font-size: 0.75rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-role i {
    font-size: 0.75rem;
}

/* Buttons */
.btn-logout,
.btn-login {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 4px;
    color: white;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-logout:hover,
.btn-login:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.btn-logout:active,
.btn-login:active {
    transform: scale(0.98);
}

.btn-logout i,
.btn-login i {
    font-size: 1rem;
}

/* Container */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 0rem 1rem;
    margin-top: 0px;
}

/* ====================================
   DROPDOWN MENU
   ==================================== */

.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.dropdown-toggle::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid white;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: rgba(0, 80, 104, 0.98);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
    padding: 0;
}

.dropdown-menu a {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    padding-left: 20px;
}

.dropdown-menu a i {
    font-size: 0.9rem;
    width: 16px;
}

.recent-trials-menu-list {
    max-height: 60vh;
    overflow-y: auto;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .header-content {
        padding: 15px 20px;
        gap: 20px;
    }

    .nav-menu {
        gap: 10px;
        flex-wrap: wrap;
    }

    .nav-menu a {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .logo img {
        max-height: 50px;
    }

    .user-profile {
        gap: 10px;
    }

    .user-info {
        padding: 6px 10px;
        gap: 8px;
    }

    .user-info i {
        font-size: 1.25rem;
    }

    .user-avatar {
        width: 42px;
        height: 42px;
    }

    .user-name {
        font-size: 0.9rem;
    }

    .user-role {
        font-size: 0.7rem;
    }

    .btn-logout,
    .btn-login {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .header-content {
        padding: 12px 15px;
        gap: 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar {
        width: 100%;
    }

    .nav-menu {
        gap: 8px;
        width: 100%;
    }

    .nav-menu a {
        font-size: 0.85rem;
        padding: 5px 8px;
    }

    .logo img {
        max-height: 45px;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
    }

    .user-info {
        flex: 1;
        padding: 5px 8px;
        gap: 6px;
    }

    .user-info i {
        font-size: 1.1rem;
    }

    .user-avatar {
        width: 38px;
        height: 38px;
    }

    .user-details {
        gap: 2px;
    }

    .user-name {
        font-size: 0.8rem;
    }

    .user-role {
        font-size: 0.65rem;
    }

    .btn-logout,
    .btn-login {
        padding: 5px 8px;
        font-size: 0.8rem;
        gap: 5px;
    }

    .btn-logout i,
    .btn-login i {
        font-size: 0.9rem;
    }
}

/* ====================================
   ACCESSIBILITY
   ==================================== */

/* Focus visible pour la navigation */
.nav-menu a:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    border-radius: 3px;
}

.logo .logo-text {
  margin: 0px;
  font-family: "Fredoka", sans-serif;
 font-weight: 700;
font-size: 15px;
color:white
}

.span-default-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 28px;
    padding: 0px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.12);
    color: white;
    font-size: 0.78rem;
}

.span-default-info span {
    display: inline-flex;
    gap: 7px;
}

.span-default-info i {
    opacity: 0.75;
    font-style: normal;
}

.span-default-info strong {
    font-weight: 600;
}

@media (max-width: 480px) {
    body { padding-top: 145px; }
    .span-default-info { gap: 6px 14px; font-size: 0.72rem; }
}
