/* =============================================
   VIDEO GALLERY PAGE - YouTube-Like Styling
   Light theme, clean, professional design
   ============================================= */

/* Container */
.video-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    min-height: 60vh;
    background: #fff;
}

/* Prevent horizontal overflow on mobile */
body:has(.video-gallery-container) {
    overflow-x: hidden;
}

/* =============================================
   PAGE TITLE - below sticky filter bar
   ============================================= */
h1.video-page-title {
    font-size: 1.75em;
    font-family: "CircularXXWeb-Medium", sans-serif !important;
    font-weight: normal !important;
    color: #0f0f0f !important;
    margin: 40px 0 24px;
    padding: 0 !important;
    letter-spacing: -0.02em;
}

h1.video-page-title .search-term-highlight {
    color: #FE4365;
}

/* =============================================
   SITE HEADER - Frosted glass on video page
   ============================================= */
body.vid-dark-mode #header {
    background: rgba(15, 15, 15, 0.82) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
}

/* Site header nav in dark mode */
body.vid-dark-mode #header a,
body.vid-dark-mode #header .nav-link,
body.vid-dark-mode #header nav a {
    color: #e0e0e0 !important;
}
body.vid-dark-mode #header a:hover,
body.vid-dark-mode #header .nav-link:hover,
body.vid-dark-mode #header nav a:hover {
    color: #fff !important;
}

/* =============================================
   FILTER BAR - Behance style: Sort | Search | Filter+Location
   STICKY on scroll
   ============================================= */

/* Hide the sticky sub-navigation on video page */
body.video-gallery-page .bg_city {
    display: none !important;
}

.video-filter-bar-wrapper {
    position: sticky;
    top: 60px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0px 1px 1px rgba(6, 8, 8, 0.06), 0px 3px 10px rgba(6, 8, 9, 0.06);
    transition: transform 0.3s ease;
}

.video-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
}

/* =============================================
   SORT - Entire area clickable
   ============================================= */
.video-sort-dropdown {
    position: relative;
    z-index: 50;
}

.sort-trigger-area {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.sort-trigger-area,
.sort-trigger-area * {
    cursor: pointer;
}

.sort-trigger-area:hover .sort-trigger {
    border-color: #0f0f0f;
}

.video-sort-dropdown.open .sort-trigger {
    border-color: #0f0f0f;
}

.sort-trigger-area:hover .sort-label {
    color: #0f0f0f;
}

.sort-icon-svg {
    flex-shrink: 0;
    color: #6b7280;
    transition: color 0.15s ease;
}

.sort-trigger-area:hover .sort-icon-svg {
    color: #0f0f0f;
}

.sort-label {
    font-size: 14px;
    color: #6b7280;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    transition: all 0.15s ease;
    font-family: inherit;
    height: 36px;
    box-sizing: border-box;
}

.sort-trigger-value {
    font-size: 14px;
    font-weight: 600;
    color: #0f0f0f;
    white-space: nowrap;
}

.sort-trigger-chevron {
    flex-shrink: 0;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.video-sort-dropdown.open .sort-trigger-chevron {
    transform: rotate(180deg);
}

/* Sort Dropdown Menu */
.sort-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    min-width: 170px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
    z-index: 60;
    padding: 4px;
}

.video-sort-dropdown.open .sort-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-option {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.1s ease;
}

.sort-option:hover {
    background: #f3f4f6;
    color: #0f0f0f;
}

.sort-option.selected {
    color: #0f0f0f;
    font-weight: 600;
    background: #f3f4f6;
}

/* =============================================
   SEARCH BOX - Google style, center flex
   ============================================= */
.video-search-box {
    flex: 1;
    min-width: 0;
}

.video-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 16px;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.video-search-form:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
}

.video-search-form:focus-within {
    border-color: #0f0f0f;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
}

.search-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.15s ease;
}

.search-icon:hover {
    color: #0f0f0f;
}

.video-search-form:focus-within .search-icon {
    color: #6b7280;
}

.video-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-family: inherit;
    color: #0f0f0f;
    min-width: 0;
}

.video-search-input::placeholder {
    color: #9ca3af;
}

.search-clear {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 18px;
    line-height: 1;
    color: #9ca3af;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.search-clear:hover {
    color: #0f0f0f;
    background: #f3f4f6;
}

/* =============================================
   FILTER RIGHT GROUP - Category + Location
   ============================================= */
.video-filter-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.filter-icon-svg {
    flex-shrink: 0;
    color: #6b7280;
}

.video-category-toggle {
    display: inline-flex;
    gap: 0;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    overflow: hidden;
    height: 36px;
    box-sizing: border-box;
}

.category-btn {
    padding: 0 18px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    border-right: 1px solid #d1d5db;
    background: #fff;
    display: inline-flex;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
}

.category-btn:last-child {
    border-right: none;
}

.category-btn:hover {
    color: #0f0f0f;
    background: #f9fafb;
}

.category-btn.active {
    background: #0f0f0f;
    color: #fff;
    border-right-color: #0f0f0f;
}

/* Divider between category toggle and location dropdown */
/* =============================================
   LOCATION DROPDOWN - Same pattern as sort
   ============================================= */
.video-location-dropdown {
    position: relative;
    z-index: 40;
}

.location-trigger-area {

    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.location-trigger-area,
.location-trigger-area * {
    cursor: pointer;
}

.location-trigger-area:hover .location-trigger {
    border-color: #0f0f0f;
}

.location-trigger-area:hover .location-label {
    color: #0f0f0f;
}

.location-icon-svg {
    flex-shrink: 0;
    color: #6b7280;
    transition: color 0.15s ease;
}

.location-trigger-area:hover .location-icon-svg {
    color: #0f0f0f;
}

.location-label {
    font-size: 14px;
    color: #6b7280;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.location-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    transition: all 0.15s ease;
    font-family: inherit;
    height: 36px;
    box-sizing: border-box;
}

.video-location-dropdown.open .location-trigger {
    border-color: #0f0f0f;
}

.location-trigger-value {
    font-size: 14px;
    font-weight: 600;
    color: #0f0f0f;
    white-space: nowrap;
}

.location-trigger-chevron {
    flex-shrink: 0;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.video-location-dropdown.open .location-trigger-chevron {
    transform: rotate(180deg);
}

/* Location Dropdown Menu */
.location-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 190px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
    z-index: 60;
    padding: 4px;
}

.video-location-dropdown.open .location-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.location-option {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.1s ease;
}

.location-option:hover {
    background: #f3f4f6;
    color: #0f0f0f;
}

.location-option.selected {
    color: #0f0f0f;
    font-weight: 600;
    background: #f3f4f6;
}

/* =============================================
   ACTIVE SEARCH INDICATOR
   ============================================= */
.video-search-active {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e8f4fd;
    border: 1px solid #b3d9f7;
    color: #1a73e8;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.video-search-active .clear-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(26,115,232,0.1);
    color: #1a73e8;
    text-decoration: none;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    transition: background 0.15s ease;
}

.video-search-active .clear-search:hover {
    background: rgba(26,115,232,0.2);
}

/* =============================================
   VIDEO GRID
   ============================================= */
.video-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 20px;
}

/* =============================================
   VIDEO CARD
   ============================================= */
.video-card {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 8px;
    margin: -8px;
    border-radius: 16px;
    transition: background-color 0.15s ease;
}

.video-card.is-hovering {
    background-color: rgba(0,0,0,0.04);
}

/* Thumbnail */
.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
}

.video-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.03);
}

/* Play overlay */
.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-card:hover .video-play-overlay {
    opacity: 1;
}

.video-play-overlay svg {
    width: 52px;
    height: 52px;
    color: #fff;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.6));
    transition: transform 0.15s ease;
}

.video-card:hover .video-play-overlay svg {
    transform: scale(1.1);
}

/* Duration badge */
.video-duration {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 12px;
    font-family: "Roboto", "Arial", sans-serif;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    border-radius: 4px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    z-index: 3;
    transition: opacity 0.2s ease;
}

/* Hover autoplay preview */
.video-hover-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-hover-preview.is-playing {
    opacity: 1;
}

/* Hide overlay and duration when video is playing */
.video-thumbnail:has(.video-hover-preview.is-playing) .video-play-overlay {
    opacity: 0 !important;
}

.video-thumbnail:has(.video-hover-preview.is-playing) .video-duration {
    opacity: 0;
}

/* Hover preview controls */
.hover-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hover-controls.is-visible {
    opacity: 1;
}

/* Sound toggle button */
.hover-sound-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.4s ease;
}

.hover-sound-btn.bg-faded {
    background: transparent;
}

.hover-sound-btn.bg-faded:hover {
    background: rgba(0,0,0,0.6);
}

.hover-sound-btn:hover {
    background: rgba(0,0,0,0.8);
}

.hover-sound-btn svg {
    width: 22px;
    height: 22px;
}

/* Show/hide muted/unmuted icons */
.hover-controls .icon-unmuted {
    display: none;
}
.hover-controls .icon-muted {
    display: block;
}
.hover-controls.is-unmuted .icon-unmuted {
    display: block;
}
.hover-controls.is-unmuted .icon-muted {
    display: none;
}

/* Time display */
/* Time display - YouTube style countdown, bottom right */
.hover-time {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-family: "Roboto", "Arial", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 3px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    letter-spacing: 0.02em;
    line-height: 1.4;
    z-index: 5;
}

/* Progress bar */
.hover-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.2);
    pointer-events: none;
}

.hover-progress-bar {
    height: 100%;
    width: 0;
    background: rgba(255,255,255,0.6);
    transition: width 0.1s linear;
}

/* Video info section */
.video-info {
    display: flex;
    gap: 10px;
    padding-top: 10px;
}

/* Avatar */
.video-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #606060;
    font-size: 12px;
    text-decoration: none;
}

.video-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.15s ease;
}

.video-avatar img[src=""],
.video-avatar img:not([src]) {
    display: none;
}

.video-avatar:hover img {
    opacity: 0.85;
}

.video-avatar .avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Meta info */
.video-meta {
    flex: 1;
    min-width: 0;
}

.video-title {
    margin: 0 0 2px;
    font-size: 16px;
    font-weight: normal;
    line-height: 1.25;
        font-family: "CircularXXWeb-Medium", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.video-title a {
    color: #0f0f0f;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s ease;
}

.video-title a:hover {
    color: #1a73e8;
}

.video-channel {
    display: inline-block;
    font-size: 13px;
    color: #606060;
    text-decoration: none;
    margin-bottom: 0;
    line-height: 1.4;
    transition: color 0.15s ease;
        font-family: "CircularXXWeb-Book", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.video-channel:hover {
    color: #0f0f0f;
}

.video-stats {
    font-size: 13px;
    color: #606060;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    line-height: 1.4;
        font-family: "CircularXXWeb-Book", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.video-stats span {
    white-space: nowrap;
}

.video-stats-dot {
    margin: 0 4px;
}

/* Like button */
.video-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-top: -65px;
    padding: 4px 15px 4px 9px;
    color: #909090;
    text-decoration: none;
    border-radius: 18px;
    transition: all 0.15s ease;
    background: transparent;
}

.video-like-btn:hover {
    background: rgba(0,0,0,0.06);
    color: #0f0f0f;
}

.video-like-btn.liked {
    color: #ff4d4d;
    background: rgba(255,77,77,0.06);
}

.video-like-btn.liked svg {
    fill: #ff4d4d;
    stroke: #ff4d4d;
}

.video-like-btn svg {
    width: 18px;
    height: 18px;
}

.video-like-btn em {
    font-style: normal;
    font-size: 13px;
    font-weight: 500;
}

/* =============================================
   PAGINATION
   ============================================= */
.video-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
    flex-wrap: wrap;
}

.video-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #ccc;
    color: #0f0f0f !important;
    text-decoration: none;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.video-pagination-btn:hover {
    background: #f8f8f8;
    border-color: #bbb;
    color: #0f0f0f !important;
}

.video-pagination-btn svg {
    opacity: 0.7;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.video-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-pagination-numbers a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #fff;
    color: #0f0f0f !important;
    text-decoration: none;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;

    border: 1px solid #e5e5e5;
}

.video-pagination-numbers a:hover {
    background: #f0f0f0;
    color: #0f0f0f !important;
}

.video-pagination-numbers a.active {
    background: #1a73e8;
    color: #fff !important;
    border-color: #1a73e8;
}

.video-pagination-ellipsis {
    color: #909090;
    padding: 0 6px;
    font-size: 14px;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.video-empty-state {
    text-align: center;
    padding: 100px 20px;
    color: #606060;
}

.video-empty-state svg {
    margin-bottom: 24px;
    opacity: 0.4;
    stroke: #909090;
}

.video-empty-state h3 {
    font-size: 22px;
    font-weight: 500;
    color: #0f0f0f;
    margin: 0 0 8px;
}

.video-empty-state p {
    font-size: 15px;
    margin: 0 0 28px;
    color: #606060;
}

.video-empty-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: #1a73e8;
    color: #fff;
    text-decoration: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.video-empty-btn:hover {
    background: #1557b0;
    transform: translateY(-1px);
}

/* =============================================
   RESPONSIVE - DESKTOP (3 columns default)
   ============================================= */
@media (min-width: 901px) {
    .video-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =============================================
   RESPONSIVE - TABLET (2 columns)
   ============================================= */
@media (max-width: 900px) {
    .video-gallery-container {
        padding: 0 16px 48px;
    }

    .video-page-title {
        font-size: 1.5em !important;
    }

    .video-filter-bar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px;
    }

    .video-search-box {
        order: 1;
        flex-basis: 100%;
    }

    .video-filter-right {
        margin-left: auto;
        flex-wrap: wrap;
    }

    .video-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px 14px;
    }
}

/* =============================================
   RESPONSIVE - MOBILE (1 column)
   ============================================= */
@media (max-width: 576px) {
    .video-gallery-container {
        padding: 0 0 40px;
        overflow-x: hidden;
    }

    .video-page-title {
        font-size: 1.25em !important;
        margin: 69px 0px 24px 20px !important;
    }

    .video-filter-bar-wrapper {
        top: 50px;
    }

    .video-filter-bar-wrapper.filter-bar-hidden {
        transform: translateY(-100%);
        pointer-events: none;
    }

    /* ---- Mobile filter bar: 3-row grid layout ---- */
    .video-filter-bar {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto auto;
        gap: 8px;
        padding: 10px 16px;
        align-items: center;
    }

    /* Row 1: Search full width */
    .video-search-box {
        grid-column: 1 / -1;
        order: 0;
    }

    /* Row 2: Sort (left) | Category (right) */
    .video-sort-dropdown {
        grid-column: 1;
        order: 1;
    }

    /* Break .video-filter-right so children become grid items */
    .video-filter-right {
        display: contents;
    }

    .filter-icon-svg {
        display: none;
    }

    .video-category-toggle {
        grid-column: 2;
        order: 2;
        justify-self: end;
    }

    .category-btn {
        padding: 0 10px;
        font-size: 13px;
        height: 36px;
    }

    /* Row 3: Location (left) | Dark mode (right) */
    .video-location-dropdown {
        grid-column: 1;
        order: 3;
        width: auto;
    }

    .video-location-dropdown .location-menu {
        left: 0;
        right: auto;
    }

    .dark-mode-toggle {
        grid-column: 2;
        order: 4;
        justify-self: end;
    }

    /* Sort pill compact style */
    .sort-label {
        display: none;
    }

    .sort-icon-svg {
        display: inline-block;
    }

    .sort-trigger-area {
        border: 1.5px solid #d1d5db;
        border-radius: 20px;
        padding: 0 14px;
        height: 36px;
        gap: 6px;
    }

    .sort-trigger {
        border: none;
        padding: 0;
        height: auto;
    }

    .sort-menu {
        left: 0;
        right: auto;
        min-width: 200px;
    }

    /* Location pill compact style */
    .location-label {
        display: none;
    }

    .location-icon-svg {
        display: inline-block;
    }

    .location-trigger-area {
        border: 1.5px solid #d1d5db;
        border-radius: 20px;
        padding: 0 14px;
        height: 36px;
        gap: 6px;
    }

    .location-trigger {
        border: none;
        padding: 0;
        height: auto;
    }

    .video-search-active {
        margin: 0 12px 16px;
    }

    .video-gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Remove hover padding trick on mobile - causes horizontal overflow */
    .video-card {
        padding: 0;
        margin: 0;
        border-radius: 0;
    }

    .video-thumbnail {
        border-radius: 0;
    }

    .video-info {
        padding: 10px 16px 4px;
    }

    .video-avatar {
        width: 40px;
        height: 40px;
    }

    .video-title {
        font-size: 15px;
        margin-bottom: 2px;
    }

    .video-channel {
        font-size: 12px;
    }

    .video-stats {
        font-size: 12px;
    }

    .video-like-btn {
        margin-top: -18px;
        padding: 4px 8px;
    }

    .video-like-btn svg {
        width: 18px;
        height: 18px;
    }

    .video-like-btn em {
        font-size: 13px;
    }

    .video-pagination {
        margin-top: 32px;
        padding: 20px 12px 0;
        gap: 8px;
    }

    .video-pagination-btn {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 16px;
    }

    .video-pagination-numbers a {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .video-empty-state {
        padding: 60px 20px;
    }

    .video-empty-state svg {
        width: 64px;
        height: 64px;
    }

    .video-empty-state h3 {
        font-size: 18px;
    }

    .video-empty-state p {
        font-size: 14px;
    }
}
/* =============================================
   DARK MODE TOGGLE BUTTON
   ============================================= */
.dark-mode-toggle {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #e0e0e0;
    background: transparent;
    cursor: pointer;
    position: relative;
    color: #606060;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
}

.dark-mode-toggle:hover {
    background: rgba(0,0,0,0.06);
    color: #333;
}

/* Show/hide icons based on mode */
.dm-icon-dark { display: none; }
.dm-icon-light { display: block; }
body.vid-dark-mode .dm-icon-dark { display: block; }
body.vid-dark-mode .dm-icon-light { display: none; }

.dark-mode-toggle svg {
    width: 22px;
    height: 22px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Dark toggle in dark mode */
body.vid-dark-mode .dark-mode-toggle {
    border-color: #535353;
    color: #aaa;
}
body.vid-dark-mode .dark-mode-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* =============================================
   DARK MODE THEME
   ============================================= */


/* Container background */
body.vid-dark-mode {
    background-color: #0f0f0f;
    transition: background-color 0.3s ease;
}

body.vid-dark-mode .video-gallery-container {
    background: #0f0f0f;
    transition: background-color 0.3s ease;
}

/* Page title */
body.vid-dark-mode h1.video-page-title {
    color: #f1f1f1 !important;
}

/* Filter bar */
body.vid-dark-mode .video-filter-bar-wrapper {
    background: rgba(15, 15, 15, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

/* Sort dropdown */
body.vid-dark-mode .sort-icon-svg {
    color: #aaa;
}
body.vid-dark-mode .sort-label {
    color: #aaa;
}
body.vid-dark-mode .sort-trigger {
    background: rgba(15, 15, 15, 0.6);
    border-color: #535353;
    color: #f1f1f1;
}
body.vid-dark-mode .sort-trigger-value {
    color: #f1f1f1;
}
body.vid-dark-mode .sort-trigger-chevron {
    color: #aaa;
}
body.vid-dark-mode .sort-trigger-area:hover .sort-trigger {
    border-color: #aaa;
}
body.vid-dark-mode .sort-trigger-area:hover .sort-icon-svg,
body.vid-dark-mode .sort-trigger-area:hover .sort-label {
    color: #f1f1f1;
}
body.vid-dark-mode .video-sort-dropdown.open .sort-trigger {
    border-color: #aaa;
}
body.vid-dark-mode .sort-menu {
    background: #282828;
    border: 1px solid #535353;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
body.vid-dark-mode .sort-option {
    color: #e0e0e0;
}
body.vid-dark-mode .sort-option:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
body.vid-dark-mode .sort-option.selected {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

/* Search form */
body.vid-dark-mode .video-search-form {
    background: rgba(18, 18, 18, 0.6);
    border-color: #535353;
    box-shadow: none;
}
body.vid-dark-mode .video-search-form:hover {
    border-color: #717171;
    box-shadow: none;
}
body.vid-dark-mode .video-search-form:focus-within {
    border-color: #f1f1f1;
    box-shadow: none;
}
body.vid-dark-mode .video-search-input {
    color: #f1f1f1;
}
body.vid-dark-mode .video-search-input::placeholder {
    color: #717171;
}
body.vid-dark-mode .search-icon {
    color: #717171;
}
body.vid-dark-mode .search-icon:hover {
    color: #f1f1f1;
}
body.vid-dark-mode .video-search-form:focus-within .search-icon {
    color: #aaa;
}
body.vid-dark-mode .search-clear {
    color: #717171;
}
body.vid-dark-mode .search-clear:hover {
    color: #f1f1f1;
}

/* Filter icon */
body.vid-dark-mode .filter-icon-svg {
    color: #aaa;
}

/* Category toggle (Female/Male/Trans) */
body.vid-dark-mode .video-category-toggle {
    border-color: #535353;
}
body.vid-dark-mode .category-btn {
    background: rgba(15, 15, 15, 0.6);
    color: #aaa;
    border-right-color: #535353;
}
body.vid-dark-mode .category-btn:hover {
    background: #333;
    color: #f1f1f1;
}
body.vid-dark-mode .category-btn.active {
    background: #e0e0e0;
    color: #0f0f0f;
    border-right-color: #e0e0e0;
}

/* Location dropdown */
body.vid-dark-mode .location-icon-svg {
    color: #aaa;
}
body.vid-dark-mode .location-label {
    color: #aaa;
}
body.vid-dark-mode .location-trigger {
    background: rgba(15, 15, 15, 0.6);
    border-color: #535353;
}
body.vid-dark-mode .location-trigger-value {
    color: #f1f1f1;
}
body.vid-dark-mode .location-trigger-chevron {
    color: #aaa;
}
body.vid-dark-mode .location-trigger-area:hover .location-trigger {
    border-color: #aaa;
}
body.vid-dark-mode .location-trigger-area:hover .location-icon-svg,
body.vid-dark-mode .location-trigger-area:hover .location-label {
    color: #f1f1f1;
}
body.vid-dark-mode .video-location-dropdown.open .location-trigger {
    border-color: #aaa;
}
body.vid-dark-mode .location-menu {
    background: #282828;
    border: 1px solid #535353;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
body.vid-dark-mode .location-option {
    color: #e0e0e0;
}
body.vid-dark-mode .location-option:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
body.vid-dark-mode .location-option.selected {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

/* Video cards */
body.vid-dark-mode .video-card.is-hovering {
    background-color: rgba(255,255,255,0.08);
}

body.vid-dark-mode .video-thumbnail {
    background: #1a1a1a;
}

/* Title */
body.vid-dark-mode .video-title a {
    color: #f1f1f1;
}

body.vid-dark-mode .video-title a:hover {
    color: #fff;
}

/* Channel name */
body.vid-dark-mode .video-channel {
    color: #aaa;
}

body.vid-dark-mode .video-channel:hover {
    color: #f1f1f1;
}

/* Stats */
body.vid-dark-mode .video-stats {
    color: #717171;
}

body.vid-dark-mode .video-stats-dot {
    color: #717171;
}

/* Like button */
body.vid-dark-mode .video-like-btn {
    color: #717171;
}

body.vid-dark-mode .video-like-btn:hover {
    color: #aaa;
}

body.vid-dark-mode .video-like-btn.liked {
    color: #FE4365;
}

/* Avatar fallback */
body.vid-dark-mode .avatar-fallback {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Pagination */
body.vid-dark-mode .video-pagination a {
    color: #aaa;
    border-color: #535353;
}

body.vid-dark-mode .video-pagination a:hover {
    background: rgba(255,255,255,0.1);
    color: #f1f1f1;
}

body.vid-dark-mode .video-pagination .current {
    background: #fff;
    color: #0f0f0f;
    border-color: #fff;
}

/* Empty state */
body.vid-dark-mode .video-empty-state h3 {
    color: #f1f1f1;
}

body.vid-dark-mode .video-empty-state p {
    color: #aaa;
}

body.vid-dark-mode .video-empty-state svg {
    color: #717171;
}

body.vid-dark-mode .video-empty-btn {
    color: #667eea;
}

/* Dark mode mobile pill borders */
@media (max-width: 576px) {
    body.vid-dark-mode .sort-trigger-area {
        border-color: #535353;
    }
    body.vid-dark-mode .location-trigger-area {
        border-color: #535353;
    }
}

/* =============================================
   STORY SHORTS - YouTube Shorts-style cards
   ============================================= */

/* Full width within container, no separate background */
.video-stories-section {
    margin: 4px 0 20px 0;
    padding: 16px 0 20px 0;
}

.video-stories-label {
    font-family: "CircularXXWeb-Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 20px;
    font-weight: normal;
    color: #0f0f0f;
    margin: 0 0 12px 0;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-shorts-icon {
    flex-shrink: 0;
}

/* Shorts card row — 5 equal cards, fill 100% */
.story-shorts-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0 16px;
}

/* Individual card */
.story-short-card {
    cursor: pointer;
    border-radius: 16px;
    overflow: visible;
    padding: 8px;
    margin: -8px;
    transition: background-color 0.15s ease;
}

/* Desktop: only show first 5 cards */
.story-short-card:nth-child(n+6) {
    display: none;
}

.story-short-card:hover {
    background-color: rgba(0,0,0,0.04);
}

/* Media container - portrait aspect */
.story-short-media {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 14;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
}

.story-short-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gradient overlay at bottom */
.story-short-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 0 0 12px 12px;
}

/* Info below card */
.story-short-info {
    padding: 8px 4px 0 4px;
}

.story-short-title {
    font-family: "CircularXXWeb-Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: normal;
    color: #0f0f0f;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-short-views {
    font-family: "CircularXXWeb-Book", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    color: #606060;
    margin-top: 2px;
    display: block;
}

/* Mobile: scroll horizontally */
@media (max-width: 768px) {
    .story-shorts-row {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .story-shorts-row::-webkit-scrollbar {
        display: none;
    }

    .story-short-card {
        flex: 0 0 40%;
        min-width: 140px;
        padding: 0;
        margin: 0;
    }

    .story-short-card:nth-child(n+6) {
        display: block; /* Override desktop hide — show all for swipe */
    }

    .story-short-media {
        aspect-ratio: 9 / 13;
    }

    .video-stories-label {
        font-size: 17px;
        padding-left: 16px;
    }

    .story-shorts-row {
        padding-left: 16px;
    }
}

@media (max-width: 480px) {
    .story-short-card {
        flex: 0 0 45%;
        min-width: 120px;
        padding: 0;
        margin: 0;
    }

    .story-shorts-row {
        gap: 10px;
    }
}

/* Dark mode stories */

body.vid-dark-mode .video-stories-label {
    color: #f1f1f1;
}

body.vid-dark-mode .story-short-card:hover {
    background-color: rgba(255,255,255,0.08);
}

body.vid-dark-mode .story-short-title {
    color: #f1f1f1;
}

body.vid-dark-mode .story-short-views {
    color: #aaa;
}

body.vid-dark-mode .story-short-media {
    background: #0f0f0f;
}