/* Headers - Josep CC Design System */

/* Base Page Header */
.page-header-base {
    padding: 60px 0;
    text-align: center;
    background: var(--light-blue);
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

/* Header Variants */
.page-header-gradient {
    background-image: linear-gradient(145deg, rgba(255, 107, 151, 0.08), rgba(138, 79, 189, 0.04), rgba(0, 217, 198, 0.08));
}

.page-header-primary {
    background: linear-gradient(135deg, rgba(255, 107, 151, 0.1), rgba(138, 79, 189, 0.08), rgba(0, 217, 198, 0.1));
}

.page-header-dark {
    background: var(--dark);
    color: var(--light);
}

.page-header-hero {
    padding: 100px 0;
    min-height: 60vh;
    min-height: 60dvh; /* Dynamic viewport height for newer browsers */
    display: flex;
    align-items: center;
}

/* Background Patterns */
.retro-grid-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: 
        linear-gradient(var(--secondary) 1px, transparent 1px), 
        linear-gradient(90deg, var(--secondary) 1px, transparent 1px);
    background-size: 35px 35px;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

.retro-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to bottom, rgba(247, 240, 250, 0.9), rgba(255, 255, 255, 0.95)),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300D9C6' fill-opacity='0.06'%3E%3Cpath d='M20 20c0-11.046-8.954-20-20-20v20h20zM0 20v20h20c0-11.046-8.954-20-20-20z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

.geometric-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to bottom, rgba(247, 240, 250, 0.9), rgba(255, 255, 255, 0.95)),
        url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238a4fbd' fill-opacity='0.08'%3E%3Cpath d='M20 20h20v20H20V20zm20 20h20v20H40V40zm0-20h20v20H40V20zM20 40h20v20H20V40z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

/* Scan Line Effect */
.scan-line-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, transparent 98%, rgba(0, 217, 198, 0.1) 100%);
    background-size: 100% 20px;
    animation: scan 2s linear infinite;
    z-index: 1;
    pointer-events: none;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, transparent 98%, rgba(0, 217, 198, 0.15) 100%);
    background-size: 100% 15px;
    animation: scan 3s linear infinite;
    z-index: 1;
    pointer-events: none;
}

/* Header Content Container */
.page-header-content {
    position: relative;
    z-index: 2;
    max-width: var(--container-lg);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Page Titles */
.page-title-base {
    font-family: var(--font-heading);
    font-size: var(--font-size-5xl);
    font-weight: 700;
    margin: 0 0 var(--spacing-md);
    color: var(--dark);
    line-height: var(--line-height-tight);
    letter-spacing: 1px;
}

.page-title-hero {
    font-size: var(--font-size-6xl);
    text-shadow: 3px 3px 0 rgba(255, 255, 255, 0.4);
}

.page-title-shadow {
    text-shadow: 2px 2px 0 rgba(45, 15, 69, 0.07);
}

.page-title-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Page Subtitles */
.page-subtitle-base {
    font-size: var(--font-size-xl);
    color: var(--medium);
    margin: 0 0 var(--spacing-xl);
    line-height: var(--line-height-relaxed);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-subtitle-large {
    font-size: var(--font-size-2xl);
    max-width: 900px;
}

/* Page Pretitle */
.page-pretitle {
    font-size: var(--font-size-sm);
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--spacing-md);
    display: block;
}

/* Page Meta Information */
.page-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md) var(--spacing-xl);
    color: var(--medium);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-lg);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.meta-icon {
    color: var(--primary);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.meta-label {
    font-weight: 600;
    color: var(--medium);
    text-transform: uppercase;
    font-size: var(--font-size-xs);
    letter-spacing: 0.5px;
    margin-right: var(--spacing-xs);
}

.meta-value {
    font-weight: 500;
    color: var(--dark);
    font-size: var(--font-size-sm);
}

/* Author Meta with Tooltip */
.meta-item.author-meta-item {
    position: relative;
}

.author-header-image {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--primary);
    cursor: pointer;
    margin-left: var(--spacing-xs);
}

.author-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark);
    color: var(--light);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 250px;
    z-index: var(--z-tooltip);
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.author-meta-item:hover .author-tooltip {
    visibility: visible;
    opacity: 1;
}

.tooltip-author-name {
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    font-weight: bold;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.tooltip-author-bio {
    margin-bottom: var(--spacing-md);
}

.tooltip-linkedin-link {
    display: inline-flex;
    align-items: center;
    color: var(--secondary);
    text-decoration: none;
    font-weight: bold;
}

.tooltip-linkedin-link:hover {
    text-decoration: underline;
}

/* Breadcrumbs in Header */
.breadcrumbs-header {
    margin-top: var(--spacing-lg);
}

.breadcrumbs-header ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    font-size: var(--font-size-sm);
    font-family: var(--font-heading);
    justify-content: center;
}

.breadcrumbs-header li a {
    color: var(--medium);
    text-decoration: none;
    transition: color var(--transition-normal);
    font-family: var(--font-heading);
    opacity: 0.8;
}

.breadcrumbs-header li a:hover {
    color: var(--primary);
    opacity: 1;
}

.breadcrumbs-header li + li::before {
    content: '>';
    margin: 0 var(--spacing-sm);
    color: var(--medium);
    font-family: var(--font-mono);
    font-size: var(--font-size-base);
    opacity: 0.6;
}

.breadcrumbs-header li.current {
    color: var(--dark);
    font-weight: 500;
    opacity: 0.8;
}

/* Glitch Effect for Special Text */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-text::before {
    animation: glitch-1 2s infinite;
    color: var(--primary);
    z-index: -1;
}

.glitch-text::after {
    animation: glitch-2 2s infinite;
    color: var(--secondary);
    z-index: -2;
}

/* Header CTAs */
.header-cta {
    margin-top: var(--spacing-2xl);
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

/* Header Stats */
.header-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-2xl);
    margin-top: var(--spacing-2xl);
    flex-wrap: wrap;
}

.header-stat {
    text-align: center;
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    border: 2px solid rgba(138, 79, 189, 0.1);
    box-shadow: var(--shadow-md);
}

.header-stat-number {
    display: block;
    font-size: var(--font-size-4xl);
    font-weight: bold;
    color: var(--primary);
    font-family: var(--font-heading);
}

.header-stat-label {
    font-size: var(--font-size-sm);
    color: var(--medium);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: var(--spacing-xs);
}

/* Responsive Header Styles */
@media (max-width: 992px) {
    .page-header-base {
        padding: 50px 0;
    }
    
    .page-title-base {
        font-size: var(--font-size-4xl);
    }
    
    .page-title-hero {
        font-size: var(--font-size-5xl);
    }
    
    .page-subtitle-base {
        font-size: var(--font-size-lg);
    }
    
    .header-stats {
        gap: var(--spacing-lg);
    }
    
    .header-cta {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .page-header-base {
        padding: 40px 0;
    }
    
    .page-header-hero {
        padding: 60px 0;
        min-height: 50vh;
        min-height: 50dvh; /* Dynamic viewport height for newer browsers */
    }
    
    .page-title-base {
        font-size: var(--font-size-3xl);
    }
    
    .page-title-hero {
        font-size: var(--font-size-4xl);
    }
    
    .page-subtitle-base {
        font-size: var(--font-size-base);
    }
    
    .page-meta {
        justify-content: center;
        gap: var(--spacing-md);
    }
    
    .meta-item {
        text-align: center;
    }
    
    .breadcrumbs-header ol {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .author-tooltip {
        width: 200px;
        left: 10px;
        transform: none;
    }
}