/*
Theme Name: Flight Deals Explorer
Theme URI: https://yoursite.com/flight-deals-explorer
Author: Your Name
Author URI: https://yoursite.com
Description: An interactive flight deals map theme inspired by points travel explorers. Display award flight deals on an interactive world map with filtering by cabin class, points, airlines, and more.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flight-deals-explorer
Tags: travel, map, flights, points, awards, custom-menu, custom-logo, full-width-template
*/

/* === ROOT & RESET === */
:root {
  --color-bg-dark: #0a1628;
  --color-bg-header: rgba(10, 22, 40, 0.95);
  --color-accent-orange: #f05a28;
  --color-accent-blue: #1a6fdb;
  --color-pill-bg: rgba(26, 111, 219, 0.92);
  --color-pill-border: #2a7ee8;
  --color-pill-text: #ffffff;
  --color-economy: #1a6fdb;
  --color-premium: #2e9e4f;
  --color-business: #6b3fa0;
  --color-first: #d04e2b;
  --color-white: #ffffff;
  --color-gray-100: #f0f4f8;
  --color-gray-200: #e2e8f0;
  --color-gray-400: #94a3b8;
  --color-gray-600: #475569;
  --color-gray-800: #1e293b;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', sans-serif;
  --radius-pill: 20px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-pill: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-panel: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-body);
  background: var(--color-bg-dark);
  color: var(--color-white);
  height: 100%;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select { font-family: inherit; }

/* === HEADER === */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--color-bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 20px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 12px;
}

.header-tagline {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-white);
  white-space: nowrap;
}

.header-tagline .points-count {
  color: var(--color-accent-orange);
  font-weight: 700;
  font-size: 17px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  flex: 1;
  max-width: 900px;
}

/* Tab Toggle */
.tab-toggle {
  display: flex;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.tab-toggle button {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  transition: var(--transition);
  border-radius: var(--radius-sm);
}

.tab-toggle button.active {
  background: var(--color-accent-orange);
  color: var(--color-white);
}

/* Search pill inputs */
.search-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-white);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.search-pill:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.25);
}

.search-pill .pill-icon { font-size: 15px; opacity: 0.7; }
.search-pill .pill-label { opacity: 0.7; font-size: 11px; }
.search-pill .pill-value { font-weight: 600; }
.search-pill .pill-remove {
  opacity: 0.5;
  font-size: 16px;
  line-height: 1;
  margin-left: 2px;
}
.search-pill .pill-remove:hover { opacity: 1; }

.search-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.search-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  padding: 0 4px;
}

.search-date-range .calendar-icon { opacity: 0.6; }

.btn-search {
  background: var(--color-accent-orange);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: var(--transition);
  margin-left: auto;
}

.btn-search:hover { background: #d94e1f; transform: translateY(-1px); }

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: wrap;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-dropdown {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.filter-dropdown:hover {
  background: rgba(255,255,255,0.12);
  color: var(--color-white);
}

.filter-dropdown .chevron { font-size: 9px; opacity: 0.6; }

/* Cabin class toggles */
.cabin-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.cabin-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
}

.cabin-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  cursor: pointer;
  accent-color: var(--color-accent-blue);
}

.cabin-toggle.economy input { accent-color: var(--color-economy); }
.cabin-toggle.premium input { accent-color: var(--color-premium); }
.cabin-toggle.business input { accent-color: var(--color-business); }
.cabin-toggle.first input { accent-color: var(--color-first); }

.filter-reset {
  color: #ff6b6b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.filter-reset:hover { background: rgba(255,100,100,0.15); }

/* === MAP CONTAINER === */
#map-wrapper {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
}

#explorer-map {
  width: 100%;
  height: 100%;
}

/* Map content shifted for header */
.map-shift {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  padding-top: 110px;
}

/* === DEAL PILLS ON MAP === */
.deal-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--color-pill-bg);
  border: 1.5px solid var(--color-pill-border);
  border-radius: var(--radius-pill);
  padding: 4px 10px 4px 6px;
  color: var(--color-pill-text);
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-pill);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
}

.deal-pill:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  z-index: 10;
  border-color: #5ba3f5;
}

.deal-pill.economy { background: rgba(26, 111, 219, 0.92); border-color: #2a7ee8; }
.deal-pill.premium-economy { background: rgba(46, 158, 79, 0.92); border-color: #38b85e; }
.deal-pill.business { background: rgba(107, 63, 160, 0.92); border-color: #8b5cf6; }
.deal-pill.first { background: rgba(208, 78, 43, 0.88); border-color: #e25a35; }

.deal-pill .pill-plane { font-size: 12px; }
.deal-pill .pill-pts { font-size: 11px; font-weight: 700; }

/* === DEAL POPUP === */
.deal-popup {
  position: fixed;
  background: #0f1e35;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  width: 320px;
  z-index: 2000;
  overflow: hidden;
  animation: popIn 0.15s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.93) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-header {
  background: rgba(26, 111, 219, 0.25);
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.popup-route {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.popup-airline {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

.popup-body { padding: 14px 16px; }

.popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.popup-stat { }
.popup-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
  margin-bottom: 2px;
}
.popup-stat-value {
  font-size: 15px;
  font-weight: 700;
}
.popup-stat-value.pts { color: #5ba3f5; }
.popup-stat-value.cash { color: #94a3b8; font-size: 13px; }

.cabin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
}
.cabin-badge.economy { background: rgba(26,111,219,0.3); color: #7ab8ff; }
.cabin-badge.business { background: rgba(107,63,160,0.35); color: #c4a0ff; }
.cabin-badge.first { background: rgba(208,78,43,0.3); color: #ff9977; }

.popup-footer {
  display: flex;
  gap: 8px;
}

.btn-popup-book {
  flex: 1;
  background: var(--color-accent-orange);
  color: white;
  font-weight: 700;
  font-size: 13px;
  padding: 9px;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: var(--transition);
}
.btn-popup-book:hover { background: #d94e1f; }

.btn-popup-close {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-popup-close:hover { background: rgba(255,255,255,0.14); }

/* === BOTTOM VIEW TOGGLES === */
.map-bottom-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  gap: 0;
  background: #1a2540;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  transition: var(--transition);
}

.view-toggle-btn:hover { color: white; background: rgba(255,255,255,0.06); }
.view-toggle-btn.active { background: rgba(255,255,255,0.12); color: white; }
.view-toggle-btn + .view-toggle-btn { border-left: 1px solid rgba(255,255,255,0.1); }

/* === LEGEND === */
.map-legend {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 900;
  background: rgba(10, 22, 40, 0.9);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 11px;
  box-shadow: var(--shadow-panel);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,0.75);
  padding: 2px 0;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* === MAP ZOOM CONTROLS === */
.map-zoom-controls {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zoom-btn {
  width: 32px;
  height: 32px;
  background: rgba(10, 22, 40, 0.9);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.zoom-btn:hover { background: rgba(255,255,255,0.12); color: white; }

/* === ADMIN / DETAIL VIEW === */
.detail-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #0f1e35;
  border-top: 1px solid rgba(255,255,255,0.1);
  z-index: 800;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 55vh;
  overflow-y: auto;
}

.detail-panel.open {
  transform: translateY(0);
}

.detail-panel-inner {
  padding: 16px 20px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.detail-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.85);
}

.detail-table tr:hover td { background: rgba(255,255,255,0.04); }

.detail-table .pts-cell {
  font-weight: 700;
  color: #5ba3f5;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .header-tagline { display: none; }
  .header-controls { flex-wrap: wrap; }
  .filter-bar { flex-wrap: nowrap; }
}

@media (max-width: 600px) {
  .header-top { padding: 6px 0; }
  .search-pill .pill-label { display: none; }
  .deal-pill { font-size: 11px; padding: 3px 8px 3px 5px; }
}
