.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.header-logo {
    flex-shrink: 0;
}

.header-search {
    width: 260px;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid #4a6080;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.header-search:focus-within {
    border-color: #e01a3f;
    background: rgba(255,255,255,0.15);
}

.header-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 14px;
    padding: 10px 16px;
}

.header-search input::placeholder {
    color: #8a9cb5;
}

.header-search button {
    background: transparent;
    border: none;
    border-left: 1px solid #4a6080;
    color: #8a9cb5;
    cursor: pointer;
    padding: 10px 16px;
    transition: all 0.2s;
}

.header-search button:hover {
    color: #e01a3f;
}

.header-user {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 19px;
    line-height: 1;
    transition: color 0.2s, background-color 0.2s, transform 0.2s;
}

.theme-toggle:hover {
    color: white;
    background: rgba(255,255,255,0.15);
}

.theme-toggle:focus-visible {
    outline: 2px solid #e01a3f;
    outline-offset: 2px;
}

.theme-toggle:active {
    transform: scale(0.92);
}

.user-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================ */
/* УВЕДОМЛЕНИЯ — ИКОНКА В ШАПКЕ (КРУГЛАЯ) */
/* ============================================ */
.header-notifications {
    position: relative;
    display: flex;
    align-items: center;
}

.notif-icon {
    position: relative;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.notif-icon:hover {
    color: white;
    background: rgba(255,255,255,0.15);
}

.notif-icon i {
    font-size: 20px;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e01a3f;
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #1a2535;
    line-height: 1;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #4a6080;
}

.user-menu-trigger:hover {
    background: rgba(255,255,255,0.2);
    border-color: #e01a3f;
}

.user-avatar-mini {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e01a3f;
}

.user-avatar-mini i {
    font-size: 28px;
    color: #ebebeb;
}

.user-info-mini {
    display: flex;
    flex-direction: column;
}

.user-info-mini .username {
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.user-info-mini .user-balance {
    font-size: 11px;
    color: #9aafc5;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-menu-trigger .fa-chevron-down {
    color: #8a9cb5;
    font-size: 12px;
    transition: transform 0.2s;
}

.user-menu-trigger.active .fa-chevron-down {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2);
    overflow: hidden;
    z-index: 1000;
    display: none;
}

.user-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #1a2a3f;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: #e01a3f;
}

.dropdown-item i {
    width: 20px;
    color: #5a6a80;
}

.dropdown-item:hover i {
    color: #e01a3f;
}

.dropdown-item.logout {
	width: 100%;
	text-align: left;
	font: inherit;
	border-left: 0;
	border-right: 0;
	border-bottom: 0;
	background: transparent;
	cursor: pointer;
	border-top: 1px solid #e2e8f0;
	color: #e01a3f;
}

.dropdown-logout-form { margin: 0; }

.dropdown-item.logout i {
    color: #e01a3f;
}

.auth-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
}

.btn-register-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(255,255,255,0.1);
    border: 1px solid #4a6080;
    border-radius: 40px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-register-header:hover {
    background: rgba(255,255,255,0.2);
    border-color: #e01a3f;
}

.btn-login-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(255,255,255,0.1);
    border: 1px solid #4a6080;
    border-radius: 40px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-login-header:hover {
    background: rgba(255,255,255,0.2);
    border-color: #e01a3f;
}

/* ============================================ */
/* МОБИЛЬНАЯ АДАПТАЦИЯ */
/* ============================================ */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: center;
        padding: 12px 16px;
        gap: 12px;
    }
    
    .header-logo {
        align-self: center;
    }
    
    .header-search {
        width: 100%;
        order: 2;
    }
    
    .header-user {
        width: 100%;
        order: 1;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .user-menu-wrapper {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .auth-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .btn-register-header,
    .btn-login-header {
        flex: 1;
        justify-content: center;
        max-width: 150px;
    }
    
    .user-menu-trigger {
        justify-content: center;
        padding: 6px 16px;
    }
    
    .user-info-mini {
        display: none;
    }
    
    .user-avatar-mini i {
        font-size: 24px;
    }
    
    .notif-icon {
        width: 36px;
        height: 36px;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        font-size: 17px;
    }
    
    .notif-icon i {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .btn-register-header,
    .btn-login-header {
        max-width: 130px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .btn-register-header span,
    .btn-login-header span {
        display: inline;
        font-size: 11px;
    }

    .btn-register-header i,
    .btn-login-header i {
        margin-right: 4px;
    }

    .notif-icon {
        width: 32px;
        height: 32px;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        font-size: 15px;
    }
    
    .notif-icon i {
        font-size: 15px;
    }
}
