/* ========= HERO HEADER - REUSABLE COMPONENT ========= */
/* 
   Use this for page hero sections that need edge-to-edge appearance
   with the .event-hero class as specified in layout guidelines.
   
   Usage:
   <section class="hero-section">
       <div class="hero-container">
           <section class="hero-header event-hero">
               ...content...
           </section>
       </div>
   </section>
*/

/* Section wrapper with responsive padding */
.hero-section {
    padding: 0.75rem;
}

@media (min-width: 768px) {
    .hero-section {
        padding: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .hero-section {
        padding: 2rem;
    }
}

/* Container with max-width */
.hero-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Hero header with edge-to-edge effect */
.hero-header.event-hero {
    margin-top: -0.75rem;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    margin-bottom: 2.5rem;
    border-radius: 0;
    padding: clamp(1.75rem, 4vw, 3rem);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 768px) {
    .hero-header.event-hero {
        margin-top: -1.5rem;
        margin-left: -1.5rem;
        margin-right: -1.5rem;
    }
}

@media (min-width: 1200px) {
    .hero-header.event-hero {
        margin-top: -2rem;
        margin-left: -2rem;
        margin-right: -2rem;
    }
}

/* Default gradient using CSS custom properties */
.hero-header.event-hero {
    --hero-gradient-start: #667eea;
    --hero-gradient-end: #764ba2;
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    color: #ffffff;
}

/* Theme variations using data attributes */
.hero-header.event-hero[data-theme="events"] {
    --hero-gradient-start: #2a7be4;
    --hero-gradient-end: #764ba2;
}

.hero-header.event-hero[data-theme="planning"] {
    --hero-gradient-start: #27ae60;
    --hero-gradient-end: #229954;
}

.hero-header.event-hero[data-theme="groups"] {
    --hero-gradient-start: #9b59b6;
    --hero-gradient-end: #8e44ad;
}

.hero-header.event-hero[data-theme="vehicles"] {
    --hero-gradient-start: #f59e0b;
    --hero-gradient-end: #d97706;
}

.hero-header.event-hero[data-theme="finance"] {
    --hero-gradient-start: #2ecc71;
    --hero-gradient-end: #27ae60;
}

.hero-header.event-hero[data-theme="circuit"] {
    --hero-gradient-start: #e67e22;
    --hero-gradient-end: #d35400;
}

/* Image background support */
.hero-header.event-hero[data-background="image"] {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.hero-header.event-hero[data-background="image"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(0, 0, 0, 0.5) 50%, 
        rgba(0, 0, 0, 0.7) 100%);
    border-radius: inherit;
    pointer-events: none;
}

.hero-header.event-hero[data-background="image"] .hero-header__content,
.hero-header.event-hero[data-background="image"] .hero-header__stats {
    position: relative;
    z-index: 1;
}

/* Hero content structure */
.hero-header__content {
    flex: 1 1 320px;
    min-width: 260px;
}

.hero-header__eyebrow {
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.hero-header__title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.hero-header__copy {
    color: rgba(255, 255, 255, 0.85);
    max-width: 540px;
    line-height: 1.5;
}

.hero-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Hero stats section */
.hero-header__stats {
    flex: 0 0 280px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    backdrop-filter: blur(6px);
}

.hero-stat__value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.hero-stat__label {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.25rem;
}

/* Mobile optimization for stats */
@media (max-width: 767px) {
    .hero-header__stats {
        flex: 1 0 100%;
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.5rem;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        padding-bottom: 0.25rem;
    }
    
    .hero-header__stats::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .hero-stat {
        flex: 0 0 auto;
        min-width: 90px;
        padding: 0.75rem 1rem;
        border-radius: 12px;
    }
    
    .hero-stat__value {
        font-size: 1.35rem;
    }
    
    .hero-stat__label {
        font-size: 0.65rem;
        margin-top: 0.15rem;
    }
}

@media (max-width: 575px) {
    .hero-header.event-hero {
        gap: 1.25rem;
    }
    
    .hero-stat {
        min-width: 80px;
        padding: 0.6rem 0.75rem;
    }
    
    .hero-stat__value {
        font-size: 1.2rem;
    }
    
    .hero-stat__label {
        font-size: 0.6rem;
        letter-spacing: 0.05em;
    }
}

/* ========= STICKY HEADER STYLES ========= */
/* Sticky header that appears when scrolling past hero */
.hero-sticky-header {
    position: fixed;
    top: var(--phoenix-navbar-top-height);
    left: 0;
    right: 0;
    /* Default gradient - uses same CSS custom properties as hero header */
    --hero-gradient-start: #667eea;
    --hero-gradient-end: #764ba2;
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme variations for sticky header - match hero header themes exactly */
.hero-sticky-header[data-theme="events"] {
    --hero-gradient-start: #2a7be4;
    --hero-gradient-end: #764ba2;
}

.hero-sticky-header[data-theme="planning"] {
    --hero-gradient-start: #27ae60;
    --hero-gradient-end: #229954;
}

.hero-sticky-header[data-theme="groups"] {
    --hero-gradient-start: #9b59b6;
    --hero-gradient-end: #8e44ad;
}

.hero-sticky-header[data-theme="vehicles"] {
    --hero-gradient-start: #f59e0b;
    --hero-gradient-end: #d97706;
}

.hero-sticky-header[data-theme="finance"] {
    --hero-gradient-start: #2ecc71;
    --hero-gradient-end: #27ae60;
}

.hero-sticky-header[data-theme="circuit"] {
    --hero-gradient-start: #e67e22;
    --hero-gradient-end: #d35400;
}

.hero-sticky-header.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.hero-sticky-header__container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.hero-sticky-header__left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
    flex: 1;
}

.hero-sticky-header__icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-sticky-header__info {
    min-width: 0;
    flex: 1;
}

.hero-sticky-header__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.2rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.hero-sticky-header__subtitle {
    font-size: 0.8rem;
    opacity: 0.85;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.hero-sticky-header__stats {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.hero-sticky-stat {
    text-align: center;
}

.hero-sticky-stat__value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.hero-sticky-stat__label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-top: 0.15rem;
}

.hero-sticky-header__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Mobile responsive for sticky header */
@media (max-width: 991px) {
    .hero-sticky-header__stats {
        display: none;
    }
}

@media (max-width: 575px) {
    .hero-sticky-header {
        padding: 0.75rem 1rem;
    }

    .hero-sticky-header__left {
        gap: 0.85rem;
    }

    .hero-sticky-header__icon {
        width: 36px;
        height: 36px;
    }

    .hero-sticky-header__title {
        font-size: 0.95rem;
    }

    .hero-sticky-header__subtitle {
        font-size: 0.75rem;
    }

    .hero-sticky-stat__value {
        font-size: 1rem;
    }
}

/* ========= STICKY HEADER — TAB ROW ========= */
/* Optional second row rendered when a page passes HeroStickyTabsHtml via HttpContext.Items */
.hero-sticky-header__tabs-row {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    padding-bottom: 0.1rem;
}

.finance-sticky-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.finance-sticky-tabs::-webkit-scrollbar {
    display: none;
}

.finance-sticky-tabs button {
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.35rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.finance-sticky-tabs button i {
    font-size: 1.1rem;
}

.finance-sticky-tabs button.active,
.finance-sticky-tabs button:hover {
    color: #fff;
    border-bottom-color: #fff;
}

/* ========= LEGACY VARIANT CLASSES (DEPRECATED) ========= */
/* These are kept for backward compatibility but should use data-theme instead */
.hero-header.event-hero--blue {
    --hero-gradient-start: #3498db;
    --hero-gradient-end: #2980b9;
}

.hero-header.event-hero--orange {
    --hero-gradient-start: #e67e22;
    --hero-gradient-end: #d35400;
}

.hero-header.event-hero--purple {
    --hero-gradient-start: #9b59b6;
    --hero-gradient-end: #8e44ad;
}
