/**
 * Matoo Header Elements - Styles
 * Stile ispirato a Vinted con colori brand Matoo
 * 
 * Brand Colors:
 * - Primary: #5E6A60 (verde salvia scuro)
 * - Secondary: #86A97A (verde salvia chiaro)
 * - Accent: #007B20 (verde brillante)
 * - Text: #414141
 * - Light BG: #E1DBCB
 */

/* ===== CONTAINER PRINCIPALE ===== */
.matoo-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.matoo-header-logged-in,
.matoo-header-logged-out {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== STATO NON LOGGATO ===== */

/* Pulsante Iscriviti | Accedi */
.matoo-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 10px;
    border: 2px solid #5E6A60;
    border-radius: 6px;
    background: transparent;
    color: #5E6A60;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.matoo-auth-btn:hover {
    background: #5E6A60;
    color: #fff!important;
    text-decoration: none;
}

.matoo-auth-separator {
    color: inherit;
    opacity: 0.5;
}

/* ===== PULSANTE + VENDI ===== */
.matoo-sell-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 10px;
    background: #5E6A60;
    color: #fff;
    font-size: 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.matoo-sell-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.matoo-sell-btn span {
    line-height: 1;
}

.matoo-sell-btn:hover {
    background: #4a544c;
    color: #fff!important;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(94, 106, 96, 0.3);
}

/* ===== STATO LOGGATO - ICONE ===== */
.matoo-header-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.matoo-header-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #414141;
    border-radius: 50%;
    transition: all 0.2s ease;
    text-decoration: none;
}

.matoo-header-icon:hover {
    background: #f5f5f5;
    color: #5E6A60;
    text-decoration: none;
}

.matoo-header-icon svg {
    width: 22px;
    height: 22px;
}

/* Badge notifiche */
.matoo-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ===== DROPDOWN ACCOUNT ===== */
.matoo-account-dropdown {
    position: relative;
}

.matoo-account-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    background: transparent;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.matoo-account-trigger:hover {
    background: #f5f5f5;
}

.matoo-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #E1DBCB;
    border-radius: 50px!important;
}

.matoo-dropdown-arrow {
    color: #414141;
    transition: transform 0.2s ease;
}

.matoo-account-trigger[aria-expanded="true"] .matoo-dropdown-arrow {
    transform: rotate(180deg);
}

/* Menu dropdown */
.matoo-account-menu-wrapper {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.matoo-account-dropdown.is-open .matoo-account-menu-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.matoo-account-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.matoo-account-menu li {
    margin: 0;
}

.matoo-account-menu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: #414141;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.matoo-account-menu li a:hover {
    background: #f8f8f8;
    color: #5E6A60;
}

/* Voce con valore (es. Saldo) */
.matoo-menu-value {
    font-weight: 600;
    color: #5E6A60;
}

/* Voce logout */
.matoo-menu-logout {
    border-top: 1px solid #eee;
    margin-top: 8px;
    padding-top: 8px;
}

.matoo-menu-logout a {
    color: #888;
}

.matoo-menu-logout a:hover {
    color: #e74c3c;
}

/* ===== HELP BUTTON ===== */
.matoo-header-help {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #414141;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
}

.matoo-header-help:hover {
    border-color: #5E6A60;
    color: #5E6A60;
    text-decoration: none;
}

.matoo-header-help svg {
    width: 20px;
    height: 20px;
}

/* ===== LANGUAGE SWITCHER ===== */
.matoo-language-switcher {
    position: relative;
}

.matoo-lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #414141;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.matoo-lang-btn:hover {
    color: #5E6A60;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .matoo-header-actions {
        gap: 4px;
    }
    
    .matoo-auth-btn {
        font-size: 13px;
    }
    
    .matoo-sell-btn {
        font-size: 13px;
    }
    
    .matoo-header-icon {
        width: 40px;
        height: 40px;
    }
    
    .matoo-header-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 767px) {
    .matoo-header-logged-in,
    .matoo-header-logged-out {
        gap: 4px;
    }
    
    /* Nascondi testo su mobile, mostra solo icone */
    .matoo-auth-btn .matoo-auth-register,
    .matoo-auth-btn .matoo-auth-separator {
        display: none;
    }
    
    .matoo-auth-btn {
    }
    
    /* Su mobile mostra solo + senza testo */
    .matoo-sell-btn span {
        display: none;
    }
    
    .matoo-sell-btn {
        gap: 0;
    }
    
    .matoo-header-help {
        display: none;
    }
    
    .matoo-user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .matoo-dropdown-arrow {
        display: none;
    }
}

/* ===== ANIMAZIONI ===== */
@keyframes matoo-badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.matoo-badge.is-new {
    animation: matoo-badge-pulse 0.3s ease;
}


/* Avatar SVG default */
.matoo-user-avatar-default {
    border-radius: 50%;
    border: 2px solid #E1DBCB;
    overflow: hidden;
}