/* --------------------------- */
/* style.css - Flux.com Robust */
/* --------------------------- */

/* Body & Global */
body {
  font-family: 'Inter', sans-serif;
  background-color: #f3f4f6; /* Tailwind gray-100 */
  color: #111827; /* Tailwind gray-900 */
  margin: 0;
  padding-top: 70px;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
}

/* Headline rotation */
.headline {
  display: none;
  font-weight: 600;
  font-size: 1.25rem;
  color: #1f2937; /* Tailwind gray-800 */
  margin: 0.5rem 0;
  transition: opacity 0.5s ease-in-out;
}

.headline.active {
  display: block;
  opacity: 1;
}

/* Hero Banner Headlines - larger on bigger screens */
@media (min-width: 768px) {
  .headline {
    font-size: 1.5rem;
  }
}

/* News container */
#newsContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 1rem auto;
  max-width: 1200px;
}

/* News cards */
.news-card {
  background-color: #ffffff;
  border-radius: 0.5rem;
  overflow: hidden;
  flex: 1 1 300px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 25px rgba(0,0,0,0.15);
}

/* News content inside card */
.news-card h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin: 0.5rem 0;
}

.news-card h3 {
  font-size: 0.95rem;
  font-weight: 400;
  color: #4b5563; /* Tailwind gray-600 */
  margin-bottom: 0.5rem;
}

/* Media inside cards */
.news-card img, .news-card video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 0;
}

/* Skeleton loader */
.skeleton {
  width: 100%;
  height: 220px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Toast notification */
#newsToast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background-color: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  max-width: 350px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease, bottom 0.5s ease;
  z-index: 9999;
}

#newsToast.toast-slide-in {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#newsToast.toast-slide-out {
  opacity: 0;
  transform: translateY(20px);
}

#toastImage {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 0.375rem;
  margin-right: 0.75rem;
}

#toastTitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

#toastLink {
  text-decoration: none;
  color: #3b82f6; /* Tailwind blue-500 */
  margin-left: auto;
}

#toastLink:hover {
  text-decoration: underline;
}

#toastClose {
  background: none;
  border: none;
  font-size: 1rem;
  margin-left: 0.5rem;
  cursor: pointer;
}

/* Ads */
.ad-card {
  background-color: #fef3c7; /* Tailwind yellow-100 */
  border: 1px dashed #f59e0b; /* Tailwind amber-500 */
  text-align: center;
  padding: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  color: #78350f; /* Tailwind amber-800 */
  margin: 1rem 0;
}

#topAd {
  background-color: #fde68a; /* Tailwind yellow-200 */
  border: 1px dashed #f59e0b;
  border-radius: 0.5rem;
  text-align: center;
  padding: 1rem;
  font-weight: 600;
  color: #78350f;
  margin-bottom: 1rem;
}

/* Header & Footer */
header, .navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
footer {
  font-size: 0.9rem;
}

/* Loading / errors */
#newsContainer p {
  font-size: 1.1rem;
  text-align: center;
  width: 100%;
  color: #ef4444; /* Tailwind red-500 */
}

/* Hero Banner Image Overlay Fix */
#heroBanner img {
  z-index: 0;
}
#heroBanner .relative.z-10 {
  z-index: 10;
}

/* Responsive */
@media (max-width: 1024px) {
  #newsContainer {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 640px) {
  img, video {
    max-height: 200px;
  }
  .news-card {
    max-width: 90%;
  }
  #toastImage {
    width: 50px;
    height: 50px;
  }
}

/* --------------------- */
/* NEWS FLASH FLOATING LIST */
/* --------------------- */
#newsFlash {
  position: fixed;
  top: 60px;
  left: 20px;
  width: 250px;
  max-height: 40px;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
  font-family: sans-serif;
  z-index: 9999;
  overflow: hidden;
  transition: max-height 0.3s ease;
  cursor: pointer;
}

#newsFlash ul {
  padding-left: 16px;
  margin: 0;
  list-style-type: disc;
  display: none;
}

#newsFlash li {
  margin: 4px 0;
}

#newsFlashToggle {
  font-size: 18px;
  color: #b45309;
  cursor: pointer;
}

/* --------------------- */
/* NEWS POPUP */
/* --------------------- */
.popup {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  max-width: 90%;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 10000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup.hidden {
  display: none;
}

.popup-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.popup-body {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popup-body h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.popup-body a {
  font-size: 0.875rem;
  color: #3b82f6;
  text-decoration: none;
}

.popup-body a:hover {
  text-decoration: underline;
}

.popup-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #4b5563;
  cursor: pointer;
}

/* Share button */
.share-btn {
  background-color: #3b82f6; /* Tailwind blue-500 */
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.3s ease;
  margin-top: auto; /* push button to bottom if needed */
}

.share-btn:hover {
  background-color: #2563eb; /* Tailwind blue-600 */
}

/* Continuous scrolling ticker animation */
@keyframes scrollTicker {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Smooth blinking animation for the news bar */
@keyframes flashBackground {
  0%, 100% {
    background-color: #fef9c3; /* light yellow */
  }
  50% {
    background-color: #fef08a; /* slightly deeper yellow */
  }
}

#newsFlashBar {
  animation: flashBackground 3s ease-in-out infinite;
  overflow: hidden;
}

#newsFlashTicker span {
  margin-right: 2rem;
  display: inline-block;
  white-space: nowrap;
  transition: color 0.3s ease;
}

#newsFlashTicker span:hover {
  color: #b45309; /* darker gold tone on hover */
}
