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

#vc {
    overflow-y: auto;    /* enables vertical scrolling */
    overflow-x: hidden;
}

.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: 16px 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    background-color: #f0f0f0;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    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;
    width: 100%;             /* fill button */
}

/* Count badge */
#letters .letter-btn .tag-count {
    position: absolute;
    right: 2px;              /* near right edge */
    top: 50%;
    transform: translateY(-50%);
    font-weight: none;
    font-size: 10px;
    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: red !important;
    color: gold !important;
    font-weight: bold;
    border-color: gold !important;
}

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

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

/* Clear All button */
#clear-tags {
    flex: 0 0 auto;
    padding: 12px 10px 10px 10px;
    border-radius: 5px;
    background-color: rgba(255, 0, 0, 0.8);
    color: black;
    font-weight: bold;
    font-size: 16px;
    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(180, 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: #ca8300;
    color: #fff;
    border-color: #3a2a00;
}

/* 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: 12px 18px; font-size: 20px; }
    #clear-tags { padding: 4px 6px; font-size: 14px; }
}
