/* cyclotrack.org — Storm Tracking Theme */
/* Completely different from worldquakes.org */

:root {
  --bg: #253858;
  --bg2: #2b4062;
  --bg3: #324a6e;
  --text: #e8edf5;
  --text-dim: #8899b8;
  --accent: #60a5fa;
  --accent2: #f97316;
  --accent-glow: rgba(96, 165, 250, 0.12);
  --border: #2a3a55;
  --radius: 12px;
  --max-w: 1280px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --shadow: 0 2px 16px rgba(0,0,0,0.3);
  --overlay-bg: rgba(37, 56, 88, 0.88);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }

/* ===== Header ===== */
.ct-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(37, 56, 88, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.ct-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ct-logo-ic { font-size: 1.5rem; }
.ct-logo-txt { background: linear-gradient(135deg, #60a5fa, #f97316); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.ct-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.ct-nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: all 0.2s;
}
.ct-nav a:hover { background: var(--bg3); color: var(--accent); }

/* ===== Language Switcher ===== */
.ct-lang { position: relative; }
.ct-lang-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}
.ct-lang-dd {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}
.ct-lang-dd.show { display: grid; }
.ct-lang-dd button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  text-align: left;
  transition: all 0.2s;
}
.ct-lang-dd button:hover { background: var(--bg3); color: var(--text); }

/* ===== Hero/Map Section ===== */
.ct-hero {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

#ctMap {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.ct-overlay {
  position: absolute;
  top: 70px;
  right: 1rem;
  width: 380px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  z-index: 500;
  pointer-events: none;
}
.ct-overlay > * { pointer-events: auto; }

/* ===== Storm Cards ===== */
.ct-storm-panel {
  background: var(--overlay-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ct-panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.ct-storm-card {
  display: block;
  background: var(--bg3);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid var(--accent);
  transition: all 0.2s;
  cursor: pointer;
}
.ct-storm-card:hover { transform: translateX(-4px); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

.ct-storm-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.ct-storm-meta {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.ct-storm-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
}

.ct-storm-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ct-storm-stat:last-child { border-bottom: none; }
.ct-storm-stat span:first-child { color: var(--text-dim); }
.ct-storm-stat span:last-child { color: var(--text); font-weight: 600; }

/* ===== Live Indicator ===== */
.ct-live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}
.ct-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: ct-pulse 2s infinite;
}
@keyframes ct-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ===== Section ===== */
.ct-section {
  padding: 4rem 1.5rem;
}
.ct-section-dark { background: var(--bg2); }
.ct-container { max-width: var(--max-w); margin: 0 auto; }

.ct-section-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.ct-section-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #e8edf5, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ct-section-sub { color: var(--text-dim); margin-bottom: 2rem; }

/* ===== Stats Grid ===== */
.ct-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.ct-stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.ct-stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}
.ct-stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ===== Footer ===== */
.ct-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.ct-footer-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 0.75rem 0;
}
.ct-footer-links a { color: var(--text-dim); font-size: 0.8rem; }
.ct-footer-links a:hover { color: var(--accent); }

/* ===== Leaflet Overrides ===== */
.leaflet-container { background: #253858 !important; }
.leaflet-control-zoom a { background: var(--bg3) !important; color: var(--text) !important; border-color: var(--border) !important; box-shadow: var(--shadow) !important; }
.leaflet-control-attribution { display: none !important; }

/* ===== Loading ===== */
.ct-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  flex-direction: column;
  gap: 1rem;
}
.ct-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ct-spin 0.8s linear infinite;
}

/* ===== Cyclone Marker ===== */
.ct-cyclone-icon { background: none !important; border: none !important; }
.ct-cyclone { position: relative; }
.ct-cyclone-label {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0,0,0,0.6);
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

/* Pure CSS Cyclone */
.ct-cyc { position: relative; }
.ct-cyc-arm {
  position: absolute;
  top: 8%;
  left: 8%;
  width: 84%;
  height: 84%;
  border: 4px solid;
  border-radius: 50%;
  animation: ct-spin linear infinite;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  opacity: 0.85;
  filter: drop-shadow(0 0 6px currentColor);
}
.ct-cyc-arm2 {
  position: absolute;
  top: 18%;
  left: 18%;
  width: 64%;
  height: 64%;
  border: 3px solid;
  border-radius: 50%;
  animation: ct-spin-rev linear infinite;
  animation-duration: 3.5s;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  opacity: 0.6;
  filter: drop-shadow(0 0 4px currentColor);
}
.ct-cyc-eye {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24%;
  height: 24%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.95;
  box-shadow: 0 0 12px currentColor;
}
.ct-cyc-pupil {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10%;
  height: 10%;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  transform: translate(-50%, -50%);
}
.ct-cyc-ring {
  position: absolute;
  top: 5%;
  left: 5%;
  width: 90%;
  height: 90%;
  border: 1px dashed;
  border-radius: 50%;
  opacity: 0.25;
  animation: ct-pulse-ring 3s ease-in-out infinite;
}
.ct-cyc-ring2 {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  border: 1px dashed;
  border-radius: 50%;
  opacity: 0.15;
  animation: ct-pulse-ring 4s ease-in-out infinite 0.5s;
}
.ct-cyc-tag {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 800;
  color: #e8edf5;
  background: #1e2a42;
  padding: 0 5px;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
@keyframes ct-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes ct-spin-rev { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
@keyframes ct-pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.25; }
  50% { transform: scale(1.08); opacity: 0.4; }
}

/* ===== Storm Cards ===== */
.ct-card {
  display: block;
  background: var(--bg3);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid var(--accent);
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.ct-card:hover { transform: translateX(-4px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.ct-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.ct-meta { display: flex; gap: 0.75rem; margin-top: 0.3rem; font-size: 0.8rem; color: var(--text-dim); }
.ct-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.ct-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ct-stat-row:last-child { border-bottom: none; }
.ct-stat-row span:first-child { color: var(--text-dim); }
.ct-stat-row span:last-child { color: var(--text); font-weight: 600; }

.ct-storm-detail {
  background: var(--bg3);
  border-radius: 10px;
  padding: 0.75rem;
  margin: 0.5rem 0;
  box-shadow: var(--shadow);
}
.ct-cat-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
}
.ct-tip { background: var(--bg2) !important; border: 1px solid var(--border) !important; color: var(--text) !important; }
.ct-empty { text-align: center; padding: 2rem; color: var(--text-dim); }

/* ===== No storms message ===== */
.ct-no-storms {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
}
.ct-no-storms p { font-size: 0.9rem; margin-top: 0.5rem; }

/* ===== Tooltip ===== */
.ct-tooltip {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .ct-overlay {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-height: none;
    padding: 1rem;
  }
  .ct-hero { height: auto; }
  #ctMap { height: 60vh; }
}
