#contentDIV {
    display: flex;
    flex-direction: column;
    height: 100vh;       /* full viewport */
    overflow: hidden;    /* prevent scrolling of parent */
}


#vc {
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding-bottom: 200px;
}

#vc2 {
    display: block;
}

.video-content-cover:last-child {
    margin-bottom: 10px; /* ensures last row not clipped */
}

#total-videos {
    color: white;
    right: 10px;
    font-weight: none;
    margin-top: 0px;
    margin-left: 0px;
    margin-right: 5px;
    z-index: 1500;
}

#bottom-bar {
  position: fixed;      /* stays in place even when scrolling */
  bottom: 0;            /* stick to bottom of window */
  left: 0;
  width: 100%;          /* full width */
  background: rgba(20, 20, 20, 0.95); /* semi-transparent dark background */
  color: white;
  text-align: center;
  padding: 12px 0;
  font-weight: none;
  font-size: .8rem;
  border-top: 1px solid #444;
  z-index: 9999;        /* ensures it’s above other content */
}

.letters-main {
    background-color: black;
    position: relative;
    padding: 10px 10px 0px 10px;
}

/* Wrapper for letters row and Clear All */
#letters-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 0px;
    position: relative;
    background-color: black;
}

/* Letters row (horizontal scroll) */
#letters {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 5px;
    flex: 1;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#letters::-webkit-scrollbar { display: none; }

/* Letter button container */
#letters .letter-btn {
    position: relative;
    flex: 0 0 auto;
    padding: 14px 18px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    background-color: #f0f0f0;
    transition: background 0.2s, color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* centers the letter */
    min-width: 32px;         /* enough space for count */
}

/* Letter itself */
#letters .letter-btn .letter-text {
    display: block;
    text-align: center;
}

/* Count badge */
#letters .letter-btn .tag-count {
    display: block;
    font-weight: none;
    font-size: 10px;
    margin-top: 0px;
    margin-right: 6px;
    color: white;
    pointer-events: none;    /* don't block clicks */
}



/* Active and trending styles */
#letters .letter-btn.active {
    background-color: #c10050;
    color: #fff;
    border-color: #92003d;
}

.letter-btn[data-letter="TRENDING"] {
    background-color: #c10050 !important;
    color: white !important;
    font-weight: bold;
    border: 0px solid;
    border-color: black !important;
}

.letter-btn[data-letter="TRENDING"]:hover {
    background-color: #e68a00;
    border-color: #e68a00;
}

.letter-btn.has-selected-tags {
    background-color: #550023 !important;
    color: #fff !important;
    border-color: #270010 !important;
}

/* Clear All button */
#clear-tags {
    flex: 0 0 auto;
    padding: 2px 6px 2px 6px;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.8);
    color: black;
    font-weight: none;
    font-size: 40px;
    cursor: pointer;
    border: 1px solid #ccc;
    user-select: none;
    z-index: 10;
    margin-left: 5px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
#clear-tags:hover { background-color: rgba(0, 0, 0, 0.9); }

/* Tag container (horizontal scroll) */
.tag-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    max-height: 0;
    margin: 0;
    transition: max-height 0.5s ease, margin 0.5s ease;
    -ms-overflow-style: none;
    scrollbar-width: none;
    background-color: black;
}
.tag-container::-webkit-scrollbar { display: none; }
.tag-container.open {
    max-height: 60px;
    margin-top: 10px;
    margin-bottom: 0px;
}

/* Tag button styling */
.tag {
    color: white;
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    background-color: #373737;
}
.tag.active {
    background-color: #550023;
    color: #fff;
    border: 0px solid;
    border-color: black;
}

/* Video grid container */
#video-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;               /* gap between items only */
    grid-auto-rows: auto;     /* natural height per item */
    align-content: start;     /* stick rows to top */
    justify-items: stretch;   /* fill width of each column */
    padding-bottom: 10px;
}

/* Individual video cards */
.video {
    margin: 0;
    padding: 0px;
    width: 100%;
    box-sizing: border-box;
}

.video:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.video img {
    width: 100%;
    display: block;
    border-radius: 0px;
}

@media (max-width: 480px) {
    .tag { padding: 9px 12px; font-size: 17px; }
    #letters .letter-btn { padding: 6px 12px; font-size: 20px; }
    #clear-tags { 
     padding: 2px 6px 2px 6px;
 
     font-size: 28px; }

    #vc {
        padding-bottom: 200px;  /* add extra space for last row */
    }


}

/* --- Desktop / Navbar --- */
#navWrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 0px;
    position: relative;      /* for overlay positioning */
    z-index: 1000;
    width: 100%;
}

/* Desktop search form */
#searchOverlay {
    display: flex;
    width: 100%;           /* desktop search width */
}

#searchOverlay input[type="search"] {
    flex: 1;
    padding: 12px 10px;
    border: 1px solid;
    font-size: 16px;
    margin-left: 30px;
    margin-right: 0px;
    outline: none;     /* REMOVE focus border */
    box-shadow: none;  /* REMOVE browser glow on focus */    
}

#searchOverlay button.search {
    background-color: #202020;
    cursor: pointer;
}

#searchOverlay button.mic {
    margin-left: 8px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
}

/* --- Mobile Toggle Button --- */
#mobileSearchToggle {
    display: none;   /* hidden on desktop */
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

/* --- Mobile Search Overlay --- */
#mobileSearchOverlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #000;
    padding: 18px 4px;
    z-index: 1100;
    flex-direction: column;
    margin-right: 20px;
}

#mobileSearchOverlay.active {
    display: flex;
}

#mobileSearchOverlay input[type="search"] {
    flex: 1;
    width: 100%;
    padding: 8px 10px;
    border-radius: 0px;
    font-size: 16px;
    outline: none;     /* REMOVE focus border */
    box-shadow: none;  /* REMOVE browser glow on focus */    
}

#mobileSearchOverlay button.search {
    margin-top: 0px;
    margin-right: 0px;
    margin-left: 10px;
    padding: 0px 0px;
    border: 0px solid black;
    background-color: black;
    cursor: pointer;
    outline: none;
}

#mobileSearchClose {
    margin-top: 0px;
    margin-right: 10px;
    margin-left: 10px;
    background: none;
    border: 0px solid red;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    align-self: flex-end;
    z-index: 1200;
}

/* --- Responsive Rules --- */
@media (max-width: 600px) {
    #searchOverlay {
        display: none;             /* hide desktop search */
    }
    #mobileSearchToggle {
        display: block;            /* show toggle on mobile */
    }
}
