﻿/* ===== Global ===== */
body {
  background: linear-gradient(to bottom, rgb(44, 51, 51), rgb(95, 149, 158), rgb(36, 52, 54));
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===== Splash Screen ===== */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1c1f 0%, #1a363a 40%, #0d2837 100%);
  transition: opacity .6s ease, visibility .6s ease;
}

.splash-overlay.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  max-width: 520px;
  padding: 2rem;
}

.splash-icon-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.splash-icon {
  font-size: 4.5rem;
  color: #4dcff7;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(77, 171, 247, .4));
  animation: splashFloat 3s ease-in-out infinite;
}

.splash-radar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(77, 171, 247, .15);
  border-radius: 50%;
  animation: splashRadar 2.5s ease-out infinite;
}

.splash-radar::before {
  content: '';
  position: absolute;
  inset: -20px;
  border: 1px solid rgba(77, 171, 247, .08);
  border-radius: 50%;
  animation: splashRadar 2.5s ease-out infinite .5s;
}

@keyframes splashFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes splashRadar {
  0% { transform: translate(-50%, -50%) scale(.6); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

.splash-title {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #8c9196, rgb(209, 219, 219), #91bec7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: .4rem;
  letter-spacing: 1.2px;
}

.splash-subtitle {
  color: #8aaec4;
  font-size: 1rem;
  margin-bottom: 2rem;
}

.splash-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.splash-stat {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: #6c8fa5;
  font-size: .85rem;
}

.splash-stat i {
  color: #4dabf7;
  font-size: 1rem;
}

.splash-warning {
  background: rgba(255, 193, 7, .08);
  border: 1px solid rgba(255, 193, 7, .2);
  border-radius: .5rem;
  padding: .65rem 1rem;
  margin-bottom: 1.75rem;
  color: #f0c040;
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
}

.splash-btn {
  background: linear-gradient(135deg, #1686b3, #4decf7);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  padding: .8rem 2.5rem;
  border-radius: 3rem;
  border: none;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 24px rgba(77, 171, 247, .35);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

.splash-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(77, 171, 247, .5);
  color: #fff;
}

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

.splash-btn.loading {
  pointer-events: none;
  opacity: .85;
}

.splash-hint {
  margin-top: 1rem;
  color: #4a6a7e;
  font-size: .78rem;
}

/* ===== Navbar ===== */
.navbar-brand i {
  color: #4dabf7;
}

/* ===== Pulse Badge ===== */
.pulse-badge {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .55;
  }
}

/* ===== Stat Cards ===== */
.stat-card {
  transition: transform .2s, box-shadow .2s;
  border-radius: .75rem;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .12) !important;
}

/* ===== Cards ===== */
.card {
  border-radius: .75rem;
  overflow: hidden;
  background: linear-gradient(to top, rgb(49, 49, 49), rgb(49, 52, 53));
}

.card-header {
  border-bottom: 1px solid #e9ecef;
}

/* ===== Recent Aircraft List ===== */
#recentFlights .list-group-item {
  transition: background .15s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

#recentFlights .list-group-item:hover {
  background: #f8f9fa;
  border-left-color: #4dabf7;
}

.flight-callsign {
  font-weight: 700;
  color: #212529;
  font-size: .95rem;
}

.flight-meta {
  font-size: .8rem;
  color: #6c757d;
}

/* ===== Table ===== */
.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable:hover {
  background: rgba(255, 255, 255, .1);
}

#aircraftTable tbody tr {
  cursor: pointer;
  transition: background .12s;
}

#aircraftTable tbody tr:hover {
  background: #e7f5ff !important;
}

/* ===== Top Operators Bar ===== */
.operator-bar-wrapper {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .45rem;
}

.operator-bar-label {
  width: 90px;
  font-size: .82rem;
  text-align: right;
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operator-bar {
  flex: 1;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(90deg, #4dabf7, #3bc9db);
  transition: width .6s ease;
}

.operator-bar-count {
  font-size: .78rem;
  color: #868e96;
  min-width: 30px;
}

/* ===== Altitude Distribution ===== */
.alt-bar-wrapper {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .35rem;
}

.alt-bar-label {
  width: 80px;
  font-size: .8rem;
  text-align: right;
  color: #495057;
  font-weight: 500;
}

.alt-bar {
  flex: 1;
  height: 18px;
  border-radius: 3px;
  transition: width .6s ease;
}

.alt-bar-count {
  font-size: .75rem;
  color: #868e96;
  min-width: 30px;
}

/* ===== Modal ===== */
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: .35rem 0;
  border-bottom: 1px solid #f1f3f5;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: #495057;
}

.detail-value {
  color: #212529;
}

/* ===== Emergency Squawk Highlight ===== */
.squawk-emergency {
  color: #e03131;
  font-weight: 700;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #353638;
  border-radius: 3px;
}

/* ===== Map aircraft icon ===== */
.aircraft-icon {
  transition: transform .3s;
}

/* ===== Loading overlay ===== */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: .75rem;
}

/* ===== Responsive tweaks ===== */
@media (max-width: 768px) {
  .stat-card .card-body {
    padding: .75rem .5rem;
  }

  .stat-card h3 {
    font-size: 1.2rem;
  }
}
