:root {
  --primary-gold: #ffcc00;
  --dark-bg: rgba(0, 0, 30, 0.97);
  --neon-glow: rgba(255, 204, 0, 0.85);
}

body {
  margin: 0;
  padding: 0;
  background: #000 url('https://c4.wallpaperflare.com/wallpaper/8/983/735/black-4k-blue-lines-wallpaper-preview.jpg') no-repeat center center;
  background-size: cover;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #fff;
  height: 100vh;
  overflow: hidden;
}

.home-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.left-sidebar-wrapper {
  width: 380px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: none;
  background: transparent;
}

.fixed-title {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  backdrop-filter: none;
  padding: 25px 20px 15px 20px;
  border-bottom: none;
  box-shadow: none;
  flex-shrink: 0;
}

.app-title {
  font-family: 'Orbitron', 'Impact', 'Arial Black', sans-serif;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--primary-gold);
  margin: 0;
  line-height: 1;
}

.clock-display {
  position: fixed;
  top: 22px;
  right: 30px;
  z-index: 200;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0,0,0,0.8), 0 0 12px var(--primary-gold);
  letter-spacing: 0.8px;
  white-space: nowrap;
  pointer-events: none;
}

.left-panel {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.left-panel::-webkit-scrollbar {
  display: none;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px 60px 20px;
  margin: 0;
}

.category-item {
  display: flex;
  align-items: center;
  background: rgba(20, 20, 60, 0.65);
  padding: 16px 22px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.35s ease;
  border: 1px solid rgba(255, 204, 0, 0.22);
}

.category-item:hover,
.category-item:focus {
  background: rgba(40, 40, 100, 0.85);
  transform: translateX(10px);
  border-color: var(--primary-gold);
  box-shadow: 0 10px 30px rgba(255, 204, 0, 0.35);
}

.category-item img {
  width: 100px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  margin-right: 26px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.55);
}

.category-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.75);
}

#channel-page {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

#sidebar {
  width: 490px;
  background: rgba(0, 0, 0, 0.92);
  overflow-y: auto;
  overflow-x: hidden;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  flex-shrink: 0;
}

.channel-item {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.3s;
  position: relative;
  margin: 5px 10px;
}

.channel-item:hover,
.channel-item:focus {
  background: rgba(0, 100, 100, 0.92);
  outline: none;
}

.channel-item.active {
  background: rgba(0, 100, 100, 0.92);
}

.channel-item img {
  width: 70px;
  height: 55px;
  object-fit: contain;
  background: transparent;
  margin-right: 12px;
  border-radius: 10px;
}

.channel-info {
  flex: 1;
  min-width: 0;
}

.channel-name {
  font-size: 18px;
  font-weight: bold;
}

.program-title {
  font-size: 18px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.program-time {
  font-size: 18px;
  opacity: 0.7;
  margin-top: 4px;
}

.arrow {
  font-size: 26px;
  opacity: 0.6;
  margin-left: 10px;
  cursor: pointer;
}

.arrow:hover,
.arrow:focus {
  opacity: 1;
}

.arrow.no-epg {
  opacity: 0.3;
  cursor: default;
}

#main {
  flex: 1;
  margin-left: 490px;
  width: calc(100% - 490px);
  max-width: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#video-container {
  flex: 1 1 auto;
  position: relative;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  margin-left: 3px;                /* ← Ruang kiri supaya garis fokus tak rapat sidebar */
  margin-right: 3px;
  margin-top: 3px;
  margin-bottom: 3px;
  border-radius: 12px;
  transition: all 0.25s ease;
}

#video-container:focus,
#video-container:hover {
  border: 4px solid #40E0D0;        /* Garis lebih nipis & kecil */
  box-shadow: 
    inset 0 0 15px rgba(64, 224, 208, 0.7),
    0 0 10px rgba(64, 224, 208, 0.4);
  background: rgba(0, 100, 100, 0.12);
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.custom-live-text {
  font-size: 20px;
  font-weight: bold;
  color: white;
  margin: 0 30px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#program-info {
  background: rgba(0, 0, 0, 0.75);
  padding: 20px;
  max-height: 32vh;
  overflow-y: auto;
}

#current-channel {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--primary-gold);
}

#current-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 12px;
  color: #40E0D0;
}

#current-desc {
  font-size: 16px;
  line-height: 1.5;
  opacity: 0.9;
}

#upnext {
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 15px;
}

#upnext-title {
  font-size: 16px;
  margin-bottom: 10px;
  color: #ffd700;
  font-weight: bold;
}

.upnext-item {
  margin-bottom: 12px;
}

.upnext-time {
  display: block;
  font-size: 16px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.upnext-title {
  font-size: 16px;
  opacity: 0.9;
}

.epg-date-header {
  padding: 15px 12px;
  background: rgba(255,255,255,0.1);
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  margin: 20px 0 10px 0;
  border-radius: 12px;
}

.epg-item {
  padding: 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.epg-time {
  font-size: 18px;
  opacity: 0.9;
  font-weight: bold;
}

.epg-title {
  font-size: 18px;
  margin-top: 8px;
}

.epg-current {
  background: #006464;
  border-left: 5px solid #40E0D0;
  padding-left: 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.epg-current .epg-time,
.epg-current .epg-title {
  color: #e0ffff !important;
  font-weight: bold;
}

.epg-current:hover,
.epg-current:focus {
  background: #008080;
  box-shadow: 0 0 12px rgba(64, 224, 208, 0.4);
}

.back-btn-epg {
  padding: 15px;
  text-align: center;
  background: rgba(0, 100, 100, 0.2);
  border: 1px solid #40E0D0;
  border-radius: 12px;
  margin: 0 20px 20px 20px;
  cursor: pointer;
  font-size: 18px;
  color: #e0ffff;
  transition: all 0.3s ease;
}

.back-btn-epg:hover,
.back-btn-epg:focus {
  background: rgba(0, 100, 100, 0.4);
  border-color: #00CED1;
  box-shadow: 0 0 15px rgba(64, 224, 208, 0.3);
  outline: none;
}

#fullscreen-page {
  display: none;
  height: 100vh;
  background: #000;
  position: relative;
}

#fullscreen-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#channel-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000 no-repeat center center;
  background-size: 40% auto;
  z-index: 15;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

#channel-poster.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 1.0);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

.channel-loading-logo {
  width: 35%;
  max-width: 350px;
  height: auto;
  object-fit: contain;
  opacity: 0.9;
  animation: pulse 2.5s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

.loading-cover.hidden {
  opacity: 0;
  pointer-events: none;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffcc00;
  font-size: 24px;
  text-align: center;
}

.placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  margin-bottom: 0;
}

.placeholder-text {
  font-weight: bold;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.video-placeholder.hidden {
  display: none;
}

#astro-overlay-fullscreen {
  position: fixed !important;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100vw;
  height: 120px;
  background: linear-gradient(to top, black, rgba(0,0,0,0.98) 60%, rgba(0,0,0,0.7));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 20px;
  color: white;
  font-family: system-ui, -apple-system, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 9999;
  box-sizing: border-box;
}

#astro-overlay-fullscreen.visible {
  opacity: 1;
  pointer-events: all;
}

.current-time {
  position: absolute !important;
  top: 14px;
  right: 0px;
  bottom: auto;
  font-size: 16px;
  font-weight: bold;
  color: white;
  background: none;
  padding: 6px 12px;
  border-radius: 6px;
  text-shadow: none;
  pointer-events: none;
}

.overlay-main-row {
  display: flex;
  align-items: center;
  width: 90%;
  gap: 20px;
}

.channel-logo img {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.astro-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.channel-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 8px;
}

.current-program, .next-program {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 16px;
  margin-bottom: 6px;
}

.current-program .time, .next-program .time {
  font-size: 16px;
  opacity: 0.8;
  min-width: 145px;
}

.progress-bar {
  height: 6px;
  flex: 1;
  max-width: 400px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 60%;
  background: #ff0066;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.program-title {
  font-weight: bold;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 600px;
}

.next-in {
  margin-left: auto;
  font-size: 16px;
  opacity: 0.8;
}

.bottom-icons-bar {
  position: fixed;
  bottom: 15px;
  right: 15px;
  left: auto;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.icon-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.icon-btn:hover,
.icon-btn:focus {
  background: rgba(255, 204, 0, 0.10);
  transform: scale(1.20);
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.30);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: filter 0.3s, transform 0.3s;
}

.icon-btn:hover .icon-img {
  filter: brightness(0) invert(1) drop-shadow(0 0 6px #ffcc00);
}

@media (max-width: 768px) {
  .bottom-icons-bar {
    right: 10px;
    bottom: 10px;
    gap: 8px;
    padding: 6px 10px;
  }
  .icon-img {
    width: 24px;
    height: 24px;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
  }
}

.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.search-modal.visible {
  opacity: 1;
  pointer-events: all;
}

.search-modal-content {
  background: rgba(20, 20, 60, 0.9);
  padding: 25px 20px 20px 20px;
  border-radius: 16px;
  width: 85%;
  max-width: 500px;
  border: 1px solid var(--primary-gold);
  box-shadow: 0 0 30px rgba(255, 204, 0, 0.4);
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.search-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-gold);
  margin-bottom: 20px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.search-input {
  width: 100%;
  max-width: 400px;
  padding: 14px 16px;
  font-size: 18px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,204,0,0.3);
  border-radius: 8px;
  color: white;
  margin-bottom: 15px;
  outline: none;
  transition: all 0.3s;
  box-sizing: border-box;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

.search-input:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 15px rgba(255,204,0,0.5);
  caret-color: var(--primary-gold);
}

#btn-cari {
  margin: 15px auto 10px auto;
  padding: 12px 30px;
  background: #ffcc00;
  color: black;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
}

.search-results {
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 10px;
  padding: 5px 8px;
  box-sizing: border-box;
  border-radius: 12px;
  background: rgba(0,0,0,0.2);
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 8px;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.search-result-item:last-child {
  margin-bottom: 0;
}

.search-result-item:hover,
.search-result-item:focus {
  background: rgba(255,204,0,0.15);
  border-color: var(--primary-gold);
  transform: translateX(5px);
}

.search-result-logo {
  width: 50px;
  height: 40px;
  object-fit: contain;
  margin-right: 15px;
  border-radius: 6px;
}

.search-result-name {
  font-size: 18px;
  color: white;
  font-weight: bold;
}

.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
  background: var(--primary-gold);
  border-radius: 10px;
}

.tv-mode button,
.tv-mode a[role="button"],
.tv-mode [tabindex="0"] {
  font-size: 2.5rem !important;
  padding: 20px 40px !important;
  margin: 15px !important;
  min-width: 150px;
  border: rgba(0, 100, 100, 0.92);
  border-radius: none;
  background: rgba(0, 100, 100, 0.92);
  color: #fff;
  transition: all 0.15s;
}

.tv-mode button:focus,
.tv-mode [tabindex="0"]:focus {
  outline: none;
  border-color: rgba(0, 100, 100, 0.92);
  box-shadow: 0 4px 12px rgba(0, 100, 100, 0.35);
  transform: scale(1.1);
  background: #444;
}

.tv-mode .touch-hint {
  display: none !important;
}

#video-container:focus,
#current-channel:focus,
#current-title:focus,
#current-desc:focus,
#upnext-title:focus,
#upnext-list .upnext-item:focus {
  outline: none !important;
  background: rgba(0, 100, 100, 0.92);
  border: 2px solid #40E0D0;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(64, 224, 208, 0.7), 0 0 25px rgba(64, 224, 208, 0.4), 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
  z-index: 10;
}

#video-container:hover,
#current-channel:hover,
#current-title:hover,
#current-desc:hover,
#upnext-title:hover,
#upnext-list .upnext-item:hover,
#video-container:focus:hover,
#current-channel:focus:hover,
#current-title:focus:hover,
#current-desc:focus:hover,
#upnext-title:focus:hover,
#upnext-list .upnext-item:focus:hover {
  border: 2px solid #00FFFF;
  box-shadow: 0 0 20px rgba(64, 224, 208, 0.9), 0 0 40px rgba(64, 224, 208, 0.5), 0 6px 25px rgba(0, 0, 0, 0.6);
  transform: scale(1.015);
}

#upnext:focus {
  box-shadow: none !important;
  background: transparent !important;
}

#upnext-list .upnext-item:focus .upnext-title,
#upnext-list .upnext-item:focus .upnext-time {
  color: #FFFFFFEB !important;
  font-weight: bold;
}

#current-channel:focus,
#current-desc:focus {
  color: #FFFFFFEB !important;
  font-weight: bold;
}

.back-btn-epg:focus,
.epg-date-header:focus,
.epg-item:focus {
  outline: none !important;
  box-shadow: 0 0 0 6px #40E0D0 !important;
  background: rgba(0, 100, 100, 0.92);
  transition: box-shadow 0.2s ease, background 0.2s ease;
  z-index: 10;
}

.epg-item:focus .epg-title,
.epg-item:focus .epg-time {
  color: #FFFFFFEB !important;
  font-weight: bold;
}

.hidden {
  display: none;
}

.shaka-bug,
.shaka-watermark,
[class*="shaka-bug"],
[class*="shaka-watermark"],
.shaka-bug__bug,
.shaka-watermark__logo {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
}

.shaka-controls-container,
.shaka-big-play-button,
.shaka-spinner,
.shaka-bug,
.shaka-watermark,
.shaka-overflow-menu,
.shaka-current-time,
.shaka-seek-bar,
.shaka-volume-bar,
.shaka-mute-button,
.shaka-fullscreen-button {
  display: none !important;
}
