/* ============================================
   MODULE: hero
   PURPOSE: Homepage hero section with optional search bar or CTAs
   ACTIVATION: site.engine.modules.hero
   COMPLEXITY: HIGH
   RISK: HIGH
   ============================================ */

/*
 * TECHNICAL DEBT (Phase 1.5):
 * The following hardcoded values will be migrated to design tokens in Phase 2:
 * - 85vh, 90px, 60px (sizing)
 * - 4rem, 3rem, 2.25rem (headline font sizes)
 * - #FDF8F3 (helper row background)
 * - #F5F5F5, #EFEFEF (search field backgrounds)
 * - #000000, #333333 (search button)
 * - #25D366, #20bd5a (WhatsApp CTA)
 * - #1E3A5F, #2A4A73 (checkbox/apply button)
 * - rgba values (overlays, shadows)
 * - 10px, 16px, 12px (border radii)
 */

.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    margin-top: -90px;
    padding: 90px 0 50px 0; /* Override global section padding - top accounts for header, bottom for search bar */
}

.hero-media {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.hero-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/assets/media/hero-bg.jpg') center/cover no-repeat;
    background-color: var(--color-arctic);
}

/* Hero Image Slider */
.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding-top: var(--space-12);
    padding-bottom: var(--space-8);
}

.hero-headline {
    font-size: 4rem;
    font-weight: var(--font-bold);
    font-style: normal;
    color: var(--color-white);
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-align: left;
    max-width: 700px;
    margin: 0 0 var(--space-4) 0;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-tagline {
    font-size: var(--text-xl);
    font-weight: var(--font-normal);
    color: var(--color-white);
    line-height: 1.5;
    max-width: 600px;
    margin: 0;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
    opacity: 0.95;
}

/* ============================================
   Hero CTA Buttons - For simple hero (no search bar)
   ============================================ */
.hero-simple {
    padding-bottom: var(--space-12);
}

.hero-simple .hero-content {
    align-items: center;
    text-align: center;
}

.hero-simple .hero-headline,
.hero-simple .hero-tagline {
    text-align: center;
    max-width: 800px;
}

.hero-ctas {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-6);
    flex-wrap: wrap;
    justify-content: center;
}

.hero-cta-primary,
.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    border-radius: 10px;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    text-decoration: none;
    transition: all var(--transition-normal);
}

.hero-cta-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light, var(--color-primary)) 100%);
    color: var(--color-white);
}

.hero-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    color: var(--color-white);
}

.hero-cta-secondary {
    background: #25D366;
    color: var(--color-white);
}

.hero-cta-secondary:hover {
    background: #20bd5a;
    transform: translateY(-2px);
    color: var(--color-white);
}

@media (max-width: 768px) {
    .hero-ctas {
        flex-direction: column;
        align-items: center;
        gap: var(--space-3);
    }

    .hero-cta-primary,
    .hero-cta-secondary {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* ============================================
   Hero Search Bar - Nordic Visitor Style
   ============================================ */
.hero-search-bar {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
    width: calc(100% - var(--space-8) * 2);
    max-width: var(--container-2xl);
    z-index: 10;
}

.search-bar-inner {
    display: flex;
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-white);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.1);
}

/* Helper Row */
.search-helper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background-color: #FDF8F3;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
}

.helper-text {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.helper-callback {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.helper-callback:hover {
    opacity: 0.8;
}

.helper-callback svg {
    flex-shrink: 0;
}

.search-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    padding: var(--space-4) var(--space-4);
    background-color: #F5F5F5;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 60px;
}

.search-field:hover {
    background-color: #EFEFEF;
}

.search-field.active {
    border-color: var(--color-arctic);
    background-color: var(--color-white);
}

.search-field-text {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--color-gray-600);
}

.search-field-icon {
    color: var(--color-gray-500);
    flex-shrink: 0;
    order: 2;
    margin-left: var(--space-2);
}

.search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    color: var(--color-white);
    padding: var(--space-4) var(--space-6);
    border-radius: 10px;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
    min-height: 60px;
}

.search-btn:hover {
    background-color: #333333;
}

/* ============================================
   Search Dropdowns - Checkbox Style
   ============================================ */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 260px;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 100;
    overflow: hidden;
}

.search-field.active .search-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: var(--space-4) var(--space-4) var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-gray-100);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    font-size: var(--text-base);
    color: var(--color-text-primary);
    transition: background-color var(--transition-fast);
    position: relative;
}

.dropdown-item:hover {
    background-color: var(--color-frost);
}

.dropdown-item .item-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.dropdown-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.dropdown-item .checkmark {
    position: relative;
    margin-left: auto;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-gray-300);
    border-radius: 4px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.dropdown-item .checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.dropdown-item input[type="checkbox"]:checked ~ .checkmark {
    background-color: #1E3A5F;
    border-color: #1E3A5F;
}

.dropdown-item input[type="checkbox"]:checked ~ .checkmark::after {
    display: block;
}

.dropdown-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-gray-100);
    background-color: var(--color-frost);
}

.btn-clear {
    background: none;
    border: none;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-gray-600);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-clear:hover {
    color: var(--color-text-primary);
}

.btn-apply {
    background-color: #1E3A5F;
    border: none;
    padding: var(--space-2) var(--space-5);
    border-radius: 6px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-white);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.btn-apply:hover {
    background-color: #2A4A73;
}

/* Travelers Dropdown */
.travelers-dropdown {
    min-width: 280px;
}

.traveler-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-gray-100);
}

.traveler-row:last-of-type {
    border-bottom: none;
}

.traveler-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.traveler-type {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
}

.traveler-desc {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
}

.traveler-counter {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.counter-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--color-gray-300);
    background: var(--color-white);
    color: var(--color-text-primary);
    font-size: var(--text-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.counter-btn:hover {
    border-color: #1E3A5F;
    color: #1E3A5F;
}

.counter-value {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    min-width: 24px;
    text-align: center;
    color: var(--color-text-primary);
}

/* Tablet */
@media (max-width: 1024px) {
    .hero-headline {
        font-size: 3rem;
    }

    .search-bar-inner {
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .search-field {
        flex: 0 0 calc(50% - var(--space-1));
    }

    .search-btn {
        flex: 1 1 100%;
        margin-top: var(--space-1);
    }

    .search-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        width: 90%;
        max-width: 400px;
    }

    .search-field.active .search-dropdown {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hero {
        min-height: auto;
    }

    .hero-content {
        padding-top: 100px;
        padding-bottom: var(--space-8);
    }

    .hero-headline {
        font-size: 2.25rem;
        margin-bottom: var(--space-3);
    }

    .hero-tagline {
        font-size: var(--text-base);
        margin-bottom: var(--space-4);
    }

    .hero-search-bar {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        padding: 0 var(--space-4);
        margin-top: var(--space-8);
        border-radius: 12px;
    }

    .search-bar-inner {
        flex-direction: column;
        padding: var(--space-3);
    }

    .search-field {
        flex: 1 1 100%;
        width: 100%;
        border-radius: 8px;
    }

    .search-btn {
        margin-top: var(--space-1);
        border-radius: 8px;
    }

    .search-helper-row {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
        padding: var(--space-3);
    }

    .helper-text {
        font-size: var(--text-xs);
    }

    .search-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(100%);
        width: 100%;
        max-width: none;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        overflow-y: auto;
    }

    .search-field.active .search-dropdown {
        transform: translateY(0);
    }
}
