/* ===== CHECKPOINT HEADER - STILE UNIFICATO PER TUTTE LE VISTE ===== */

/* ===== VARIABILI CSS ===== */
:root {
    --checkpoint-primary-color: #6366f1;
    --checkpoint-primary-dark: #4f46e5;
    --checkpoint-primary-light: #818cf8;
    --checkpoint-secondary-color: #8b5cf6;
    --checkpoint-success-color: #10b981;
    --checkpoint-error-color: #ef4444;
    --checkpoint-warning-color: #f59e0b;
    --checkpoint-text-primary: #1f2937;
    --checkpoint-text-secondary: #6b7280;
    --checkpoint-text-tertiary: #9ca3af;
    --checkpoint-bg-primary: #ffffff;
    --checkpoint-bg-secondary: #f9fafb;
    --checkpoint-bg-tertiary: #f3f4f6;
    --checkpoint-border-color: #e5e7eb;
    --checkpoint-border-light: #f3f4f6;
    --checkpoint-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --checkpoint-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --checkpoint-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --checkpoint-radius-sm: 8px;
    --checkpoint-radius-md: 12px;
    --checkpoint-radius-lg: 16px;
    --checkpoint-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== HEADER PRINCIPALE ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--checkpoint-border-color, #e5e7eb);
    padding: 1rem 2rem;
    box-shadow: var(--checkpoint-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    gap: 2rem;
    flex-wrap: wrap;
}

/* ===== SEZIONE SINISTRA: Logo, titolo e info checkpoint ===== */
.header-left-section {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    min-width: 0;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
}

.platform-logo {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    filter: brightness(0.95);
}

.title-content h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--checkpoint-text-primary, #1f2937);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    letter-spacing: -0.01em;
}

.title-content h1 i {
    color: var(--checkpoint-primary-color, #6366f1);
    font-size: 1.15rem;
}

/* Descrizioni checkpoint accanto al logo e titolo */
.header-checkpoint-descriptions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: 1rem;
}

.checkpoint-description-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--checkpoint-text-secondary, #6b7280);
    font-weight: 500;
}

.checkpoint-description-item i {
    color: var(--checkpoint-primary-color, #6366f1);
    font-size: 0.85rem;
}

.checkpoint-description-item span {
    white-space: nowrap;
}

/* ===== BOTTONE TORNA INDIETRO ===== */
.header-back-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.back-btn-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--checkpoint-bg-secondary, #f9fafb);
    border: 1.5px solid var(--checkpoint-border-color, #e5e7eb);
    color: var(--checkpoint-text-primary, #1f2937);
    border-radius: var(--checkpoint-radius-sm, 8px);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--checkpoint-transition, all 0.2s cubic-bezier(0.4, 0, 0.2, 1));
}

.back-btn-header:hover {
    background: var(--checkpoint-bg-tertiary, #f3f4f6);
    border-color: var(--checkpoint-primary-color, #6366f1);
    color: var(--checkpoint-primary-color, #6366f1);
    transform: translateY(-1px);
    box-shadow: var(--checkpoint-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
}

.back-btn-header i {
    font-size: 0.875rem;
}

.back-btn-header span {
    white-space: nowrap;
}

/* ===== STATUS E INFO CHECKPOINT ===== */
.header-status-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 1rem;
}

.header-status-section .info-btn {
    background: rgba(101, 113, 255, 0.1);
    border: 1px solid rgba(101, 113, 255, 0.2);
    color: var(--checkpoint-primary-color, #6366f1);
    border-radius: var(--checkpoint-radius-sm, 8px);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: var(--checkpoint-transition, all 0.2s ease);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.header-status-section .info-btn:hover {
    background: rgba(101, 113, 255, 0.2);
    border-color: var(--checkpoint-primary-color, #6366f1);
    transform: translateY(-1px);
}

.header-status-section .wardrobe-scanner-btn.info-btn {
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
    max-width: none !important;
    max-height: none !important;
}

.header-status-section .gift-delivery-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    background-color: var(--checkpoint-success-color, #10b981);
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: var(--checkpoint-radius-sm, 8px);
    font-size: 0.875rem;
    font-weight: 500;
}

.header-status-section .status-badge {
    padding: 0.4rem 0.75rem;
    border-radius: var(--checkpoint-radius-sm, 8px);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.header-status-section .status-badge.status-active {
    background: var(--checkpoint-success-color, #10b981);
    color: white;
}

.header-status-section .status-badge.status-inactive {
    background: var(--checkpoint-error-color, #ef4444);
    color: white;
}

.header-status-section .refresh-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    animation: checkpoint-spin 1s linear infinite;
}

@keyframes checkpoint-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== MENU HAMBURGER ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: auto;
}

.hamburger-menu {
    position: relative;
}

.hamburger-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--checkpoint-radius-md, 12px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    cursor: pointer;
    transition: var(--checkpoint-transition, all 0.3s ease);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-size: 1.2rem;
}

.hamburger-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.hamburger-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--checkpoint-radius-lg, 16px);
    box-shadow: var(--checkpoint-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05));
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
    z-index: 1001;
}

.hamburger-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--checkpoint-radius-sm, 8px);
    cursor: pointer;
    transition: var(--checkpoint-transition, all 0.2s ease);
    color: var(--checkpoint-text-primary, #1f2937);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--checkpoint-bg-secondary, #f9fafb);
    color: var(--checkpoint-primary-color, #6366f1);
}

.dropdown-item.logout-item {
    color: var(--checkpoint-error-color, #ef4444);
}

.dropdown-item.logout-item:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--checkpoint-error-color, #ef4444);
}

.dropdown-item.install-pwa-item {
    color: var(--checkpoint-primary-color, #6366f1);
}

.dropdown-item.install-pwa-item.installed {
    cursor: default;
    opacity: 0.7;
    color: var(--checkpoint-text-secondary, #6b7280);
}

.dropdown-divider {
    height: 1px;
    background: var(--checkpoint-border-color, #e5e7eb);
    border: none;
    margin: 0.5rem 0;
}

/* Banner ambiente (staging/local) – sotto header-content, solo se !production */
.main-header .env-banner {
    display: block;
    width: 100%;
    margin: 0.5rem 0 0 0;
    padding: 0.4rem 0;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #ea580c;
    color: #fff;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Versione app in fondo al menu hamburger */
.dropdown-version {
    font-size: 0.75rem;
    color: var(--checkpoint-text-tertiary, #9ca3af);
    padding: 0.5rem 1rem;
    text-align: center;
    margin-top: 0.25rem;
    border-top: 1px solid var(--checkpoint-border-light, #f3f4f6);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-header {
        padding: 1rem 1.5rem;
    }
    
    .header-content {
        gap: 1rem;
    }
    
    .header-left-section {
        gap: 1.25rem;
    }
    
    .platform-logo {
        height: 28px;
        max-width: 100px;
    }
    
    .title-content h1 {
        font-size: 1rem;
    }
    
    .header-checkpoint-descriptions {
        gap: 1rem;
    }
    
    .checkpoint-description-item {
        font-size: 0.85rem;
    }
    
    .header-status-section {
        gap: 0.625rem;
        margin-right: 0.75rem;
    }
    
    .header-status-section .status-badge {
        font-size: 0.8rem;
        padding: 0.35rem 0.625rem;
    }
    
    .back-btn-header {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .header-left-section {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-title {
        gap: 0.5rem;
        flex: 1;
        min-width: 0;
    }
    
    .platform-logo {
        height: 24px;
        max-width: 80px;
    }
    
    .title-content h1 {
        font-size: 0.9rem;
    }
    
    .header-checkpoint-descriptions {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-left: 0;
    }
    
    .header-back-section {
        width: 100%;
        order: 3;
        margin-top: 0.75rem;
        padding-top: 1rem;
        border-top: 1px solid var(--checkpoint-border-light, #f3f4f6);
    }
    
    .back-btn-header {
        width: 100%;
        justify-content: center;
    }
    
    .header-actions {
        order: 2;
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
    
    .header-status-section {
        gap: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .header-status-section .info-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .header-status-section .status-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .hamburger-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 0.5rem 0.75rem;
    }
    
    .header-content {
        gap: 0.75rem;
    }
    
    .platform-logo {
        height: 20px;
        max-width: 60px;
    }
    
    .title-content h1 {
        font-size: 0.85rem;
    }
    
    .title-content h1 i {
        font-size: 1rem;
    }
    
    .header-status-section {
        gap: 0.375rem;
        margin-right: 0.375rem;
    }
    
    .header-status-section .info-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .header-status-section .status-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .hamburger-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .hamburger-dropdown {
        min-width: 180px;
        right: 0;
    }
}

