/**
 * Flightpadi Booking Engine - Complete Isolated Styles
 * Fully self-contained design that works independently from any theme
 * Version: 3.0.0 - Modern Redesign
 */

/* ============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================ */
:root {
    --fpb-primary: #6366f1;
    --fpb-primary-hover: #4f46e5;
    --fpb-primary-light: rgba(99, 102, 241, 0.08);
    --fpb-primary-glow: rgba(99, 102, 241, 0.25);
    --fpb-btn-text: #ffffff;
    --fpb-success: #10B981;
    --fpb-success-light: rgba(16, 185, 129, 0.1);
    --fpb-warning: #F59E0B;
    --fpb-warning-light: rgba(245, 158, 11, 0.1);
    --fpb-error: #EF4444;
    --fpb-error-light: rgba(239, 68, 68, 0.1);
    --fpb-text: #1e293b;
    --fpb-text-secondary: #64748b;
    --fpb-text-light: #94a3b8;
    --fpb-border: #e2e8f0;
    --fpb-border-focus: #cbd5e1;
    --fpb-bg: #ffffff;
    --fpb-bg-light: #f8fafc;
    --fpb-bg-card: #ffffff;
    --fpb-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --fpb-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --fpb-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --fpb-shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.15);
    --fpb-radius: 16px;
    --fpb-radius-lg: 24px;
    --fpb-radius-pill: 999px;
    --fpb-radius-sm: 8px;
    --fpb-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fpb-transition: all 0.2s ease;

    /* FPS Widget specific */
    --fps-primary: #6366f1;
    --fps-primary-hover: #4f46e5;
    --fps-primary-light: rgba(99, 102, 241, 0.08);
    --fps-primary-glow: rgba(99, 102, 241, 0.25);
}

/* ============================================
   COMPLETE STYLE ISOLATION - NUCLEAR RESET
   ============================================ */
.fpb-widget-wrapper,
.fpb-results-wrapper,
.fpb-booking-wrapper,
.fpb-payment-wrapper,
.fpb-status-wrapper,
.fps-widget-container {
    all: initial;
    display: block;
    font-family: var(--fpb-font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--fpb-text);
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fpb-widget-wrapper *,
.fpb-results-wrapper *,
.fpb-booking-wrapper *,
.fpb-payment-wrapper *,
.fpb-status-wrapper *,
.fps-widget-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

/* ============================================
   MODERN SEARCH WIDGET STYLES
   ============================================ */

.fps-widget-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    font-family: var(--fpb-font);
}

/* Trip Type Selector - Modern Pills */
.fps-trip-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.fps-trip-option {
    cursor: pointer;
}

.fps-trip-option input {
    display: none;
}

.fps-trip-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f1f5f9;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.fps-trip-label:hover {
    background: #e2e8f0;
    color: #475569;
}

.fps-trip-option input:checked+.fps-trip-label {
    background: var(--fps-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--fps-primary-glow);
}

.fps-icon {
    width: 16px;
    height: 16px;
}

/* Main Search Card */
.fps-search-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 12px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.02),
        0 4px 20px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    transition: box-shadow 0.3s ease;
}

.fps-search-card:hover {
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.02),
        0 8px 30px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* Locations Row */
.fps-locations-row {
    display: flex;
    align-items: center;
    flex: 2;
    padding: 0 8px;
}

.fps-field-group {
    flex: 1;
    padding: 12px 16px;
    position: relative;
}

.fps-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.fps-label-icon {
    width: 14px;
    height: 14px;
    color: var(--fps-primary);
}

.fps-input-wrap {
    position: relative;
}

.fps-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    background: transparent;
    padding: 4px 0;
    font-family: inherit;
    transition: color 0.2s ease;
}

.fps-input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

.fps-input:focus {
    color: var(--fps-primary);
}

/* Swap Button */
.fps-swap-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    z-index: 10;
}

.fps-swap-btn:hover {
    border-color: var(--fps-primary);
    color: var(--fps-primary);
    background: var(--fps-primary-light);
    transform: rotate(180deg);
}

.fps-swap-icon {
    width: 16px;
    height: 16px;
}

/* Section Divider */
.fps-section-divider {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, #e2e8f0, transparent);
    margin: 0 8px;
    flex-shrink: 0;
}

/* Details Row */
.fps-details-row {
    display: flex;
    align-items: center;
    flex: 1.2;
    padding: 0 8px;
    gap: 8px;
}

.fps-dates-field {
    flex: 1;
    min-width: 180px;
}

.fps-dates-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fps-date-input {
    border: none;
    outline: none;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    background: transparent;
    font-family: inherit;
    padding: 4px 0;
    cursor: pointer;
}

.fps-date-input::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.fps-date-input::placeholder {
    color: #cbd5e1;
}

.fps-date-arrow {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
}

.fps-hidden {
    display: none !important;
}

/* Passengers Field */
.fps-passengers-field {
    flex: 1;
    min-width: 160px;
    position: relative;
}

.fps-passengers-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
}

.fps-passengers-trigger:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.fps-passengers-text {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.fps-chevron {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.fps-passengers-trigger.active .fps-chevron {
    transform: rotate(180deg);
}

/* Passengers Modal */
.fps-passengers-modal {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.02),
        0 20px 50px rgba(0, 0, 0, 0.12);
    width: 320px;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.fps-passengers-modal.active {
    display: block;
    animation: fps-modal-in 0.2s ease;
}

@keyframes fps-modal-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fps-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.fps-modal-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.fps-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.fps-modal-close:hover {
    background: #f1f5f9;
    color: #64748b;
}

.fps-modal-body {
    padding: 16px 20px;
}

.fps-traveler-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f8fafc;
}

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

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

.fps-traveler-type {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.fps-traveler-age {
    font-size: 12px;
    color: #94a3b8;
}

.fps-counter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fps-counter-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: var(--fps-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.fps-counter-btn:hover:not(:disabled) {
    border-color: var(--fps-primary);
    background: var(--fps-primary-light);
}

.fps-counter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: #cbd5e1;
}

.fps-counter-btn svg {
    width: 14px;
    height: 14px;
}

.fps-counter-value {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    min-width: 24px;
    text-align: center;
}

.fps-class-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.fps-class-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.fps-class-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background: #ffffff;
    cursor: pointer;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.fps-class-select:focus {
    border-color: var(--fps-primary);
    box-shadow: 0 0 0 3px var(--fps-primary-light);
}

.fps-modal-footer {
    padding: 16px 20px 20px;
}

.fps-done-btn {
    width: 100%;
    padding: 14px;
    background: var(--fps-primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.fps-done-btn:hover {
    background: var(--fps-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--fps-primary-glow);
}

/* Search Button */
.fps-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--fps-primary) 0%, var(--fps-primary-hover) 100%);
    color: #ffffff;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 4px 16px var(--fps-primary-glow);
    flex-shrink: 0;
    white-space: nowrap;
}

.fps-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--fps-primary-glow);
}

.fps-search-btn:active {
    transform: translateY(0);
}

.fps-btn-icon {
    width: 18px;
    height: 18px;
}

/* Loading State */
.fps-search-btn.fps-searching {
    pointer-events: none;
    opacity: 0.8;
}

.fps-search-btn.fps-searching .fps-btn-icon {
    animation: fps-spin 1s linear infinite;
}

@keyframes fps-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.fps-error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 14px 18px;
    border-radius: 12px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #fecaca;
}

/* Airport Results Dropdown */
.fps-airport-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.02),
        0 20px 50px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    max-height: 320px;
    overflow-y: auto;
    display: none;
    z-index: 999;
    padding: 8px;
}

.fps-airport-results.active {
    display: block;
    animation: fps-dropdown-in 0.2s ease;
}

@keyframes fps-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .fps-widget-container {
        padding: 16px;
    }

    .fps-search-card {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        border-radius: 20px;
    }

    .fps-locations-row {
        flex-direction: column;
        width: 100%;
        padding: 0;
        gap: 12px;
        position: relative;
    }

    .fps-field-group {
        width: 100%;
        padding: 16px;
        background: #f8fafc;
        border-radius: 16px;
    }

    .fps-swap-btn {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .fps-swap-btn:hover {
        transform: translateY(-50%) rotate(180deg);
    }

    .fps-section-divider {
        display: none;
    }

    .fps-details-row {
        flex-direction: column;
        width: 100%;
        padding: 0;
        gap: 12px;
    }

    .fps-dates-field,
    .fps-passengers-field {
        width: 100%;
        min-width: 0;
    }

    .fps-dates-wrap {
        justify-content: space-between;
    }

    .fps-date-input {
        flex: 1;
    }

    .fps-passengers-trigger {
        padding: 12px 16px;
    }

    .fps-search-btn {
        width: 100%;
        padding: 18px;
        border-radius: 16px;
        margin-top: 4px;
    }

    .fps-btn-text {
        font-size: 16px;
    }

    .fps-passengers-modal {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 24px 24px 0 0;
        max-height: 80vh;
        overflow-y: auto;
        animation: fps-modal-slide-up 0.3s ease;
    }

    @keyframes fps-modal-slide-up {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .fps-modal-close {
        display: none;
    }

    .fps-done-btn {
        position: sticky;
        bottom: 0;
    }
}

@media (max-width: 480px) {
    .fps-trip-label {
        padding: 8px 16px;
        font-size: 13px;
    }

    .fps-icon {
        width: 14px;
        height: 14px;
    }

    .fps-field-group {
        padding: 14px;
    }

    .fps-input {
        font-size: 15px;
    }
}

/* ============================================
   LEGACY STYLES (Keep for backwards compatibility)
   ============================================ */

/* These ensure the old fpb- classes still work if referenced elsewhere */
.fpb-widget-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.fpb-airport-item {
    padding: 12px 14px;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

.fpb-airport-item:hover {
    background: #f8fafc;
}

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

.fpb-airport-city {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.fpb-airport-name {
    font-size: 12px;
    color: #64748b;
}

.fpb-airport-code {
    font-size: 13px;
    font-weight: 700;
    color: var(--fps-primary);
    background: var(--fps-primary-light);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Legacy spinner for JS compatibility */
.fpb-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--fps-primary);
    border-radius: 50%;
    animation: fps-spin 0.8s linear infinite;
}

/* Legacy shake animation */
@keyframes fpb-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}