/* Results Header - Command Center - Critical Styles */
#results-container header.results-header,
header.results-header,
.results-header {
    background-color: var(--color-primary, #0B1C3E) !important;
    background: var(--color-primary, #0B1C3E) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1030 !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

/* Override any white background - Stronger rules */
#results-container header,
#results-container header.results-header,
header.results-header,
.results-header,
#results-container .results-header,
body #results-container header.results-header {
    background-color: var(--color-primary, #0B1C3E) !important;
    background: var(--color-primary, #0B1C3E) !important;
    background-image: none !important;
}

/* Ensure container also has navy background */
.results-header-container {
    background-color: var(--color-primary, #0B1C3E) !important;
    background: var(--color-primary, #0B1C3E) !important;
    background-image: none !important;
}

.results-header-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.5rem 1rem !important;
    background: #ffffff !important;
    box-shadow: none !important;
    min-height: 50px !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.results-header-logo {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.results-header-summary {
    display: flex !important;
    flex-direction: column !important;
    flex: 0 1 auto !important;
    margin: 0 0.75rem !important;
    text-align: center !important;
    min-width: 0 !important;
    max-width: 500px !important;
}

.results-route-display {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.125rem !important;
    flex-wrap: nowrap !important;
    font-size: 0.875rem !important;
    line-height: 1.2 !important;
}

.results-route-display span {
    white-space: nowrap;
}

.route-swap-btn {
    background: none !important;
    border: none !important;
    padding: 0.25rem !important;
    margin: 0 0.25rem !important;
    cursor: pointer !important;
    color: #C5A059 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.2s !important;
}

.route-swap-btn:hover {
    color: #B8944F !important;
    transform: scale(1.1) !important;
}

.route-swap-icon {
    font-size: 0.875rem !important;
    transition: transform 0.3s !important;
}

.results-date-summary {
    font-size: 0.75rem !important;
    color: rgba(255,255,255,0.9) !important;
    line-height: 1.2 !important;
}

.results-route-display,
.results-route-display span {
    color: #ffffff !important;
}

.results-route-display .city-code {
    color: rgba(255,255,255,0.8) !important;
}

.results-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    flex-shrink: 0 !important;
}

.results-action-btn {
    display: flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    padding: 0.375rem 0.75rem !important;
    border: none !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    font-size: 0.8125rem !important;
    white-space: nowrap !important;
}

.results-support-btn {
    background-color: transparent !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    color: #ffffff !important;
}

.results-support-btn:hover {
    background-color: rgba(255,255,255,0.1) !important;
    color: #ffffff !important;
}

.results-modify-btn {
    background-color: var(--color-action, #C5A059) !important;
    color: var(--color-primary, #0B1C3E) !important;
    border: 1px solid var(--color-action, #C5A059) !important;
    font-weight: 600 !important;
}

.results-modify-btn:hover {
    background-color: #0a1629;
    color: #fff;
}

.results-action-btn i {
    font-size: 0.875rem !important;
}

/* Ensure header is visible and properly styled even when container is hidden */
#results-container[style*="display: none"] header.results-header,
#results-container header.results-header {
    display: block !important;
    visibility: visible !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    background-color: #fff !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
}

/* Force header to break out of hidden container */
#results-container[style*="display: none"] header.results-header {
    position: fixed !important;
    top: 0 !important;
}

/* Mobile Visibility */
@media (max-width: 768px) {
    .results-header-container {
        padding: 0.5rem !important;
        min-height: 50px !important;
    }
    
    /* Hide logo on mobile */
    .results-header-logo {
        display: none !important;
    }

    /* Show shorter flight summary format */
    .results-header-summary {
        margin: 0 0.5rem !important;
        flex-grow: 1 !important;
        text-align: left !important;
        max-width: none !important;
    }

    .results-route-display {
        font-size: 0.8125rem !important;
        gap: 0.125rem !important;
        margin-bottom: 0.125rem !important;
    }

    .city-name {
        display: none !important;
    }

    .city-code {
        display: inline !important;
        font-weight: 600 !important;
        font-size: 0.8125rem !important;
        color: rgba(255,255,255,0.9) !important;
    }

    /* Remove parentheses styling on mobile - codes only */
    .city-code::before,
    .city-code::after {
        content: none !important;
    }

    .route-swap-btn {
        margin: 0 0.125rem !important;
        padding: 0.125rem !important;
    }

    .route-swap-icon {
        font-size: 0.75rem !important;
    }

    .results-date-summary {
        font-size: 0.7rem !important;
        color: rgba(255,255,255,0.8) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 150px !important;
    }

    .results-travellers,
    .travellers-separator {
        display: none !important;
    }

    .results-date-row {
        justify-content: flex-start !important;
    }

    /* Ensure header container uses full width on mobile */
    .results-header-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Compact route display on mobile */
    .results-route-display {
        justify-content: flex-start !important;
    }

    /* Actions - Icon only */
    .results-header-actions {
        gap: 0.375rem !important;
        flex-shrink: 0 !important;
    }

    .results-action-btn {
        padding: 0.5rem !important;
        width: 40px !important;
        height: 40px !important;
        justify-content: center !important;
        min-width: 40px !important;
    }

    .action-text {
        display: none !important;
    }

    .results-action-btn i {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }

    .results-support-btn {
        border-color: rgba(255,255,255,0.4) !important;
    }

    .results-modify-btn {
        background-color: var(--color-action, #C5A059) !important;
        border-color: var(--color-action, #C5A059) !important;
    }
}

/* Desktop Visibility */
@media (min-width: 769px) {
    .city-name {
        display: inline !important;
    }

    .city-code {
        display: inline !important;
        font-weight: normal !important;
        margin-left: 0.25rem !important;
    }

    .city-code::before {
        content: '(' !important;
    }

    .city-code::after {
        content: ')' !important;
    }

    .action-text {
        display: inline !important;
    }
}
