/**
 * Lenny Food Delivery - Header
 * Stili per l'header dell'applicazione
 */

/* Header superiore con posizione fissa */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    background-color: white;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
    transition: left 0.3s ease, width 0.3s ease;
    width: calc(100% - var(--sidebar-width));
}

/* Pattern decorativo per il background */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z' fill='%23ffffff' fill-opacity='1' fill-rule='evenodd'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    border-radius: 0 0 16px 16px;
}

.header > div {
    position: relative;
    z-index: 1;
}

/* Contenitore per le icone nella navbar - stile quadrato con gradiente */
.navbar-icon-container {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 5px rgba(255, 90, 95, 0.3);
    transition: var(--transition-base);
    position: relative;
}

.navbar-icon-container:hover {
    box-shadow: 0 4px 8px rgba(255, 90, 95, 0.4);
    transform: translateY(-1px);
}

.navbar-icon {
    font-size: 1.2rem;
    color: white;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Layout e posizionamento del header */
.sidebar-collapsed ~ .main-content .header {
    left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* Stili per il saluto utente */
.greeting-container {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--border-radius);
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.greeting-container:hover {
    background-color: var(--color-grey-100);
}

.user-greeting {
    font-weight: 700;
    color: var(--color-grey-800);
    font-size: 1.3rem;
}

.user-greeting-name {
    font-weight: 800;
    color: var(--color-primary);
    position: relative;
    font-size: 1.4rem;
}

.user-greeting-name:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: right;
}

.greeting-container:hover .user-greeting-name:after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Pulsante mobile menu */
.btn-mobile-menu {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-grey-100);
    border: none;
    border-radius: var(--border-radius);
    color: var(--color-grey-700);
    cursor: pointer;
    margin-right: 1rem;
    font-size: var(--font-size-lg);
    transition: var(--transition-base);
}

.btn-mobile-menu:hover {
    background-color: var(--color-grey-200);
    color: var(--color-grey-900);
}

/* Stili per titolo pagina */
.page-title {
    display: flex;
    align-items: center;
}

.page-icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius);
    margin-right: 0.75rem;
    font-size: var(--font-size-lg);
    box-shadow: var(--shadow-primary);
}

.header h1 {
    font-size: var(--font-size-xxl);
    font-weight: 800;
    margin: 0;
    color: var(--color-grey-800);
}

/* Ricerca nell'header */
.header-search {
    margin-right: 1rem;
}

.search-wrapper {
    position: relative;
    width: 240px;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: none;
    border-radius: var(--border-radius-pill);
    background-color: var(--color-grey-100);
    color: var(--color-grey-800);
    transition: var(--transition-base);
}

.search-input:focus {
    outline: none;
    background-color: white;
    box-shadow: var(--shadow-sm);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-grey-500);
    pointer-events: none;
}

/* Azioni nell'header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-item {
    position: relative;
    margin-left: 5px;
}

.action-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: var(--transition-base);
}

/* Stili per il profilo utente nell'header */
.user-btn {
    display: flex;
    align-items: center;
    padding: 4px 8px 4px 4px;
    background-color: transparent;
    border-radius: var(--border-radius);
    transition: var(--transition-base);
}

.user-btn:hover {
    background-color: var(--color-grey-100);
}

.user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    box-shadow: 0 2px 5px rgba(255, 90, 95, 0.3);
}

.user-name {
    font-weight: 600;
    margin-right: 8px;
    color: var(--color-grey-800);
}

/* Stili per il badge delle notifiche e animazione */
.notification-icon-wrapper {
    position: relative;
}

.notification-badge {
    background: #00d68f;
    color: white;
    border-radius: 50%;
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 214, 143, 0.5);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(0, 214, 143, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 214, 143, 0);
    }
}

/* Stili specifici per il dropdown delle notifiche */
.notification-dropdown-body {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background-color: rgba(255, 90, 95, 0.05);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: white;
}

.notification-content {
    flex-grow: 1;
}

.notification-text {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-grey-800);
}

.notification-time {
    font-size: 0.75rem;
    color: var(--color-grey-500);
}

/* Media queries per l'header */
@media (max-width: 991.98px) {
    .header {
        left: 0;
        width: 100%;
    }
    
    body.sidebar-show .header {
        left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
    
    .header-search {
        display: none;
    }
}

@media (max-width: 576px) {
    .header {
        padding: 0 1rem;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .user-name {
        display: none;
    }
}

/* Fix specifici per dispositivi molto piccoli */
@media (max-width: 370px) {
    .notification-icon-wrapper, 
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .header-search {
        display: none;
    }
}