/*
  guide.css
  TV Guide overlay styles
*/

/* ── Overlay backdrop ── */
#myNav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(0,0,0,0.85);
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
  /* display is toggled by jQuery — flex set inline when open */
}

/* ── Inner content wrapper — scoped to guide only ── */
#myNav .overlay-content {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: auto;
  text-align: center;
  /* left: clears icons that extend to ~50px; right: clears icons that extend to ~32px */
  padding: 16px max(42px, env(safe-area-inset-right)) 40px max(58px, env(safe-area-inset-left));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* on wider screens give a bit more room */
@media screen and (min-width: 700px) {
  #myNav .overlay-content {
    padding-left: 70px;
    padding-right: 42px;
  }
}

/* ── Close button ── */
.overlay .closebtn {
  position: absolute;
  top: 18px;
  right: max(40px, env(safe-area-inset-right));
  font-size: 60px;
  color: #818181;
  text-decoration: none;
  line-height: 1;
}
.overlay .closebtn:hover { color: #f1f1f1; }

@media screen and (max-height: 450px) {
  .overlay .closebtn { font-size: 40px; top: 10px; right: max(30px, env(safe-area-inset-right)); }
}

/* ── Guide title ── */
.tvguide ul {
  list-style: none;
  margin: 0 0 10px 0;
  padding: 0;
}

/* ── Table — all scoped to #myNav ── */
#myNav table#table1 {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  color: whitesmoke;
  cursor: pointer;
}

#myNav th {
  font-family: cushing, monospace;
  font-size: 9px;
  text-align: center;
  color: #983273;
  padding: 3px 1px;
  border: 1px solid #2a2a2a;
  letter-spacing: 0.03em;
}

#myNav td {
  font-family: cushing, monospace;
  font-size: 9px;
  text-align: center;
  padding: 2px 1px;
  border: 1px solid #222;
  line-height: 1.3;
  word-break: break-word;
}

#myNav td.hour {
  font-size: 7px;
  color: whitesmoke;
  opacity: 0.6;
  white-space: nowrap;
  padding: 2px 3px;
  border-color: #333;
  width: 32px;
}

#myNav td:hover { background-color: rgba(255,255,0,0.12); }

/* ── Tooltip ── */
.CellWithComment { position: relative; }

.CellComment {
  display: none;
  position: absolute;
  width: 160px;
  z-index: 100;
  background-color: yellow;
  color: red;
  font-family: cushing, monospace;
  font-size: 9px;
  line-height: 1.4;
  padding: 5px 6px;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: normal;
  pointer-events: none;
  text-align: left;
}

.CellWithComment:hover .CellComment { display: block; }
.CellWithComment.tip-open .CellComment { display: block; }

/* ── Responsive font scaling ── */
@media screen and (min-width: 700px) {
  #myNav th { font-size: 11px; }
  #myNav td { font-size: 10px; padding: 3px 2px; }
  #myNav td.hour { font-size: 8px; width: 42px; }
}
@media screen and (min-width: 960px) {
  #myNav th { font-size: 13px; }
  #myNav td { font-size: 12px; padding: 4px 4px; }
  #myNav td.hour { font-size: 10px; width: 52px; }
}

/* ── Timezone note ── */
.tz-note {
  font-family: cushing, monospace;
  font-size: 9px;
  color: yellow;
  text-align: center;
  margin-top: 10px;
  opacity: 0.7;
  letter-spacing: 0.1em;
}
@media screen and (min-width: 700px) { .tz-note { font-size: 11px; } }
@media screen and (min-width: 960px) { .tz-note { font-size: 13px; } }

/* ── Scroll side control — landscape mobile only ── */
.guide-scroll-side {
  display: none;
}
@media screen and (orientation: landscape) and (max-height: 500px) {
  .guide-scroll-side {
    display: flex;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: max(4px, env(safe-area-inset-left));
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 10px 4px;
    background: rgba(0,0,0,0.5);
    border-radius: 6px;
  }
  .guide-scroll-side span {
    font-family: cushing, monospace;
    font-size: 11px;
    color: whitesmoke;
    opacity: 0.6;
    line-height: 1.5;
    display: block;
    text-align: center;
  }
  #myNav .overlay-content {
    padding-left: max(58px, env(safe-area-inset-left));
  }
}
