/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: linear-gradient(180deg, #090040 0%, #471396 100%);
  color: #FFCC00;
  font-family: 'VCR OSD Mono', 'Courier New', Courier, monospace;
  overflow-x: hidden;
}

/* Prevent text cursor and enhance accessibility */
body,
header h1,
.content-caption,
.copyright,
.link {
  user-select: none; /* Prevent text selection */
  cursor: default; /* Default cursor for non-interactive elements */
}

a,
button {
  outline: none; /* Remove default browser outline */
}

a:focus,
button:focus {
  box-shadow: 0 0 8px 2px #B13BFF; /* Neon purple glow for focus */
  transition: box-shadow 0.3s ease;
}

/* Header */
header {
  padding: 1.5rem;
  text-align: center;
  background: rgba(9, 0, 64, 0.8);
  box-shadow: 0 0 20px rgba(177, 59, 255, 0.5);
}

header h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: #FFCC00;
  text-shadow: 0 0 10px #B13BFF, 0 0 20px #B13BFF;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: neon-glow 3s ease-in-out infinite;
}

.homeLink {
  text-decoration: none;
}

/* Main content */
.latest {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  gap: 2rem;
}

.content {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.content-img-container {
  position: relative;
  width: 100%;
  display: flex; /* Added for centering */
  justify-content: center; /* Center the image horizontally */
}

.content-img {
  width: 50%; /* Reduced from 100% to make image smaller */
  max-width: 400px; /* Optional: cap the size for consistency */
  height: auto;
  object-fit: cover;
  border-radius: 50%;
  filter: contrast(1.2) brightness(0.9);
  box-shadow: 0 0 15px rgba(177, 59, 255, 0.7);
}

.content-caption {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #FFCC00;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  text-align: center;
  background: rgba(9, 0, 64, 0.7);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  text-shadow: 0 0 5px #B13BFF;
  text-transform: uppercase;
}

/* News container */
#news-container {
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* News item styles */
.news-item {
  position: relative; /* For scanline effect */
  background: rgba(9, 0, 64, 0.85);
  border: 3px solid #FFCC00;
  border-radius: 10px;
  padding: 1rem; /* Reduced for compactness */
  margin-bottom: 1rem; /* Reduced for compactness */
  box-shadow: 0 0 15px rgba(177, 59, 255, 0.6), inset 0 0 10px rgba(177, 59, 255, 0.3);
  transition: all 0.3s ease;
  animation: neon-pulse 4s ease-in-out infinite;
}

.news-item:hover {
  transform: translateY(-3px); /* Reduced for subtler effect */
  box-shadow: 0 0 20px rgba(177, 59, 255, 0.8), inset 0 0 12px rgba(177, 59, 255, 0.5);
}

/* Scanline effect for CRT monitor retro look */
.news-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

.news-link {
  position: relative; /* Ensure link content is above scanline */
  z-index: 2;
  text-decoration: none;
  display: block; /* Ensure full width for hover */
}

.news-link h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem); /* Slightly smaller for compactness */
  color: #FFCC00;
  text-shadow: 0 0 8px #B13BFF;
  margin: 0; /* Remove margin for tighter layout */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.news-link h3:hover {
  color: #B13BFF;
  text-shadow: 0 0 10px #FFCC00;
  animation: glitch 0.3s linear;
}

/* Custom tooltip styling for retro feel */
.custom-tooltip .tooltip-inner {
  background: rgba(9, 0, 64, 0.9);
  color: #FFCC00;
  font-family: 'VCR OSD Mono', 'Courier New', Courier, monospace;
  text-shadow: 0 0 5px #B13BFF;
  border: 2px solid #B13BFF;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.9rem;
  max-width: 350px; /* Slightly wider for more content */
}

.custom-tooltip .tooltip-arrow::before {
  border-top-color: #B13BFF !important;
}

.tooltip-content {
  text-align: left;
}

.tooltip-snippet {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.tooltip-source,
.tooltip-date {
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  color: #E6E6FA;
}

.tooltip-source strong,
.tooltip-date strong {
  color: #FFCC00;
}

/* Footer */
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: rgba(9, 0, 64, 0.8);
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.copyright {
  color: #FFCC00;
  text-shadow: 0 0 5px #B13BFF;
}

.links {
  display: flex;
  gap: 1rem;
}

.link {
  color: #FFCC00;
  text-decoration: none;
  transition: color 0.3s ease;
}

.link:hover {
  color: #B13BFF;
  text-shadow: 0 0 5px #FFCC00;
}

/* Headline container */
.headline-cont {
  display: flex;
  flex-direction: column;
}

.headline-tag {
  text-align: center;
  font-size: clamp(2rem, 4vw, 2.5rem);
  color: #FFCC00;
  text-shadow: 0 0 10px #B13BFF;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

/* Neon glow animation */
@keyframes neon-glow {
  0%, 100% {
    text-shadow: 0 0 10px #B13BFF, 0 0 20px #B13BFF;
    box-shadow: 0 0 10px rgba(177, 59, 255, 0.5);
  }
  50% {
    text-shadow: 0 0 15px #B13BFF, 0 0 30px #B13BFF;
    box-shadow: 0 0 15px rgba(177, 59, 255, 0.7);
  }
}

/* Neon pulse animation for news items */
@keyframes neon-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(177, 59, 255, 0.6), inset 0 0 10px rgba(177, 59, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(177, 59, 255, 0.8), inset 0 0 15px rgba(177, 59, 255, 0.4);
  }
}

/* Glitch animation for headlines on hover */
@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

/* Override Bootstrap styles */
.btn {
  font-family: 'VCR OSD Mono', 'Courier New', Courier, monospace !important;
  background: linear-gradient(45deg, #471396, #B13BFF) !important;
  color: #FFCC00 !important;
  border: 3px solid #FFCC00 !important;
  border-radius: 15px !important;
  transition: all 0.3s ease !important;
}

.btn:hover {
  background: linear-gradient(45deg, #B13BFF, #471396) !important;
  color: #090040 !important;
  transform: translateY(-3px);
  box-shadow: 0 0 20px rgba(177, 59, 255, 0.8);
}

.btn:focus {
  box-shadow: 0 0 8px 2px #B13BFF !important;
}

/* Responsive design */
@media (max-width: 600px) {
  header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
  }

  .content-caption {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
  }

  .news-item {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .news-link h3 {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
  }

  .headline-tag {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
  }

  footer {
    flex-direction: column;
    gap: 1rem;
  }

  .custom-tooltip .tooltip-inner {
    font-size: 0.8rem;
    max-width: 280px;
  }

  .tooltip-snippet {
    font-size: 0.75rem;
  }

  .tooltip-source,
  .tooltip-date {
    font-size: 0.7rem;
  }
}

.article-counter {
  font-family: 'VCR OSD Mono', monospace;
  font-size: 1.2rem;
  color: #FFCC00;
  text-shadow: 0 0 5px #B13BFF;
  margin-bottom: 1rem;
  text-align: center;
}