/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ================= BODY ================= */
body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background: #f5f6f8;
  color: #1f2937;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================= HEADER ================= */
header {
  background: linear-gradient(to right, #16a34a, #15803d);
  padding: 8px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo {
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.5px;
  text-decoration: none;
}

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

.navbar a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
  transition: 0.2s ease;
}

.navbar a:hover {
  opacity: 1;
  border-bottom: 2px solid #fff;
}

/* ================= MENU TOGGLE ================= */
#menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
}

.menu-icon {
  height: 1.5rem;
  width: 1.5rem;
}

/* ================= MODAL ================= */
#menu-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}

.modal-content {
  background: #ffffff;
  width: 270px;
  height: 100%;
  padding: 24px;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  position: relative;
}

#menu-close {
  color: #9ca3af;
  outline: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
}

#menu-close:hover {
  color: #4b5563;
}

.close-icon {
  height: 1.5rem;
  width: 1.5rem;
}

.modal-nav {
  display: flex;
  flex-direction: column;
  margin-top: 2.5rem;
}

.modal-nav a {
  display: block;
  padding: 12px 0;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  border-bottom: 1px solid #f3f4f6;
  transition: color 0.15s;
}

.modal-nav a:hover {
  color: #111827;
}

/* ================= MAIN ================= */
main {
  margin: 0.6rem auto;
  width: 91.666667%;
  max-width: 66.666667%;
  padding: 20px 0;
}

/* ================= TITLES ================= */
h1 {
  color: #0f7a3b;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  margin-top: 0.6rem;
  margin-bottom: 18px;
}

.channels-title {
  color: #1f2937;
  font-size: 20px;
  margin: 35px 0 18px;
  font-weight: 700;
  text-align: center;
}

/* ================= DESCRIPTION ================= */
.description {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 15px;
  margin-bottom: 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  color: #4b5563;
  line-height: 1.7;
}

.description a {
  color: #16a34a;
  text-decoration: underline;
}

/* ================= FILTER ================= */
.container__filter {
  display: flex;
  align-items: stretch;
  margin-bottom: 10px;
  gap: 8px;
}

.filter-input-wrap {
  flex: 2;
  position: relative;
  display: flex;
  align-items: center;
}

.filter-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: #9ca3af;
  pointer-events: none;
}

.filter-select-wrap {
  flex: 1;
  position: relative;
}

#search {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

#search:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}

#search::placeholder {
  color: #9ca3af;
}

#filter_category {
  width: 100%;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background-color: #fff;
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

#filter_category:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}

/* ================= AGENDA ================= */
#wraper {
  width: 100%;
  margin: 0 auto;
  margin-bottom: 1.25rem;
  height: 50%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  overflow: hidden;
}

.agenda-header {
  background: linear-gradient(to right, #16a34a, #15803d);
  color: #ffffff;
  text-align: center;
  padding: 0.3rem 0.5rem;
  font-weight: bold;
}

#title-agenda {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
}

/* ================= AGENDA ITEMS ================= */
#menu {
  margin: 0;
  padding: 0;
  background-color: #fff;
}

.agenda-item {
  list-style: none;
  padding: 9px 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.15s;
}

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

.agenda-item:hover {
  background-color: #fafafa;
}

.agenda-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.agenda-info {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.agenda-time {
  width: 3.2rem;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  color: #374151;
  flex-shrink: 0;
}

.agenda-flag {
  margin-left: 0.5rem;
  object-fit: cover;
  height: 1.5rem;
  width: 1.5rem;
  flex-shrink: 0;
  border-radius: 2px;
}

.agenda-title {
  flex: 1;
  margin-left: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #1f2937;
  font-size: 16px;
}

.agenda-chevron {
  color: #d1d5db;
  flex-shrink: 0;
  margin-left: 8px;
  transition: transform 0.25s ease;
}

/* ================= SUBMENU ================= */
.agenda-submenu {
  margin: 0 0 0 2.75rem;
  padding: 0;
  list-style: none;
  overflow: hidden;
  height: 0;
  opacity: 0;
  transition: height 0.45s ease, opacity 0.4s ease, margin-top 0.45s ease;
}

.agenda-submenu.open {
  opacity: 1;
  margin-top: 8px;
}

.submenu-link {
  list-style: none;
}

.submenu-link a.submenu-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  color: #4b5563;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  transition: background-color 0.15s, color 0.15s;
}

.submenu-link a.submenu-item:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.submenu-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #d1d5db;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  transition: background-color 0.15s;
}

.submenu-link a.submenu-item:hover .submenu-dot {
  background: #16a34a;
}

/* ================= CHANNEL CARDS ================= */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: #ffffff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

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

.card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.card-image img {
  height: 50px;
  width: 50px;
  object-fit: contain;
}

.card-content {
  padding: 6px 0 4px;
}

.card-content h3 {
  color: #1f2937;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.card-content p {
  color: #6b7280;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.4;
}

/* ================= BUTTON ================= */
.btn-watch {
  display: inline-block;
  background: #16a34a;
  color: #fff;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.btn-watch:hover {
  background: #15803d;
}

/* ================= FOOTER ================= */
footer {
  background: #1f2937;
  color: #fff;
  text-align: center;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.footer-title {
  font-size: 0.9rem;
}

.redes {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.redes > li {
  list-style-type: none;
}

.red-item {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

.red-item:hover {
  color: #fff;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  main {
    max-width: 95%;
    width: 100%;
  }

  h1 {
    font-size: 22px;
  }

  #title-agenda {
    font-size: 16px;
  }

  .navbar {
    display: none;
  }

  #menu-toggle {
    display: flex;
  }

  .channels-title {
    font-size: 17px;
  }

  .cards-container {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  #iframeVideo {
    width: 100% !important;
    height: 100% !important;
  }

  .modal-content {
    width: 260px;
    max-width: 80%;
  }
}

@media (max-width: 480px) {
  .cards-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .container__filter {
    flex-direction: column;
  }

  .filter-input-wrap,
  .filter-select-wrap {
    flex: 1;
    width: 100%;
  }
}

/* iPhone specific */
@media only screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 2) {
  #menu {
    padding: 0;
  }

  .agenda-item {
    padding: 8px 12px;
  }

  #iframeVideo,
  #embedIframe {
    width: 100% !important;
    height: auto !important;
  }
}

/* ================= UTILITIES ================= */
.hide-on-mobile {
  display: block;
}

@media (max-width: 640px) {
  .hide-on-mobile {
    display: none !important;
  }
}
