/* ===================================================================
   Flight Booking Dashboard Widget — Phase 2b-5
   Collapsible section on dashboard showing user's flight bookings,
   stats, upcoming flights, and booking management.
   =================================================================== */

/* --- Wrapper --- */
.fbd-wrapper {
    padding: 1.25rem;
    background: rgba(255,255,255,0.02);
}

/* --- Stats Row --- */
.fbd-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
    .fbd-stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .fbd-stats-row { grid-template-columns: 1fr; }
}

.fbd-stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    transition: all 0.25s ease;
}
.fbd-stat-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(127,255,0,0.15);
    transform: translateY(-1px);
}

.fbd-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.3rem;
}
.fbd-stat-total    { background: rgba(59,130,246,0.15);  color: #3b82f6; }
.fbd-stat-upcoming { background: rgba(127,255,0,0.12);   color: #7FFF00; }
.fbd-stat-spent    { background: rgba(249,115,22,0.15);  color: #f97316; }
.fbd-stat-cancelled{ background: rgba(239,68,68,0.12);   color: #ef4444; }

.fbd-stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.fbd-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.fbd-stat-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* --- Tab Bar --- */
.fbd-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0;
}

.fbd-tab {
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.fbd-tab:hover {
    color: rgba(255,255,255,0.8);
}
.fbd-tab.active {
    color: #7FFF00;
    border-bottom-color: #7FFF00;
}

/* --- Tab Content Panels --- */
.fbd-tab-panel {
    display: none;
}
.fbd-tab-panel.active {
    display: block;
}

/* --- Booking List --- */
.fbd-booking-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* --- Booking Card --- */
.fbd-booking-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.fbd-booking-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(127,255,0,0.12);
    transform: translateY(-1px);
}

/* Airline icon */
.fbd-airline-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(59,130,246,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

/* Route info (main column) */
.fbd-route-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.fbd-route {
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.fbd-route-arrow {
    color: rgba(255,255,255,0.3);
    font-size: 0.75rem;
}
.fbd-route-details {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.fbd-route-ref {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    font-family: 'Courier New', monospace;
    margin-top: 1px;
}

/* Flight date column */
.fbd-date-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
    flex-shrink: 0;
}
.fbd-date-day {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.fbd-date-month {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.fbd-date-year {
    font-size: 0.58rem;
    color: rgba(255,255,255,0.25);
}

/* Meta column (right side) */
.fbd-meta-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    flex-shrink: 0;
}
.fbd-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
}
.fbd-passengers {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
}

/* --- Status Badges --- */
.fbd-status-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: capitalize;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.fbd-status-pending          { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.fbd-status-awaiting_payment { background: rgba(249,115,22,0.15); color: #f97316; border: 1px solid rgba(249,115,22,0.2); }
.fbd-status-confirming       { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.fbd-status-confirmed        { background: rgba(127,255,0,0.15);  color: #7FFF00; border: 1px solid rgba(127,255,0,0.2); }
.fbd-status-ticketed         { background: rgba(34,197,94,0.15);  color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.fbd-status-cancelled        { background: rgba(239,68,68,0.12);  color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.fbd-status-failed           { background: rgba(239,68,68,0.10);  color: #f87171; }
.fbd-status-refunded         { background: rgba(168,85,247,0.15); color: #a855f7; border: 1px solid rgba(168,85,247,0.2); }

/* --- Booking Detail Overlay --- */
.fbd-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fbd-fadeIn 0.2s ease;
}

@keyframes fbd-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fbd-detail-modal {
    background: #0F2020;
    border: 1px solid rgba(127,255,0,0.15);
    border-radius: 16px;
    max-width: 560px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    animation: fbd-slideUp 0.25s ease;
}

@keyframes fbd-slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.fbd-detail-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
    transition: all 0.2s;
}
.fbd-detail-close:hover {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border-color: rgba(239,68,68,0.3);
}

.fbd-detail-header {
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.fbd-detail-route {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.3rem;
}
.fbd-detail-ref {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #7FFF00;
    letter-spacing: 0.05em;
}

/* Detail sections */
.fbd-detail-section {
    margin-bottom: 1rem;
}
.fbd-detail-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}
.fbd-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
}
.fbd-detail-field {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.fbd-detail-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
}
.fbd-detail-value {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

/* Passenger list inside detail */
.fbd-pax-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.fbd-pax-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.65rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
}
.fbd-pax-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.fbd-pax-name {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}
.fbd-pax-type {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    margin-left: auto;
}
.fbd-pax-ticket {
    font-size: 0.65rem;
    color: rgba(127,255,0,0.7);
    font-family: 'Courier New', monospace;
}

/* Cancel button */
.fbd-cancel-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(239,68,68,0.12);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.25);
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 0.75rem;
}
.fbd-cancel-btn:hover {
    background: rgba(239,68,68,0.22);
    border-color: rgba(239,68,68,0.4);
}
.fbd-cancel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Empty State --- */
.fbd-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255,255,255,0.4);
}
.fbd-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.fbd-empty p {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
}
.fbd-empty-cta {
    color: #7FFF00;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}
.fbd-empty-cta:hover { opacity: 0.8; }

/* --- Loading --- */
.fbd-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}
.fbd-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(127,255,0,0.2);
    border-top-color: #7FFF00;
    border-radius: 50%;
    animation: fbd-spin 0.7s linear infinite;
}
@keyframes fbd-spin {
    to { transform: rotate(360deg); }
}

/* --- CTA Row --- */
.fbd-cta-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.fbd-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    background: linear-gradient(135deg, #7FFF00, #32CD32);
    color: #0A1A1A;
    border: none;
    cursor: pointer;
}
.fbd-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(127,255,0,0.3);
}
.fbd-cta-secondary {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.1);
}
.fbd-cta-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    box-shadow: none;
}

@media (max-width: 540px) {
    .fbd-cta-row { flex-direction: column; }
    .fbd-cta-btn { justify-content: center; }
}

/* --- Badge in toggle bar --- */
.fbd-badge {
    display: inline-block;
    background: rgba(127,255,0,0.15);
    color: #7FFF00;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 0.5rem;
}

/* --- Upcoming flight highlight --- */
.fbd-booking-card.fbd-upcoming {
    border-color: rgba(127,255,0,0.12);
    background: rgba(127,255,0,0.03);
}

.fbd-countdown {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
}
.fbd-countdown.soon {
    color: #f97316;
    font-weight: 600;
}
.fbd-countdown.imminent {
    color: #ef4444;
    font-weight: 700;
    animation: fbd-pulse 1.5s ease-in-out infinite;
}

@keyframes fbd-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Detail modal scrollbar --- */
.fbd-detail-modal::-webkit-scrollbar {
    width: 6px;
}
.fbd-detail-modal::-webkit-scrollbar-track {
    background: transparent;
}
.fbd-detail-modal::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

/* --- Action buttons in detail --- */
.fbd-detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
