:root {
  --bg: #121212;
  --bg-elev: #1a1a1a;
  --text: #e9ecef;
  --muted: #a9b1b9;
  --primary: #0d6efd;
  --border: #2b2f33;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
}

.bg-black {
  background-color: #000 !important;
}

.text-secondary {
  color: var(--muted) !important;
}

.logbook-frame {
  min-height: 320px;
  height: 44vh;
  max-height: 720px;
  border: 0;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(96, 165, 250, 0.1);
  transition: box-shadow 0.3s ease;
}

.logbook-frame:hover {
  box-shadow: 0 8px 24px rgba(96, 165, 250, 0.2);
}

.logbook-card {
  transition: all 0.3s ease;
  border-color: rgba(96, 165, 250, 0.2) !important;
}

.logbook-card:hover {
  border-color: rgba(96, 165, 250, 0.4) !important;
  box-shadow: 0 12px 32px rgba(96, 165, 250, 0.2) !important;
  transform: translateY(-2px);
}

/* Section animations */
section {
  animation: sectionFadeIn 0.8s ease-out backwards;
}

section:nth-of-type(1) {
  animation-delay: 0.2s;
}
section:nth-of-type(2) {
  animation-delay: 0.3s;
}
section:nth-of-type(3) {
  animation-delay: 0.4s;
}

@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.resource.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  background: linear-gradient(
    135deg,
    rgba(40, 40, 40, 0.95) 0%,
    rgba(30, 30, 30, 0.98) 100%
  );
  border: 1px solid rgba(96, 165, 250, 0.15);
  animation: cardPulse 3s ease-in-out infinite;
}

.resource.card .card-title {
  color: #ffffff;
}

.resource.card .card-text {
  color: #d1d5db;
}

.resource.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(96, 165, 250, 0.25),
    0 0 40px rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.4);
}

.resource.card .stretched-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
  padding: 0;
  border-bottom: 2px solid rgba(96, 165, 250, 0.3);
  transition: all 0.2s ease;
}

.resource.card .stretched-link:hover {
  color: #93c5fd;
  border-bottom-color: #60a5fa;
  padding-bottom: 2px;
}

@keyframes cardPulse {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 2px 12px rgba(96, 165, 250, 0.15);
  }
}

.border-secondary-subtle {
  border-color: var(--border) !important;
}

.py-lg-6 {
  padding-top: 5rem !important;
  padding-bottom: 5rem !important;
}

@media (max-width: 576px) {
  .logbook-frame {
    height: 300px;
  }
}

/* ========== Modern hero with radio spectrum visualization ========== */
.hero {
  position: relative;
  min-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4rem 0 3rem;
  background: linear-gradient(180deg, #0a0e1a 0%, #0d1420 60%, #0a0a0a 100%);
  border-bottom: 1px solid rgba(96, 165, 250, 0.2);
}

.hero-content {
  z-index: 10;
  animation: fadeInScale 0.7s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Waterfall spectrum visualization (dense grid like real spectrum analyzer) */
.spectrum-waterfall {
  position: relative;
  width: 100%;
  height: auto;
  max-height: 200px;
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(100, 1fr);
  grid-auto-rows: 1px;
  gap: 0;
  padding: 0;
  opacity: 0.85;
  z-index: 5;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 0.25rem;
  contain: layout style paint;
  will-change: contents;
}

.waterfall-pixel {
  width: 100%;
  height: 100%;
  border-radius: 0px;
  background-color: rgba(30, 100, 200, 0.95);
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: 0;
}

/* Optimized color mapping for signal strength - smoother gradients */
.waterfall-pixel[data-strength="0"] {
  background-color: #0f172a;
}

.waterfall-pixel[data-strength="1"] {
  background-color: #1a1a70;
}

.waterfall-pixel[data-strength="2"] {
  background-color: #1e64c8;
}

.waterfall-pixel[data-strength="3"] {
  background-color: #0096c8;
}

.waterfall-pixel[data-strength="4"] {
  background-color: #00c864;
}

.waterfall-pixel[data-strength="5"] {
  background-color: #64ff00;
}

.waterfall-pixel[data-strength="6"] {
  background-color: #ffff00;
}

.waterfall-pixel[data-strength="7"] {
  background-color: #ffc800;
}

.waterfall-pixel[data-strength="8"] {
  background-color: #ff6400;
}

.waterfall-pixel[data-strength="9"] {
  background-color: #ff0000;
}

@keyframes waterfallScroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(2px);
  }
}

/* Morse code animation - N4DEV */
.morse-code {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.morse-dot,
.morse-dash {
  display: inline-block;
  background: rgba(96, 165, 250, 0.4);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
  opacity: 0.3;
  transition: all 0.1s ease;
}

.morse-dot {
  width: 10px;
  height: 10px;
}

.morse-dash {
  width: 24px;
  height: 10px;
}

.morse-space {
  display: inline-block;
  width: 8px;
}

.morse-dot.is-on,
.morse-dash.is-on {
  opacity: 1;
  background: rgba(96, 165, 250, 1);
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.9), 0 0 35px rgba(96, 165, 250, 0.5);
}

/* Callsign title with typing effect */
.callsign-title {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.1em;
  position: relative;
  display: inline-block;
  font-family: "Courier New", monospace;
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(96, 165, 250, 0.7));
  }
}

/* CQ Badge with signal indicator */
.cq-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  font-family: "Courier New", monospace;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
}

.cq-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 50%;
  animation: signalBlink 2s ease-in-out infinite;
  box-shadow: 0 0 10px #34d399;
}

@keyframes signalBlink {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* Cards and subtle polish */
.card {
  backdrop-filter: saturate(120%) blur(0px);
  border: 1px solid rgba(96, 165, 250, 0.1);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 4px 16px rgba(96, 165, 250, 0.15);
}

/* Animated section headers */
section h2,
section h3 {
  position: relative;
  display: inline-block;
}

section h2::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(96, 165, 250, 0.6),
    transparent
  );
  animation: slideIn 2s ease-out;
}

@keyframes slideIn {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 100%;
    opacity: 1;
  }
}

/* Propagation section enhancements */
#propagation .card {
  animation: fadeInUp 0.6s ease-out backwards;
}

#propagation .card:nth-child(1) {
  animation-delay: 0.1s;
}
#propagation .card:nth-child(2) {
  animation-delay: 0.2s;
}
#propagation .card:nth-child(3) {
  animation-delay: 0.3s;
}
#propagation .card:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quick-links a:hover {
  text-decoration: underline;
}

/* UTC clock badge in hero */
.utc-clock {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #60a5fa;
  border-radius: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-family: ui-monospace, SFMono-Regular, "Courier New", monospace;
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  animation: slideInFade 0.5s ease-out 0.3s both;
  z-index: 15;
}

@keyframes slideInFade {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .utc-clock {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .morse-code {
    top: 15%;
    gap: 8px;
  }

  .freq-marker {
    max-width: 35px;
  }
}

/* Button enhancements */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.3);
  animation: buttonGlow 3s ease-in-out infinite;
}

@keyframes buttonGlow {
  0%,
  100% {
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.3);
  }
  50% {
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.5);
  }
}

.btn-outline-light:hover,
.btn-outline-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(96, 165, 250, 0.3);
}

.thumb-cover {
  object-fit: cover;
  width: 100%;
}

/* Section backgrounds - improved visuals */
#logbook {
  background: linear-gradient(180deg, #0f1419 0%, #0a0f16 100%);
}

#propagation {
  background: linear-gradient(180deg, #0a0f16 0%, #0d1420 100%);
}

#resources {
  background: linear-gradient(180deg, #0d1420 0%, #0f1419 100%);
}

#bandplan {
  background: linear-gradient(180deg, #0f1419 0%, #0a0f16 100%);
}

#digital {
  background: linear-gradient(180deg, #0a0f16 0%, #0d1420 100%);
}

#satellites {
  background: linear-gradient(180deg, #0d1420 0%, #0f1419 100%);
}

#awards {
  background: linear-gradient(180deg, #0f1419 0%, #0a0f16 100%);
}

#contests {
  background: linear-gradient(180deg, #0a0f16 0%, #0d1420 100%);
}

#contact {
  background: linear-gradient(180deg, #0d1420 0%, #050810 100%);
}

/* Enhanced section styling */
section {
  position: relative;
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(96, 165, 250, 0.3),
    transparent
  );
  pointer-events: none;
}

section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(96, 165, 250, 0.15),
    transparent
  );
  pointer-events: none;
}

/* Prevent double lines on hero and footer */
.hero::before,
.hero::after {
  display: none;
}

footer::before,
footer::after {
  display: none;
}

/* HAM Radio Band Plan Table */
.band-plan-table {
  border-collapse: collapse;
  background: rgba(13, 20, 32, 0.8);
  border: 1px solid rgba(96, 165, 250, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 0.6s ease-out backwards;
}

.band-plan-table thead {
  background: linear-gradient(
    90deg,
    rgba(6, 182, 212, 0.15),
    rgba(59, 130, 246, 0.15)
  );
  border-bottom: 2px solid rgba(96, 165, 250, 0.3);
}

.band-plan-table thead th {
  color: #60a5fa;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding: 0.75rem;
  text-align: left;
}

.band-plan-table tbody tr {
  border-bottom: 1px solid rgba(96, 165, 250, 0.1);
  transition: all 0.3s ease;
}

.band-plan-table tbody tr:hover {
  background: rgba(96, 165, 250, 0.1);
  box-shadow: inset 3px 0 0 rgba(96, 165, 250, 0.5);
}

.band-plan-table td {
  padding: 0.75rem;
  font-size: 0.95rem;
}

/* Color coding for different band categories */
.band-160 {
  border-left: 4px solid #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.band-80 {
  border-left: 4px solid #f97316;
  background: rgba(249, 115, 22, 0.08);
}

.band-40 {
  border-left: 4px solid #eab308;
  background: rgba(234, 179, 8, 0.08);
}

.band-30 {
  border-left: 4px solid #84cc16;
  background: rgba(132, 204, 22, 0.08);
}

.band-20 {
  border-left: 4px solid #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.band-17 {
  border-left: 4px solid #06b6d4;
  background: rgba(6, 182, 212, 0.08);
}

.band-15 {
  border-left: 4px solid #0ea5e9;
  background: rgba(14, 165, 233, 0.08);
}

.band-12 {
  border-left: 4px solid #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.band-10 {
  border-left: 4px solid #6366f1;
  background: rgba(99, 102, 241, 0.08);
}

.band-6 {
  border-left: 4px solid #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
}

.band-2 {
  border-left: 4px solid #d946ef;
  background: rgba(217, 70, 239, 0.08);
}

.band-70 {
  border-left: 4px solid #ec4899;
  background: rgba(236, 72, 153, 0.08);
}

.band-plan-table tbody tr:first-child.band-160,
.band-plan-table tbody tr:last-child.band-70 {
  border-radius: 0.375rem;
}

/* Award Cards */
.award-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  background: linear-gradient(
    135deg,
    rgba(40, 40, 40, 0.95) 0%,
    rgba(30, 30, 30, 0.98) 100%
  );
  border: 1px solid rgba(96, 165, 250, 0.15) !important;
}

.award-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(13, 110, 253, 0.2);
  border-color: rgba(96, 165, 250, 0.4) !important;
}

.award-card .card-title {
  color: #ffffff;
}

.award-badge {
  font-size: 2.5rem;
  line-height: 1;
}

/* Scroll Progress Bar */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(
    90deg,
    #ff0000 0%,
    #ffff00 25%,
    #00ff00 50%,
    #0000ff 75%,
    #ff00ff 100%
  );
  width: 0%;
  z-index: 9999 !important;
  box-shadow: 0 0 20px rgba(255, 0, 0, 1);
  transition: width 0.15s ease;
  pointer-events: none;
}

/* Enhanced navbar with progress bar */
.navbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1999 !important;
  will-change: transform;
}
