/* flight-card.css */

.recent-approaches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  perspective: 1500px;
  margin-top: 16px;
}

.card-perspective-wrapper {
  width: 100%;
  height: 380px;
  perspective: 1500px;
}

.flight-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: default;
}

/* Hover affordance: slightly lift the card */
.card-perspective-wrapper:hover .flight-card-inner {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px rgba(0,0,0,0.08);
}

.flight-card-inner.is-flipped {
  transform: rotateY(180deg);
}

/* Keep the card lifted if hovered while flipped */
.card-perspective-wrapper:hover .flight-card-inner.is-flipped {
  transform: rotateY(180deg) translateY(-4px);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  border: 1px solid #eef0f2;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.card-face-front {
  z-index: 2;
  transform: rotateY(0deg);
}

/* Re-allow mouse/touch tracking directly over the Leaflet layers */
.card-map-viewport {
  flex-grow: 1;
  width: 100%;
  background: #fdfdfd;
  pointer-events: auto; /* CRITICAL: Enables zoom buttons, dragging, and map clicks */
}

/* Style the target clickable meta bar on the front card face */
.card-front-meta.interactive-flip-zone {
  padding: 14px 16px;
  background: #ffffff;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer; /* Confirms clickability to user */
  transition: background-color 0.2s ease;
}

.card-front-meta.interactive-flip-zone:hover {
  background-color: #fcfdfe; /* Subtle highlight indicator on hovering flip trigger */
}

/* Style the complete bottom-end action banner on the back face */
.card-back-action.interactive-flip-zone {
  text-align: center;
  font-size: 11px;
  color: #3b82f6; /* Shifted to brand color to imply click action */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: auto;
  padding: 12px 0;
  cursor: pointer;
  border-top: 1px dashed #eef0f2;
}

.card-back-action.interactive-flip-zone:hover {
  text-decoration: underline;
}

.card-map-viewport .leaflet-tile-container {
  filter: grayscale(100%) contrast(1.1);
}

.card-front-meta {
  padding: 14px 16px;
  background: #ffffff;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-front-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-front-title {
  font-weight: 700;
  font-size: 16px;
  color: #111;
}

.card-flip-hint {
  font-size: 11px;
  color: #3b82f6;
  font-weight: 500;
}

.card-front-badge {
  background: #f0f7ff;
  color: #1d4ed8;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: ui-monospace, monospace;
}

/* --- BACK FACE CONTENT --- */
.card-face-back {
  transform: rotateY(180deg);
  padding: 24px;
  background: #ffffff;
  justify-content: space-between;
}

/* TRADING CARD HEADER (MOCKUP ACCURATE STYLE) */
.card-back-header {
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.card-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center; /* Vertically centers text and scaled logo side-by-side */
  gap: 16px;
  width: 100%;
}

.card-header-titles {
  flex: 1;
}

.card-header-titles h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  line-height: 1.2;
}

.card-header-titles p {
  margin: 6px 0 0 0;
  font-size: 13px;
  color: #666;
  font-family: ui-monospace, monospace;
}

/* --- LARGE BRANDING LOGO DISPLAY --- */
.airline-card-logo {
  display: block;
  width: 35%;             /* Allocates a substantial chunk of the card width */
  max-width: 110px;       /* Matches true mockup scale signature look */
  height: auto;           /* Permits natural width expansion without shrinking */
  object-fit: contain;
  object-position: right center;
  flex-shrink: 0;
}

/* Scaled up vector fallback icon */
.airline-card-fallback-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: none;
  margin-left: auto;      /* Keeps fallback neatly pinned to the right side */
}

/* State-switching visibility controls if an asset fails or is missing */
.card-brand-row.has-error .airline-card-logo {
  display: none !important;
}

.card-brand-row.has-error .airline-card-fallback-icon {
  display: block;
}

/* --- STATS OVERVIEW LAYOUT --- */
.card-stats-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.card-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #f8f9fa;
}

.card-stat-label {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.card-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.card-back-action {
  text-align: center;
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: auto;
}