/**
 * Step Banner + Compact Header
 * UX Premium Fullstack
 */

/* ========================================
   STEP BANNER - Barre d'étape compacte
   ======================================== */
.step-banner {
    position: sticky;
    background: linear-gradient(135deg, #2859CC 0%, #1e40af 100%);
    color: white;
    padding: 0;
    z-index: 999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin: 0 !important;
    margin-top: 0 !important;
}

.step-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    gap: 10px;
    min-height: 52px;
}

.step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.step-info h3,
.step-info .step-info-title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
}

.step-info p {
    margin: 0;
    font-size: 10px;
    opacity: 0.75;
    line-height: 1.1;
}

.step-progress {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
    overflow: hidden;
    flex-shrink: 0;
}

.step-progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: progressSlide 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes progressSlide {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 100%;
        opacity: 1;
    }
}

/* ========================================
   PAGE HEADER - Compact Premium
   ======================================== */
.page-header {
    padding: 8px 16px !important;
    margin: 0 0 24px 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Cache page-header sur mobile */
@media (max-width: 768px) {
    .page-header {
        display: none !important;
    }
    
    /* =============================================
       WEBAPP INTEGRATION - Native App Effect
       ============================================= */
    
    /* Mobile Header - Part 1 of the fused top bar */
    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: linear-gradient(135deg, #2859CC 0%, #1e40af 100%);
        margin: 0 !important;
        margin-bottom: 0 !important;
        padding: 8px 16px !important;
        border-bottom: none !important;
        box-shadow: none;
        height: auto;
    }
    
    /* Step Banner - Part 2 of the fused top bar - UNIVERSAL FOR ALL STEPS */
    .step-panel[data-step="1"] > .step-banner,
    .step-panel[data-step="2"] > .step-banner,
    .step-panel[data-step="3"] > .step-banner,
    .step-banner {
        position: sticky !important;
        top: calc(32px + 16px) !important; /* logo height (32px) + padding (8px*2) */
        z-index: 999 !important;
        background: linear-gradient(135deg, #2859CC 0%, #1e40af 100%) !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
        margin: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        margin-left: -16px !important;
        margin-right: -16px !important;
        padding: 0 !important;
        border-top: none !important;
        width: calc(100% + 32px) !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure step-banner content has consistent padding for ALL steps */
    .step-panel[data-step="1"] > .step-banner .step-banner-content,
    .step-panel[data-step="2"] > .step-banner .step-banner-content,
    .step-panel[data-step="3"] > .step-banner .step-banner-content,
    .step-banner .step-banner-content {
        padding: 10px 16px !important;
        margin: 0 !important;
    }
    
    /* Spacing after step-banner, before content */
    .step-panel {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* UNIFORM SPACING - 24px after all step-banners */
    
    /* For categories (Step 1) */
    .step-panel > .step-banner + .page-header + .categories {
        margin-top: 24px !important;
    }
    
    .page-header + .categories {
        margin-top: 24px !important;
    }
    
    /* For selected-badge (Step 2) */
    .step-panel > .step-banner + .selected-badge {
        margin-top: 24px !important;
    }
    
    .step-panel > .page-header + .selected-badge {
        margin-top: 24px !important;
    }
    
    /* For calendar (Step 3) - SPECIFIC TARGETING */
    .step-panel[data-step="3"] .calendar-desktop {
        margin-top: 24px !important;
    }
    
    .step-panel[data-step="3"] .mobile-view {
        margin-top: 24px !important;
        padding-top: 24px !important;
    }
    
    .step-panel[data-step="3"] .calendar {
        margin-top: 24px !important;
        padding-top: 24px !important;
    }
    
    .step-panel[data-step="3"] .calendar-layout {
        margin-top: 24px !important;
    }
    
    /* For form sections (Step 4) */
    .step-panel > .step-banner + .mobile-wizard {
        margin-top: 24px !important;
    }
    
    .step-panel > .page-header + .mobile-wizard {
        margin-top: 24px !important;
    }
    
    /* For summary (Step 5) */
    .step-panel > .step-banner + .summary-layout {
        margin-top: 24px !important;
    }
    
    .step-panel > .page-header + .summary-layout {
        margin-top: 24px !important;
    }
}

.page-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDownSubtle 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes slideDownSubtle {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    min-height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    color: #2859CC !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    flex-shrink: 0;
}

.page-header h1 {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 0 1px 0 !important;
    line-height: 1.2 !important;
}

.page-header p {
    font-size: 11px !important;
    color: #9ca3af !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    font-weight: 400;
}

.page-header-content > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    /* Header compact sur mobile */
    .page-header {
        padding: 8px 16px !important;
        display: none !important;
    }
    
    .page-icon {
        width: 32px !important;
        height: 32px !important;
    }
    
    .page-header h1 {
        font-size: 16px !important;
    }
    
    .page-header p {
        font-size: 11px !important;
    }
    
    /* WebApp - Step Banner Mobile Refinements */
    .step-info {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    .step-badge {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    .step-progress {
        display: none;
    }
}

@media (min-width: 769px) {
    /* Cache step banner sur desktop */
    .step-banner {
        display: none !important;
    }
    
    /* Page header premium sur desktop */
    .page-header {
        padding: 24px 32px !important;
        margin: 0 !important;
        background: linear-gradient(135deg, rgba(40, 89, 204, 0.03) 0%, rgba(30, 64, 175, 0.02) 100%);
        border-bottom: 1px solid rgba(40, 89, 204, 0.1);
    }
    
    .page-header-content {
        gap: 16px;
    }
    
    /* Icon desktop - plus grand et plus visible */
    .page-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 24px !important;
        background: linear-gradient(135deg, #2859CC 0%, #1e40af 100%) !important;
        color: white !important;
        box-shadow: 0 4px 12px rgba(40, 89, 204, 0.15) !important;
    }
    
    /* Header légèrement plus grand sur desktop */
    .page-header h1 {
        font-size: 28px !important;
        font-weight: 800 !important;
        letter-spacing: -0.5px;
    }
    
    .page-header p {
        font-size: 14px !important;
        color: #6b7280 !important;
    }
    
    /* Texte container avec spacing */
    .page-header-content > div:last-child {
        gap: 4px;
    }
    
    /* Animation au chargement */
    .page-header {
        animation: slideDownDesktop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }
    
    @keyframes slideDownDesktop {
        from {
            opacity: 0;
            transform: translateY(-12px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}
