/* Global Styles */
:root {
  --primary-color: #dc3545;
  --secondary-color: #6c757d;
  --dark-color: #343a40;
  --light-color: #f8f9fa;
  --success-color: #28a745;
  --info-color: #17a2b8;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
}

/* General Styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
}

/* Navbar */
.navbar {
  background-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
  max-height: 40px;
  width: auto;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.nav-link:hover {
  transform: translateY(-2px);
}

.social-icons a {
  transition: all 0.3s ease;
}

.social-icons a:hover {
  transform: scale(1.2);
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  padding: 0.5rem 1rem;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: #fff;
}

.navbar-dark .navbar-nav .nav-link.active {
  color: #fff;
  font-weight: 600;
}

/* Hero Section */
.hero {
  background-size: cover;
  background-position: center;
  color: white;
  padding: 6rem 0;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
}

.play-button {
  transition: all 0.3s ease;
}

.play-button:hover {
  transform: scale(1.1);
  color: var(--primary-color) !important;
}

/* Breaking News */
.breaking-news {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.breaking-news-label {
  border-radius: 4px;
  white-space: nowrap;
}

.ticker-wrap {
  width: 100%;
  overflow: hidden;
}

.ticker {
  display: flex;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}

.ticker-item {
  padding: 0 2rem;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Section Headers */
.section-header {
  position: relative;
  margin-bottom: 2rem;
}

.section-divider {
  height: 4px;
  width: 60px;
  background-color: var(--primary-color);
  margin-top: 0.5rem;
}

/* Featured News */
.main-news-item {
  overflow: hidden;
  border-radius: 0.5rem;
}

.news-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

.news-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.news-title-sm {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
}

.secondary-news-item {
  transition: all 0.3s ease;
}

.secondary-news-item:hover {
  transform: translateY(-5px);
}

/* Cards */
.card {
  transition: all 0.3s ease;
  border-radius: 0.5rem;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.card-img-top {
  height: 180px;
  object-fit: cover;
}

/* Schedule Table */
.schedule-table th,
.schedule-table td {
  padding: 1rem;
}

.time-column {
  width: 100px;
}

.schedule-table th {
  background-color: #f8f9fa;
}

.schedule-table tr:hover {
  background-color: #f1f1f1;
}

/* Newsletter */
.newsletter {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Footer */
footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

footer h5 {
  font-weight: 600;
  margin-bottom: 1.25rem;
}

footer ul li {
  margin-bottom: 0.5rem;
}

footer a {
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Live TV Page */
.channel-card {
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.channel-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  margin-bottom: 2rem;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* About Page */
.team-member {
  text-align: center;
  margin-bottom: 2rem;
}

.team-member img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
}

.timeline {
  position: relative;
  padding: 0;
  list-style: none;
}

.timeline:before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background-color: #e9ecef;
}

.timeline-item {
  position: relative;
  margin-bottom: 50px;
}

.timeline-badge {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50px;
  height: 50px;
  margin-left: -25px;
  border-radius: 50%;
  text-align: center;
  font-size: 1.4em;
  line-height: 50px;
  background-color: var(--primary-color);
  color: white;
  z-index: 100;
}

.timeline-panel {
  position: relative;
  float: left;
  width: 46%;
  padding: 20px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

.timeline-item:nth-child(even) .timeline-panel {
  float: right;
}

.timeline-item:nth-child(odd) .timeline-panel::after {
  content: "";
  position: absolute;
  top: 20px;
  right: -10px;
  width: 20px;
  height: 20px;
  transform: rotate(45deg);
  background-color: #fff;
  box-shadow: 1px -1px 1px rgba(0, 0, 0, 0.1);
}

.timeline-item:nth-child(even) .timeline-panel::after {
  content: "";
  position: absolute;
  top: 20px;
  left: -10px;
  width: 20px;
  height: 20px;
  transform: rotate(45deg);
  background-color: #fff;
  box-shadow: -1px 1px 1px rgba(0, 0, 0, 0.1);
}

/* Contact Page */
.map-container {
  height: 400px;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.contact-info-item {
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  height: 100%;
}

/* Contact Form */
.contact-form label {
  font-weight: 500;
}

/* Programs Page */
.program-filter-btn {
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  margin: 0 0.25rem 0.5rem;
  transition: all 0.3s ease;
}

.program-filter-btn.active {
  background-color: var(--primary-color);
  color: white;
}

.program-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.program-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.program-card img {
  height: 200px;
  object-fit: cover;
}

.program-meta {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.program-meta i {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

/* News Page */
.news-filter {
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}

.news-card {
  transition: transform 0.3s ease;
  height: 100%;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
}

.news-card img {
  height: 180px;
  object-fit: cover;
}

.news-categories {
  margin-bottom: 2rem;
}

.category-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem 0.5rem 0;
  border-radius: 50px;
  background-color: #f8f9fa;
  color: #333;
  transition: all 0.3s ease;
}

.category-badge:hover,
.category-badge.active {
  background-color: var(--primary-color);
  color: white;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
  .timeline:before {
    left: 60px;
  }

  .timeline-badge {
    left: 60px;
  }

  .timeline-panel {
    width: calc(100% - 90px);
    float: right;
  }

  .timeline-item:nth-child(odd) .timeline-panel::after {
    left: -10px;
    right: auto;
    box-shadow: -1px 1px 1px rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 4rem 0;
  }

  .program-card img,
  .news-card img {
    height: 160px;
  }
}

@media (max-width: 767.98px) {
  .hero-section {
    padding: 3rem 0;
  }

  .section-header {
    text-align: center;
  }

  .section-divider {
    margin-left: auto;
    margin-right: auto;
  }

  .news-overlay {
    padding: 1rem;
  }

  .news-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 575.98px) {
  .breaking-news-label {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }

  .ticker-item {
    padding: 0 1rem;
  }

  .card-img-top {
    height: 160px;
  }
}

/* Mobile Optimization */
@media (max-width: 767.98px) {
  /* Adjust navbar for mobile */
  .navbar-collapse {
    background-color: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
  }

  /* Ensure menu items are properly spaced on mobile */
  .navbar-nav .nav-item {
    margin-bottom: 0.5rem;
  }

  /* Adjust social icons spacing on mobile */
  .social-icons {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
  }

  /* Make language switcher centered on mobile */
  .navbar-collapse .me-3 {
    margin: 1rem 0;
    text-align: center;
    display: flex;
    justify-content: center;
  }

  /* Improve table responsiveness */
  .schedule-table th,
  .schedule-table td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  /* Adjust section padding for mobile */
  section {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  /* Improve card spacing on mobile */
  .card {
    margin-bottom: 1.5rem;
  }

  /* Adjust footer spacing on mobile */
  footer .col-lg-2,
  footer .col-lg-3,
  footer .col-lg-4 {
    margin-bottom: 1.5rem;
  }
}

/* Ensure images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Improve form elements on mobile */
@media (max-width: 575.98px) {
  .form-control,
  .btn {
    font-size: 0.9rem;
  }

  .input-group {
    width: 100%;
  }
}

/* Live TV Page */
.program-info {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.next-programs {
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.5rem;
}

.next-program-item {
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 0;
}

.next-program-item:last-child {
  border-bottom: none;
}

.program-time {
  font-weight: bold;
  color: #0d6efd;
}

/* ===== Full-width Hero Banner (home) ===== */
.hero-banner {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-color: var(--dark-color);
  color: #fff;
  overflow: hidden;
}
.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.78) 0%, rgba(220, 53, 69, 0.55) 100%);
  z-index: 1;
}
.hero-banner-content {
  position: relative;
  z-index: 2;
  padding: 4rem 1rem;
  width: 100%;
}
.hero-banner h1 {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.hero-banner .lead {
  max-width: 760px;
}
@media (max-width: 768px) {
  .hero-banner { min-height: 58vh; }
  .hero-banner h1 { font-size: 2.4rem; }
}

/* ===== Partners marquee ===== */
.partners-marquee {
  overflow: hidden;
  position: relative;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.partners-track {
  display: flex;
  align-items: center;
  gap: 4rem;
  width: max-content;
  animation: partners-scroll 35s linear infinite;
}
.partners-marquee:hover .partners-track {
  animation-play-state: paused;
}
.partners-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.partners-logo {
  height: 70px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.65;
  transition: all 0.3s ease;
}
.partners-item a:hover .partners-logo,
.partners-logo:hover {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.05);
}
@keyframes partners-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Partners page grid */
.partner-grid-item {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}
.partner-grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.partner-grid-item img {
  max-height: 90px;
  width: auto;
  object-fit: contain;
}

/* ===== Programas: flip cards ===== */
.program-card .flip-card {
  perspective: 1400px;
  height: 420px;
  outline: none;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner,
.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  background: #fff;
}
.flip-card-front {
  display: flex;
  flex-direction: column;
}
.flip-card-img {
  width: 100%;
  height: 68%;
  object-fit: cover;
  display: block;
}
.flip-card-front-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
}
.flip-card-hint {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.flip-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #2b2f33 0%, #1a1d20 100%);
  color: #fff;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.flip-card-back h4 {
  color: #fff;
  font-weight: 700;
}
.flip-card-back .flip-desc {
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.75rem;
  overflow: auto;
}
.flip-card-back .program-meta {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.35rem;
}
.flip-card-back .program-meta i {
  color: var(--primary-color);
}
.flip-card-back .btn {
  align-self: flex-start;
}
/* Touch / no-hover devices: tap-to-flip via .is-flipped (focus-within already covers tap) */
@media (hover: none) {
  .flip-card-hint { background: rgba(220, 53, 69, 0.95); }
}

/* ===== Wordmark logo (wide) ===== */
.navbar-brand { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.navbar-brand .navbar-logo {
  height: 38px;
  width: auto;
  max-height: 38px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
}
.footer-logo {
  height: 48px;
  width: auto;
}
@media (max-width: 575.98px) {
  .navbar-brand .navbar-logo { height: 32px; max-height: 32px; }
}

/* ===== Page hero header (background image + overlay) ===== */
.page-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: var(--dark-color);
  background-repeat: no-repeat;
  color: #fff;
  text-align: center;
  padding: 5.5rem 0;
}
.page-hero h1 {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.page-hero .lead {
  color: rgba(255, 255, 255, 0.92);
}
@media (max-width: 768px) {
  .page-hero { padding: 3.5rem 0; }
}

/* ===== Schedule: programme logo next to name ===== */
.schedule-prog-logo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.schedule-prog-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2b2f33, #1a1d20);
  color: #fff;
  font-size: 0.95rem;
}
.schedule-table .nav-link { white-space: nowrap; }

/* ===== Home promo popup (Destaque) ===== */
.mbc-promo-modal .modal-content {
  border-radius: 0.75rem;
}
.mbc-promo-media {
  min-height: 320px;
  background-size: cover;
  background-position: center;
}
.mbc-promo-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.mbc-promo-text {
  color: #555;
  line-height: 1.6;
}
.mbc-promo-close {
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  z-index: 5;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  padding: 0.55rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
@media (max-width: 767.98px) {
  .mbc-promo-media { min-height: 200px; }
}

/* ===== MBC banners / campaigns ===== */
.mbc-banner { padding: 1.5rem 0; }
.mbc-banner-home-billboard { padding-top: 2rem; padding-bottom: 0.5rem; }
.mbc-banner-wrap { position: relative; }
.mbc-banner-link { display: block; line-height: 0; }
.mbc-banner-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.mbc-banner-link:hover .mbc-banner-img {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}
.mbc-banner-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 8px;
  border-radius: 4px;
}
.mbc-banner-fallback {
  text-align: center;
  padding: 2rem;
  border: 1px dashed #ced4da;
  border-radius: 0.5rem;
  background: #f8f9fa;
}
.mbc-banner-in-article { padding: 0; margin: 1.75rem 0; }
.mbc-banner-in-article .container { padding: 0; max-width: 100%; }

/* Sticky bottom bar */
.has-sticky-bar { padding-bottom: 64px; }
.mbc-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  background: linear-gradient(135deg, #2b2f33 0%, var(--primary-color) 130%);
  color: #fff;
  padding: 0.5rem 0;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
}
.mbc-sticky-bar .container { position: relative; gap: 0.75rem; flex-wrap: nowrap; }
.mbc-sticky-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
}
.mbc-sticky-content:hover { color: #fff; }
.mbc-sticky-img { height: 40px; width: auto; border-radius: 6px; }
.mbc-sticky-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbc-sticky-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}
.mbc-sticky-close:hover { opacity: 1; }
@media (max-width: 575.98px) {
  .mbc-sticky-title { font-size: 0.85rem; }
  .mbc-sticky-img { height: 32px; }
}
