/* Хедер в одну строку: логотип + круглые кнопки (поиск / сообщения / тема / бургер).
   Файл подключается в common/header.blade.php (в body, после всех head-стилей),
   поэтому перекрывает базовые правила .header и тёмные правила бандла на равной специфичности. */

.header.header--round {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 96px;
    padding: 0;
    background: #fff;
}

.header--round .header__line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

/* Логотип: вписываем в одну строку (базовые 98px/75px не лезут в узкий хедер) */
.header--round .logo {
    display: flex;
    align-items: center;
    height: auto;
    margin: 0;
    overflow: visible;
}

.header--round .logo img {
    max-height: 64px;
    width: auto;
}

.header--round .header__round {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Круглые кнопки */
.header--round .round-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef2f8;
    color: #102544;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}

.header--round .round-btn:hover {
    background: #e0e8f4;
}

.header--round .round-btn svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Бургер: убираем иконочный шрифт старой кнопки, рисуем свои линии.
   button.hamburger — перекрытие старого правила .header button.hamburger (40px) */
.header--round .hamburger::before {
    content: none;
}

.header--round .hamburger,
.header--round button.hamburger {
    display: inline-flex;
    width: 48px;
    height: 48px;
}

/* Бейдж непрочитанных на «Сообщениях» */
.header--round .round-btn__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e82d14;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* Тема: одиночная круглая кнопка на всех ширинах (в бандле она мобильная) */
.header--round .theme-toggle-mini {
    display: inline-flex;
    width: 48px;
    height: 48px;
}

.header--round .theme-toggle-mini svg {
    width: 20px;
    height: 20px;
}

/* Выпадающая панель поиска */
.round-search {
    position: relative;
    display: inline-flex;
}

.round-search__panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 1200;
    width: min(430px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid #e2e8f2;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(20, 33, 61, 0.16);
    padding: 8px;
}

.round-search__panel form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.round-search__panel input {
    flex: 1 1 auto;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #d8e1f0;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    color: #102544;
    background: #fff;
    min-width: 0;
}

.round-search__panel input:focus {
    outline: none;
    border-color: #1268b3;
}

.round-search__panel button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #1268b3;
    color: #fff;
    cursor: pointer;
}

.round-search__panel button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

@media screen and (max-width: 767px) {
    .header.header--round {
        height: 72px;
    }

    .header--round .logo img {
        max-height: 48px;
    }

    /* Сообщения — только десктоп; на мобилке «Чаты» в нижней панели */
    .header--round .round-btn--messages {
        display: none;
    }

    .header--round .round-btn,
    .header--round button.hamburger {
        width: 42px;
        height: 42px;
    }

    .round-search__panel {
        position: fixed;
        top: 72px;
        left: 10px;
        right: 10px;
        width: auto;
    }
}

/* --- Тёмная тема --- */
html.dark .header.header--round {
    background: transparent;
}

html.dark .header--round .round-btn {
    background: #242b38;
    color: #edf2fb;
}

html.dark .header--round .round-btn:hover {
    background: #333c4d;
}

html.dark .round-search__panel {
    background: #181c25;
    border-color: #333c4d;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

html.dark .round-search__panel input {
    background: #242b38;
    border-color: #333c4d;
    color: #edf2fb;
}
