/* Add flight overlay — neumorphic style */

.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: var(--nm-bg);
    overflow-y: auto;
    padding-bottom: calc(var(--native-safe-area-bottom, 0px) + 4.5rem);
}

.search-overlay.active {
    display: block;
}

.search-panel {
    max-width: 28rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    position: relative;
}

/* Headline */
.search-headline {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nm-text);
    margin: 2rem 0 1.5rem;
}

/* Two inputs side by side */
.search-inputs-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Both inputs equal width */
.search-input-half {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}

/* Date display button — looks like an input but toggles calendar */
.search-date-display {
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.search-date-display span {
    pointer-events: none;
    color: var(--nm-text-muted);
}

.search-date-display.has-date span {
    color: var(--nm-text);
}

.search-box {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: var(--nm-bg);
    border: none;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--nm-text);
    box-shadow:
        inset 2px 2px 5px var(--nm-inset-dark),
        inset -2px -2px 5px var(--nm-inset-light);
    transition: box-shadow 0.2s ease;
}

.search-box:focus {
    outline: none;
    box-shadow:
        inset 3px 3px 6px var(--nm-inset-dark),
        inset -3px -3px 6px var(--nm-inset-light);
}

.search-box::placeholder {
    color: var(--nm-text-muted);
}

.search-box-single {
    text-transform: uppercase;
}

.search-box-single::placeholder {
    text-transform: none;
}

/* Calendar — neumorphic, collapsible */
.cal {
    margin-bottom: 1rem;
    overflow: hidden;
    padding: 12px 12px 12px;
    max-height: 420px;
    transition: max-height 0.25s ease, margin-bottom 0.25s ease, padding-bottom 0.25s ease, opacity 0.2s ease;
    opacity: 1;
}

.cal.cal-collapsed {
    max-height: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    opacity: 0;
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.cal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--nm-text);
}

.cal-nav {
    width: 36px;
    height: 36px;
    background: var(--nm-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        3px 3px 8px var(--nm-shadow-dark),
        -3px -3px 8px var(--nm-shadow-light);
    transition: box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.cal-nav:active {
    box-shadow:
        inset 2px 2px 5px var(--nm-inset-dark),
        inset -2px -2px 5px var(--nm-inset-light);
}

.cal-nav svg path {
    stroke: var(--nm-text);
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nm-text-muted);
    margin-bottom: 0.5rem;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--nm-text);
    background: var(--nm-bg);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow:
        2px 2px 5px var(--nm-shadow-dark),
        -2px -2px 5px var(--nm-shadow-light);
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.cal-cell:active:not(.cal-past) {
    box-shadow:
        inset 2px 2px 5px var(--nm-inset-dark),
        inset -2px -2px 5px var(--nm-inset-light);
    transform: scale(0.95);
}

.cal-empty {
    box-shadow: none;
    cursor: default;
}

.cal-past {
    color: var(--nm-text-muted);
    opacity: 0.4;
    cursor: default;
    box-shadow:
        1px 1px 3px var(--nm-shadow-dark),
        -1px -1px 3px var(--nm-shadow-light);
}

.cal-today {
    font-weight: 700;
    color: var(--nm-text);
    box-shadow:
        inset 1px 1px 3px var(--nm-inset-dark),
        inset -1px -1px 3px var(--nm-inset-light),
        2px 2px 5px var(--nm-shadow-dark),
        -2px -2px 5px var(--nm-shadow-light);
}

.cal-selected {
    box-shadow:
        inset 3px 3px 6px var(--nm-inset-dark),
        inset -3px -3px 6px var(--nm-inset-light);
    font-weight: 700;
    background: var(--nm-tab-bg);
    color: var(--nm-text);
    transform: scale(1.08);
}

/* Find flight button — neumorphic raised */
.search-go-btn {
    display: block;
    width: 100%;
    padding: 0.875rem;
    background: var(--nm-bg);
    color: var(--nm-text);
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow:
        4px 4px 10px var(--nm-shadow-dark),
        -4px -4px 10px var(--nm-shadow-light);
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    margin-bottom: 1rem;
}

.search-go-btn:active {
    box-shadow:
        inset 3px 3px 6px var(--nm-inset-dark),
        inset -3px -3px 6px var(--nm-inset-light);
    transform: scale(0.98);
}

/* Narration text */
.search-narration {
    font-size: 0.875rem;
    color: var(--nm-text-muted);
    text-align: center;
    margin: 0.5rem 0;
    min-height: 1.25rem;
}

/* Searching state — button disabled */
.search-go-btn.searching {
    pointer-events: none;
    opacity: 0.7;
}

/* Runway takeoff animation */
.runway-anim {
    text-align: center;
    padding: 1rem 0;
}

.runway-anim svg {
    width: 80%;
    max-width: 300px;
    height: auto;
    overflow: visible;
}

/* Edge lights chase sequence */
.rw-edge {
    fill: var(--nm-border, #c8cfd8);
    animation: rw-glow 2.5s ease-in-out infinite;
}

.rw-e1 { animation-delay: 0s; }
.rw-e2 { animation-delay: 0.3s; }
.rw-e3 { animation-delay: 0.6s; }
.rw-e4 { animation-delay: 0.9s; }
.rw-e5 { animation-delay: 1.2s; }

@keyframes rw-glow {
    0%, 40%, 100% { fill: var(--nm-border, #c8cfd8); r: 2.5; opacity: 0.4; }
    20% { fill: var(--nm-text, #4a5568); r: 3.5; opacity: 1; }
}

/* Plane taxis then lifts off, loops */
.rw-plane {
    animation: rw-takeoff 2.5s ease-in-out infinite;
}

@keyframes rw-takeoff {
    0%   { transform: translate(40px, 48px) rotate(0deg); }
    60%  { transform: translate(240px, 48px) rotate(0deg); }
    80%  { transform: translate(290px, 28px) rotate(-15deg); }
    90%  { transform: translate(310px, 15px) rotate(-15deg); opacity: 1; }
    95%  { transform: translate(320px, 8px) rotate(-15deg); opacity: 0; }
    96%  { transform: translate(40px, 48px) rotate(0deg); opacity: 0; }
    100% { transform: translate(40px, 48px) rotate(0deg); opacity: 1; }
}

/* Results area — margin-top positions card where inputs were */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 5rem;
}


.search-empty {
    text-align: center;
    color: var(--nm-text-muted);
    padding: 2rem 0;
    font-size: 0.875rem;
}

/* Search result card — neumorphic raised */
.search-result-card {
    background: var(--nm-bg);
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        6px 6px 14px var(--nm-shadow-dark-strong),
        -6px -6px 14px var(--nm-shadow-light);
}

.search-card-svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Add / Cancel buttons — side by side below card */
.search-action-buttons {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
}

.search-add-btn,
.search-cancel-btn {
    flex: 1;
    padding: 0.75rem;
    background: var(--nm-bg);
    color: var(--nm-text);
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow:
        3px 3px 8px var(--nm-shadow-dark),
        -3px -3px 8px var(--nm-shadow-light);
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.search-add-btn:active,
.search-cancel-btn:active {
    box-shadow:
        inset 2px 2px 5px var(--nm-inset-dark),
        inset -2px -2px 5px var(--nm-inset-light);
    transform: scale(0.98);
}

.search-cancel-btn {
    color: var(--nm-text-muted);
}

.search-added-msg {
    text-align: center;
    margin: 5rem 0 0;
    padding: 0 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--nm-text);
}

/* Close button — top right, neumorphic raised circle */
.search-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: var(--nm-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        3px 3px 8px var(--nm-shadow-dark),
        -3px -3px 8px var(--nm-shadow-light);
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.search-close-btn:active {
    box-shadow:
        inset 2px 2px 5px var(--nm-inset-dark),
        inset -2px -2px 5px var(--nm-inset-light);
    transform: scale(0.95);
}

.search-close-btn svg path {
    stroke: var(--nm-text-muted);
}
