/*
 * Modern Dashboard Hero Section Styles
 * A unified, modernized hero component for all dashboards
 * Following 2024 design trends: glassmorphism, subtle animations, dynamic backgrounds
 */

/* ===========================
   CSS Custom Properties
   =========================== */
:root {
    /* Hero Color Themes - Override these in individual dashboard CSS */
    --hero-primary: #1e3a5f;
    --hero-secondary: #2d5a87;
    --hero-accent: #3d7ab5;
    --hero-text: #ffffff;
    --hero-text-muted: rgba(255, 255, 255, 0.85);
    
    /* Animation speeds */
    --hero-transition: 0.3s ease;
    --hero-animation-slow: 20s;
}

/* ===========================
   Hero Container
   =========================== */
.dashboard-hero-modern {
    position: relative;
    background: linear-gradient(135deg, var(--hero-primary) 0%, var(--hero-secondary) 50%, var(--hero-accent) 100%);
    color: var(--hero-text);
    padding: 3rem 2rem 2.5rem;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animated background pattern */
.dashboard-hero-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.04) 0%, transparent 40%);
    animation: heroBackgroundPulse var(--hero-animation-slow) ease-in-out infinite;
    pointer-events: none;
}

/* Geometric pattern overlay */
.dashboard-hero-modern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(30deg, rgba(255, 255, 255, 0.02) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.02) 87.5%, rgba(255, 255, 255, 0.02)),
        linear-gradient(150deg, rgba(255, 255, 255, 0.02) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.02) 87.5%, rgba(255, 255, 255, 0.02)),
        linear-gradient(30deg, rgba(255, 255, 255, 0.02) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.02) 87.5%, rgba(255, 255, 255, 0.02)),
        linear-gradient(150deg, rgba(255, 255, 255, 0.02) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.02) 87.5%, rgba(255, 255, 255, 0.02));
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px;
    opacity: 0.5;
    pointer-events: none;
}

@keyframes heroBackgroundPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* ===========================
   Hero Content Container
   =========================== */
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===========================
   Breadcrumb Navigation
   =========================== */
.hero-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--hero-text-muted);
}

.hero-breadcrumb a {
    color: var(--hero-text-muted);
    text-decoration: none;
    transition: color var(--hero-transition);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.hero-breadcrumb a:hover {
    color: var(--hero-text);
}

.hero-breadcrumb svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.hero-breadcrumb .separator {
    opacity: 0.5;
}

.hero-breadcrumb .current {
    font-weight: 500;
    color: var(--hero-text);
}

/* ===========================
   Hero Header Section
   =========================== */
.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.hero-title-group {
    flex: 1;
    min-width: 280px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-badge svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--hero-text-muted);
    margin: 0;
    max-width: 600px;
    line-height: 1.5;
}

/* ===========================
   Hero Actions
   =========================== */
.hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--hero-transition);
    border: none;
    text-decoration: none;
}

.hero-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.hero-btn-primary {
    background: rgba(255, 255, 255, 0.95);
    color: var(--hero-primary);
}

.hero-btn-primary:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--hero-text);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===========================
   Hero Stats Cards
   =========================== */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.hero-stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all var(--hero-transition);
}

.hero-stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
}

.hero-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.hero-stat-icon svg {
    width: 18px;
    height: 18px;
    fill: var(--hero-text);
}

.hero-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: var(--hero-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.hero-stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.hero-stat-change.positive {
    background: rgba(46, 204, 113, 0.2);
    color: #7dffb3;
}

.hero-stat-change.negative {
    background: rgba(231, 76, 60, 0.2);
    color: #ff9b93;
}

.hero-stat-change svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* ===========================
   Location Indicator
   =========================== */
.hero-location {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-location svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.hero-location strong {
    font-weight: 600;
}

/* State Link in Location Badge */
.location-badge .state-link,
.hero-location .state-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.location-badge .state-link:hover,
.hero-location .state-link:hover {
    text-decoration-style: solid;
    opacity: 0.9;
}

/* ===========================
   Scope Toggle (County/State)
   =========================== */
.hero-scope-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-left: 1rem;
}

.hero-scope-label {
    font-size: 0.85rem;
    color: var(--hero-text-muted);
    font-weight: 500;
}

.scope-toggle-switch {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.scope-toggle-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--hero-text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--hero-transition);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.scope-toggle-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.scope-toggle-btn.active {
    background: rgba(255, 255, 255, 0.95);
    color: var(--hero-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.scope-toggle-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--hero-text);
}

/* Scope indicator badge */
.hero-scope-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--hero-text-muted);
}

.hero-scope-indicator.scope-county {
    background: rgba(76, 175, 80, 0.2);
    color: #a5d6a7;
}

.hero-scope-indicator.scope-state {
    background: rgba(33, 150, 243, 0.2);
    color: #90caf9;
}

/* ===========================
   Quick Links (optional)
   =========================== */
.hero-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-quick-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--hero-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: all var(--hero-transition);
}

.hero-quick-link:hover {
    color: var(--hero-text);
    background: rgba(255, 255, 255, 0.1);
}

.hero-quick-link svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ===========================
   Dashboard-Specific Themes
   =========================== */

/* Homeowners - Cool blue-gray */
.dashboard-hero-modern.theme-homeowners {
    --hero-primary: #4a5c6d;
    --hero-secondary: #5a6b7d;
    --hero-accent: #6c7a89;
}

/* Architects - Steel blue */
.dashboard-hero-modern.theme-architects {
    --hero-primary: #5a6b7d;
    --hero-secondary: #6b7c8e;
    --hero-accent: #7d8b9b;
}

/* Climate Enthusiasts - Teal */
.dashboard-hero-modern.theme-climate {
    --hero-primary: #0d7377;
    --hero-secondary: #14919b;
    --hero-accent: #28b5b5;
}

/* Investors - Sage green */
.dashboard-hero-modern.theme-investors {
    --hero-primary: #5a6b5d;
    --hero-secondary: #6b7c6e;
    --hero-accent: #7d8b7f;
}

/* Insurers - Slate */
.dashboard-hero-modern.theme-insurers {
    --hero-primary: #6b7d8b;
    --hero-secondary: #7c8e9b;
    --hero-accent: #8b9ba9;
}

/* ESG Officers - Forest green */
.dashboard-hero-modern.theme-esg {
    --hero-primary: #2e7d32;
    --hero-secondary: #388e3c;
    --hero-accent: #43a047;
}

/* Municipal Planners - Purple */
.dashboard-hero-modern.theme-municipal {
    --hero-primary: #7d6b8b;
    --hero-secondary: #8d7b9b;
    --hero-accent: #9d8bab;
}

/* Researchers - Deep blue */
.dashboard-hero-modern.theme-researchers {
    --hero-primary: #1e3a5f;
    --hero-secondary: #2d5a87;
    --hero-accent: #3d7ab5;
}

/* Generalists - Navy blue */
.dashboard-hero-modern.theme-generalists {
    --hero-primary: #1e3a5f;
    --hero-secondary: #2d5a87;
    --hero-accent: #3d7ab5;
}

/* Private Companies - Corporate blue */
.dashboard-hero-modern.theme-companies {
    --hero-primary: #1e3a5f;
    --hero-secondary: #2d5a87;
    --hero-accent: #3d7ab5;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
    .dashboard-hero-modern {
        padding: 2.5rem 1.5rem 2rem;
    }
    
    .hero-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .hero-actions {
        width: 100%;
    }
    
    .hero-btn {
        flex: 1;
        justify-content: center;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-location-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .hero-scope-toggle {
        margin-left: 0;
        width: 100%;
    }
    
    .scope-toggle-switch {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .dashboard-hero-modern {
        padding: 1.75rem 1rem 1.5rem;
    }
    
    .hero-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }
    
    .hero-stat-card {
        padding: 0.875rem;
    }
    
    .hero-stat-value {
        font-size: 1.15rem;
    }
    
    .hero-stat-label {
        font-size: 0.7rem;
    }
    
    .hero-breadcrumb {
        font-size: 0.75rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hero-btn {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .hero-location-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hero-zip-input {
        width: 100%;
    }
    
    .hero-submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .scope-toggle-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .hero-scope-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .dashboard-hero-modern {
        padding: 1.25rem 0.875rem 1.25rem;
    }
    
    .hero-title {
        font-size: 1.35rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .hero-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
    }
    
    .hero-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .hero-stat-card {
        padding: 0.75rem 0.5rem;
    }
    
    .hero-stat-icon {
        width: 28px;
        height: 28px;
        margin-bottom: 0.375rem;
    }
    
    .hero-stat-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .hero-stat-value {
        font-size: 1rem;
    }
    
    .hero-stat-label {
        font-size: 0.65rem;
        line-height: 1.2;
    }
    
    .hero-quick-links {
        gap: 0.375rem;
        margin-top: 0.875rem;
        padding-top: 0.875rem;
        flex-wrap: wrap;
    }
    
    .hero-quick-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
    
    .hero-btn {
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .hero-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .scope-toggle-btn {
        padding: 0.4rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .scope-toggle-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .location-badge {
        font-size: 0.8rem;
        padding: 0.375rem 0.625rem;
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .hero-btn,
    .scope-toggle-btn,
    .hero-submit-btn,
    .hero-quick-link {
        min-height: 44px;
    }
    
    .hero-zip-input {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ===========================
   Utility Classes
   =========================== */
.hero-hidden {
    display: none !important;
}

.hero-loading .hero-stat-value {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    animation: heroStatPulse 1.5s ease-in-out infinite;
}

@keyframes heroStatPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Print styles */
@media print {
    .dashboard-hero-modern {
        background: #333 !important;
        padding: 1rem;
    }
    
    .dashboard-hero-modern::before,
    .dashboard-hero-modern::after {
        display: none;
    }
    
    .hero-actions {
        display: none;
    }
}
