:root {
    --theme-color-pink: #e83d84;
    --theme-color-purple: #a436a0;
}

body { 
    background-color: #000000; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; 
    color: #ffffff; 
    margin: 0; 
    padding: 0; 
    overflow-x: hidden; 
    
    /* ফুটার নিচে রাখার জন্য নতুন কোড */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#main {
    flex: 1; /* স্ক্রিনের বাকি ফাঁকা জায়গা মেইন অংশ দখল করবে */
}

/* Header */
header {
  padding: 5px 20px;
  background: #0d0d0d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 70px; 
  box-sizing: border-box;
  border-bottom: 3px solid var(--theme-color-purple);
}

.header-center { flex-grow: 1; display: flex; justify-content: center; align-items: center; height: 100%; }
.header-logo { height: 55px; width: auto; object-fit: contain; cursor: pointer; }
.headerBtn { width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.05); cursor: pointer; transition: all 0.3s ease; color: #fff; }
.headerBtn:hover { background: rgba(255, 255, 255, 0.1); color: var(--theme-color-pink); }
.headerBtn svg { width: 24px; height: 24px; stroke: currentColor; }

#searchBox { display: none; background: #111; padding: 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
#searchInput { width: 100%; max-width: 400px; box-sizing: border-box; padding: 10px 20px; border: 1px solid #333; outline: none; border-radius: 20px; font-size: 15px; background: #222; color: #fff; text-align: center; margin: 0 auto; display: block; }
#searchInput:focus { border-color: var(--theme-color-pink); }

/* --- Player Fullscreen Overlay Setup --- */
#left { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    background-color: #000; 
    z-index: 99999; 
    flex-direction: column; 
    justify-content: center; 
}

#right { 
    width: 100%; 
    display: block; 
}

/* Grid */
.channel-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
    gap: 15px; 
    justify-content: center; 
    padding: 15px;
}

.channel-card { 
    background-color: #111111; 
    border: 2px solid var(--theme-color-pink); 
    border-radius: 15px; 
    padding: 15px 10px 10px; 
    text-align: center; 
    transition: 0.2s ease; 
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-start; 
    position: relative; 
}
.channel-card:hover { transform: scale(1.05); border-color: var(--theme-color-purple); box-shadow: 0 0 15px rgba(164, 54, 160, 0.5); z-index: 5; }
.channel-logo-wrapper { background-color: #ffffff; width: 80px; height: 80px; border-radius: 50%; display: flex; justify-content: center; align-items: center; margin-bottom: 12px; overflow: hidden; }
.channel-logo-wrapper img { max-width: 85%; max-height: 85%; object-fit: contain; }
.channel-name { font-size: 13px; font-weight: bold; color: #fff; word-break: break-word; }

.channel-card.active { 
    border-color: var(--theme-color-purple); 
    transform: scale(1.05); 
    box-shadow: 0 0 15px rgba(164, 54, 160, 0.7); 
    z-index: 10; 
}

/* Player Base updated for Fullscreen Overlay */
#videoWrap { 
    width: 100%; 
    height: 100%; 
    background: #000; 
    position: relative; 
    border-radius: 0; 
    border: none; 
    overflow: hidden; 
}
#video { width: 100%; height: 100%; }

video::-webkit-media-controls { display: none !important; }
video::-webkit-media-controls-enclosure { display: none !important; }

#videoWrap.aspect-fit video { object-fit: contain !important; transform: scale(1); }
#videoWrap.aspect-stretch video { object-fit: fill !important; transform: scale(1); }
#videoWrap.aspect-zoom video { object-fit: cover !important; transform: scale(1.2); }

/* Custom Player UI Overlay */
#player-ui { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    display: flex; flex-direction: column; justify-content: space-between; 
    opacity: 0; transition: opacity 0.3s ease; z-index: 50; 
    pointer-events: none; 
}
#player-ui.visible { opacity: 1; }

#player-top-bar, #player-bottom-bar { pointer-events: auto; }

#player-top-bar { padding: 15px 20px; background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent); display: flex; justify-content: space-between; align-items: center; }
.player-left, .player-right { display: flex; align-items: center; gap: 15px; }

.p-btn { background: transparent; border: none; color: white; cursor: pointer; padding: 6px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: 0.2s; }
.p-btn:hover { background: rgba(255,255,255,0.2); color: var(--theme-color-pink); }
.p-btn svg { width: 24px; height: 24px; }

#p-num { font-size: 20px; font-weight: bold; color: #fff; margin: 0 5px; }
#p-logo { width: 35px; height: 35px; border-radius: 5px; background: #fff; padding: 2px; object-fit: contain; }
#p-name { font-size: 18px; font-weight: bold; color: #fff; text-shadow: 1px 1px 3px #000; margin-left: 5px; }

#player-bottom-bar { background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); padding: 10px 20px; display: flex; flex-direction: column; gap: 10px; }
#p-seek { width: 100%; height: 4px; appearance: none; background: #444; border-radius: 2px; outline: none; cursor: pointer; }
#p-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: var(--theme-color-pink); border-radius: 50%; }

.bottom-controls { display: flex; align-items: center; gap: 10px; }
#p-vol { width: 80px; accent-color: var(--theme-color-pink); cursor: pointer; }

#p-loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); border: 4px solid rgba(255,255,255,0.1); border-top: 4px solid var(--theme-color-pink); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; display: none; z-index: 99; }
@keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

#channel-input-overlay { 
    display: none; 
    position: absolute; 
    top: 25px; 
    left: 50%; 
    transform: translateX(-50%); 
    background-color: rgba(0, 0, 0, 0.75); 
    color: #ffffff; 
    font-size: 3rem; 
    font-weight: bold; 
    padding: 10px 30px; 
    border-radius: 15px; 
    z-index: 1003; 
    pointer-events: none; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px); 
}

.settings-menu-container { position: absolute; top: 65px; right: 20px; background-color: rgba(28, 28, 28, 0.95); border-radius: 8px; padding: 8px 0; width: 280px; z-index: 999; display: none; flex-direction: column; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.1); pointer-events: auto; }
.settings-menu-container.visible { display: flex; }
.menu-item { display: flex; align-items: center; padding: 12px 15px; cursor: pointer; color: #f1f1f1; transition: background-color 0.2s; font-size: 0.95rem; }
.menu-item.disabled { color: #777; cursor: not-allowed; }
.menu-item:not(.disabled):hover { background-color: rgba(255, 255, 255, 0.1); }
.menu-item svg { width: 22px; height: 22px; margin-right: 15px; color: #e0e0e0; }
.menu-item .label { flex-grow: 1; }
.menu-item .value { color: #aaa; }
.menu-item.active .value, .menu-item.active .label { color: var(--theme-color-pink); font-weight: bold; }
.menu-item .arrow { margin-left: auto; color: #aaa; transform: rotate(0deg); transition: transform 0.2s; font-size: 20px; line-height: 1;}
.menu-item.back-item .arrow { transform: rotate(180deg); }
.menu-item.back-item { font-weight: bold; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 5px; }

#footer { text-align: center; padding: 20px 0; background-color: #0d0d0d; color: #888; font-size: 0.9rem; margin-top: 0px; border-top: 1px solid #222;}

@media (max-width: 768px) {
    .channel-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
    .channel-logo-wrapper { width: 70px; height: 70px; }
    header { padding: 5px 10px; height: 60px; }
    .header-logo { height: 45px; }
    #main { padding: 10px; }
    
    #p-num { font-size: 16px; }
    #p-name { font-size: 15px; }
    .p-btn svg { width: 22px; height: 22px; }
    .player-left, .player-right { gap: 10px; }
    #p-logo { width: 28px; height: 28px; }
    #player-top-bar { padding: 10px; }
    .settings-menu-container { top: 55px; right: 10px; width: 240px; }
}

#splash-logo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: none;
    z-index: 40;
    opacity: 0;
    transition: opacity 1.5s ease;
    mix-blend-mode: screen;
}