/* 4.2. Zone de recherche, connexion, utilisateur et contrôles header */
.search-login-container {
    grid-column: 3;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 20px;
    gap: 15px;
}
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px; /* espace entre icône et bouton */
}
.search-button {
    position: relative;
    color: var(--color-text);
    padding: 8px;
    background-color: #142736;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.search-button:hover {
    background-color: #1c364b;
}
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 26, 34, 0.95);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: var(--z-index-search);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding-top: 100px;
}
.search-overlay.active {
    opacity: 1;
    visibility: visible;
}
.search-form-container {
    width: 90%;
    max-width: 600px;
    position: relative;
}
.search-form {
    display: flex;
    gap: 10px;
    background-color: #142736;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid var(--color-accent);
}
.search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 18px;
    padding: 5px 10px;
    outline: none;
}
.search-input::placeholder {
    color: #999;
}
.search-submit,
.search-close {
    background: none;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    padding: 5px 10px;
    font-size: 18px;
    transition: color 0.3s ease;
}
.search-submit:hover,
.search-close:hover {
    color: var(--color-accent-light);
}

/* Login Button */
.login-button {
    white-space: nowrap;
    font-size: 1em;
    position: relative;
    color: var(--color-text);
    text-decoration: none;
    padding: 8px 16px;
    background-color: #142736;
    border: none;
    z-index: 1;
}
.login-button:before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #fb0094, #0000ff, #00ff00, #ffff00, #ff0000, #fb0094);
    background-size: 400%;
    z-index: -1;
    animation: steam 10s linear infinite;
    border-radius: 4px;
}
.login-button:after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    background: #142736;
    border-radius: 3px;
    z-index: -1;
}

/* Menu utilisateur */
.user-menu-container {
    position: relative;
}
.avatar-container {
    cursor: pointer;
    position: relative;
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    background-color: #142736;
    transition: border-color 0.3s;
}
.user-avatar:hover {
    border-color: var(--color-accent);
}
.avatar-unread-counter {
    position: absolute;
    bottom: -5px;
    right: -5px;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #142736;
    border-radius: 4px;
    padding: 8px 0;
    margin-top: 10px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.dropdown-menu:before {
    content: '';
    position: absolute;
    top: -5px;
    right: 20px;
    width: 10px;
    height: 10px;
    background-color: #142736;
    transform: rotate(45deg);
}
.menu-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--color-text);
    text-decoration: none;
    transition: background-color 0.3s;
    white-space: nowrap;
}
.menu-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}
.menu-item:hover {
    background-color: #1c364b;
}
.dropdown-menu .menu-item .unread-messages-counter {
    margin-left: 5px;
}

/* Contrôles du son */
#sound-controls {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--header-height);
  overflow: visible; 
}
#btn-mute {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0;
}
#volume-slider {
  display: block !important;
  position: absolute;
  top: calc(50% + 15px);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 100;
}
#sound-controls:hover #volume-slider,
#sound-controls.volume-open #volume-slider {
  opacity: 1;
  visibility: visible;
}

/* Theme Switcher */
#theme-toggle-button.theme-switch {
    display: inline-flex;
    align-items: center;
    width: 110px;
    height: 40px;
    border-radius: 20px;
    padding: 5px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.4s ease, border-color 0.4s ease;
    box-sizing: border-box;
    border: 1px solid transparent;
    flex-shrink: 0;
    overflow: hidden;
}
.theme-switch-thumb {
    width: 30px;
    height: 30px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 1px 1px rgba(0,0,0,0.14);
    z-index: 10;
    overflow: hidden;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease;
}
.theme-switch-icon {
    font-size: 14px;
    line-height: 1;
    display: block;
    text-align: center;
    transition: color 0.3s ease;
}
.theme-switch-label {
    width: 100%;
    font-size: 10px;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    user-select: none;
    transition: color 0.3s ease;
    line-height: 30px;
    box-sizing: border-box;
}
#theme-toggle-button.theme-switch.light-active {
    background: linear-gradient(135deg, #FFDA77, #FFAC5D);
    border-color: #FFC400;
}
#theme-toggle-button.theme-switch.light-active .theme-switch-label {
    color: #624D2B;
    text-align: left;
    padding-left: 8px;
    padding-right: 40px;
}
#theme-toggle-button.theme-switch.light-active .theme-switch-thumb {
    left: calc(110px - 30px - 5px); /* 75px */
}
#theme-toggle-button.theme-switch.light-active .theme-switch-icon {
    color: #E67E22;
}
#theme-toggle-button.theme-switch.dark-active {
    background: linear-gradient(135deg, #3D3399, #6A11CB);
    border-color: #531289;
}
#theme-toggle-button.theme-switch.dark-active .theme-switch-label {
    color: #E0E0FF;
    text-align: right;
    padding-right: 8px;
    padding-left: 40px;
}
#theme-toggle-button.theme-switch.dark-active .theme-switch-thumb {
    left: 5px;
}
#theme-toggle-button.theme-switch.dark-active .theme-switch-icon {
    color: #C4A6FF;
}