:root {
  --bg: #000000;
  --panel: #0a0a0a;
  --panel-2: #1a1a1a;
  --accent: #dd0303;
  --accent-2: #ff4b2b;
  --muted: #bfbfbf;
  --white: #ffffff;
  --glass: rgba(3, 1, 1, 0.03);
  --card-border: rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #000;
}

/* Disable body scroll when modal is open */
body.modal-open {
  overflow: hidden !important;
  touch-action: none !important;
}

.container {
  width: 100%;
  max-width: 940px;
  padding: 18px;
  text-align: center;
  margin: auto;
}

#title {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 8px 0 6px;
  color: var(--white);
  letter-spacing: 0.2px;
}

.update-text {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.update-text img {
  width: 20px;
  height: 14px;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: 3px
}

.btn-container {
  margin: 18px 0;
  position: relative;
  display: flex;
  justify-content: center
}

.btn-canales {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: var(--white);
  font-weight: 700;
  border-radius: 10px;
  padding: 12px 20px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}

.btn-canales:hover {
  transform: translateY(-3px);
}

.btn-logo {
  height: 1.2em;
  border-radius: 6px;
  border: 2px solid #fff;
  padding: 2px;
  display: inline-block
}

.agenda-container {
  width: 100%;
  margin: 14px auto 0;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: 14px;
  overflow: visible;
  border: 1px solid var(--card-border);
}

.agenda-header {
  padding: 12px 16px;
  font-weight: 700;
  background: #ff0000;
  color: #fff;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  position: sticky;
  top: 0;
  z-index: 5;
  text-align: center;
}

ul#menu {
  list-style: none;
  margin: 0;
  padding: 10px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  background: #000;
  /* Black background for the list */
}

li.toggle-submenu {
  display: block;
  background: #000;
  /* Black background for the card */
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  min-height: 65px;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* White hover transition from left to right */
li.toggle-submenu::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: #fff;
  transition: width 0.4s ease;
  z-index: 1;
}

li.toggle-submenu:hover::after {
  width: 100%;
}

li.toggle-submenu:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Match Info Container */
.match-info {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 5 !important;
  transition: color 0.4s ease;
  width: 100% !important;
  min-height: 70px !important;
}

/* NUCLEAR COLOR FIX - Force white/blue tint by default */
.match-info,
.match-info time,
.match-info span,
.match-info i,
.match-info div {
  color: #f0f9ff !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* NUCLEAR COLOR FIX - Force black on hover */
li.toggle-submenu:hover .match-info,
li.toggle-submenu:hover .match-info time,
li.toggle-submenu:hover .match-info span,
li.toggle-submenu:hover .match-info i,
li.toggle-submenu:hover .match-info div {
  color: #000000 !important;
}

.match-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.match-time {
  font-weight: 700 !important;
  min-width: 65px !important;
  text-align: right !important;
  font-size: 1.05rem !important;
  flex-shrink: 0 !important;
}

img.flag {
  width: 38px !important;
  height: 24px !important;
  min-width: 38px !important;
  object-fit: cover !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  flex-shrink: 0 !important;
  z-index: 6 !important;
}

li.toggle-submenu:hover img.flag {
  border-color: rgba(0, 0, 0, 0.3) !important;
}

span.match {
  margin-left: 8px !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  flex: 1 !important;
}

.match-right {
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
  justify-content: flex-end !important;
  margin-left: auto !important;
  z-index: 6 !important;
}

.channel-info {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  min-width: 40px !important;
}

.channel-count {
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

.camera-icon {
  font-size: 1.2rem !important;
}

.status {
  background: var(--accent) !important;
  color: #ffffff !important;
  padding: 3px 10px !important;
  border-radius: 5px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
}

.submenu-list {
  display: none;
  background: #111;
  /* Dark background for submenu */
  border: 1px solid var(--card-border);
  border-top: none;
  padding: 12px 22px;
  border-radius: 0 0 14px 14px;
  position: relative;
  z-index: 2;
}

.submenu {
  padding: 10px 0;
  border-bottom: 1px solid #000;
  color: #000;
}

.submenu:last-child {
  border-bottom: none
}

.submenu-item {
  color: #f0f9ff;
  /* White with light blue shade */
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.18s ease;
}

.submenu-item i {
  color: #f0f9ff;
  font-size: 1rem;
  transition: color 0.18s ease;
}

.submenu-item:hover {
  color: var(--accent);
}

.submenu-item:hover i {
  color: var(--accent);
}


.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 5000;
}

.modal-content {
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #ff0000;
  color: #000;
  font-weight: 700;
  margin-bottom: -100px;
  z-index: 10;
  margin-top: 40px;
  height: 65px;
  width: 100%;
}

.modal-iframe-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 1;
}

.modal-iframe {
  width: 100%;
  height: calc(100% + 80px);
  border: none;
  margin-top: 40px;
  display: block;
  margin-bottom: -30px;
}

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  z-index: 3;
}

.close-btn:focus {
  outline: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

/* Notification */
#notification {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  display: none;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

/* Footer */
.footer {
  color: var(--muted);
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  padding: 10px 6px
}

/* Responsive */
@media (max-width:768px) {
  #title {
    font-size: 1.4rem;
  }

  .btn-canales {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
  }

  ul#menu {
    padding: 10px 10px 16px;
  }

  span.match {
    white-space: normal !important;
    display: inline-block !important;
    max-width: 70% !important;
  }

  img.flag {
    width: 30px;
    height: 20px;
  }

  time {
    min-width: 54px;
    font-size: 0.95rem;
    text-align: right;
  }

  .modal-content {
    height: 100vh;
    border-radius: 0;
  }

  .modal-iframe {
    height: 100%;
  }

  .modal-header {
    margin-top: 40px;
    height: 65px;
  }

  /* Added margin-top for mobile/tablet */
}

@media (max-width:420px) {
  .btn-canales {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .match-info {
    padding: 10px 12px;
  }

  li.toggle-submenu {
    border-width: 3px;
  }

  .modal-header {
    margin-top: 60px;
    height: 65px;
  }

  /* Ensure margin for small phones as well */

}

.modal-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 55px;
  /* Fixed area to block iframe bottom */
  background: #000000;
  /* Solid black for full coverage */
  color: #bfbfbf;
  padding: 12px 0;
  text-align: center;
  font-size: 0.9rem;
  z-index: 4;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Mobile adjustment */
@media(max-width:768px) {
  .modal-iframe {
    top: -110px;
    height: calc(100dvh + 260px);
    /* Extra height for mobile chrome bars */
  }

  .modal-footer {
    height: 60px;
    font-size: 0.85rem;
  }
}