/*
Theme Name: DesiMaza - XVideos Style Tube Theme
Theme URI: https://desimaza.com/
Author: DesiMaza Team
Author URI: https://desimaza.com/
Description: Ultra-fast, lightweight, LiteSpeed-optimized WordPress tube theme modeled after XVideos (xvideos2.com). Features an editable DESIMAZA logo, signature dark/crimson styling, adaptive bitrate HLS streaming with quality gear selector, hover trailer micro-previews, inbuilt watermark overlay, and ad-ready slots.
Version: 2.3.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: desimaza
Tags: entertainment, custom-colors, custom-logo, custom-menu, featured-images, flexible-header, full-width-template, theme-options, translation-ready
*/

/*--------------------------------------------------------------
# 1. CSS Variables & Theme Defaults (XVideos Signature Palette)
--------------------------------------------------------------*/
:root {
    --dm-bg: #0c0c0e;
    --dm-header-bg: #111113;
    --dm-header-border: #d2232a;
    --dm-primary: #d2232a;
    --dm-primary-hover: #b81b22;
    --dm-nav-bg: #161619;
    --dm-card-bg: #151518;
    --dm-card-border: #222227;
    --dm-card-hover: #26262c;
    --dm-text: #f0f0f2;
    --dm-text-muted: #8c8c96;
    --dm-link: #d2232a;
    --dm-hd-badge: #d2232a;
    --dm-duration-bg: rgba(0, 0, 0, 0.85);
    --dm-rating-green: #38b000;
    --dm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --dm-max-width: 1400px;
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    background-color: var(--dm-bg);
    color: var(--dm-text);
    scroll-behavior: smooth;
}

body {
    font-family: var(--dm-font);
    background-color: var(--dm-bg);
    color: var(--dm-text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--dm-primary);
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

.site-content {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--dm-max-width);
    margin: 0 auto;
    padding: 16px;
}

/*--------------------------------------------------------------
# 2. 18+ Age Disclaimer Modal
--------------------------------------------------------------*/
.dm-age-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(10px);
}
html.dm-age-verified #dm-age-modal,
html.dm-age-verified .dm-age-modal,
#dm-age-modal.hidden,
.dm-age-modal.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.dm-age-modal-box {
    background: #18181d;
    border: 2px solid var(--dm-primary);
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(210, 35, 42, 0.35);
}
.dm-age-modal-box h2 {
    color: var(--dm-primary);
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.dm-age-modal-box p {
    color: #cccccc;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
}
.dm-modal-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
}
.dm-btn-enter {
    background: var(--dm-primary);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    font-weight: 800;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.dm-btn-enter:hover {
    background: var(--dm-primary-hover);
    transform: scale(1.03);
}
.dm-btn-exit {
    background: #2a2a30;
    color: #cccccc;
    border: none;
    padding: 12px 24px;
    font-weight: 700;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.dm-btn-exit:hover {
    background: #3a3a42;
    color: #ffffff;
}

/*--------------------------------------------------------------
# 3. Top Announcement Notice Bar
--------------------------------------------------------------*/
.dm-notice-bar {
    background: linear-gradient(90deg, #850e13, #d2232a, #850e13);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-align: center;
    padding: 6px 12px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/*--------------------------------------------------------------
# 4. Header & XVideos Logo (DESIMAZA)
--------------------------------------------------------------*/
.site-header {
    background-color: var(--dm-header-bg);
    border-bottom: 3px solid var(--dm-header-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

.header-row {
    max-width: var(--dm-max-width);
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Editable XVideos Styled Logo */
.site-branding {
    flex-shrink: 0;
}
.dm-brand-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    user-select: none;
}
.dm-logo-text {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.dm-logo-first {
    color: #ffffff;
    margin-right: 3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}
.dm-logo-badge {
    background-color: var(--dm-primary);
    color: #ffffff;
    padding: 3px 8px 4px;
    border-radius: 4px;
    font-weight: 900;
    font-size: 24px;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 8px rgba(210, 35, 42, 0.4);
    display: inline-block;
}
.custom-logo-img {
    max-height: 42px;
    width: auto;
    display: block;
}

/* Central Search Bar */
.header-search {
    flex: 1;
    max-width: 600px;
}
.header-search form {
    display: flex;
    align-items: center;
    background: #1c1c22;
    border: 1px solid #2e2e38;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.header-search form:focus-within {
    border-color: var(--dm-primary);
    box-shadow: 0 0 10px rgba(210, 35, 42, 0.4);
}
.header-search input[type="search"] {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
}
.header-search input[type="search"]::placeholder {
    color: #777782;
}
.header-search button {
    background: var(--dm-primary);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-search button:hover {
    background: var(--dm-primary-hover);
}

/* Header Right Actions (Upload & Random) */
.header-actions {
    display: none !important;
}
.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1f1f26;
    color: #d0d0d6;
    border: 1px solid #2e2e38;
    border-radius: 4px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s;
}
.header-action-btn:hover {
    background: #2a2a34;
    color: #ffffff;
    border-color: #444450;
}
.header-action-btn.upload-btn {
    background: #1a291a;
    border-color: #2e592e;
    color: #55dd55;
}
.header-action-btn.upload-btn:hover {
    background: #233b23;
    color: #77ee77;
}

/* Mobile Toggles */
.search-menu-mobile {
    display: none;
    align-items: center;
    gap: 14px;
    font-size: 20px;
    color: #ffffff;
    cursor: pointer;
}

/*--------------------------------------------------------------
# 5. Primary Navigation Bar
--------------------------------------------------------------*/
.main-navigation {
    background: var(--dm-nav-bg);
    border-bottom: 1px solid #222228;
    width: 100%;
}
.nav-container {
    max-width: var(--dm-max-width);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-container::-webkit-scrollbar {
    display: none;
}
.main-navigation ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}
.main-navigation li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #bbbbcc;
    transition: background 0.15s, color 0.15s;
    border-bottom: 2px solid transparent;
}
.main-navigation li a:hover,
.main-navigation li.current-menu-item a,
.main-navigation li.active a {
    color: #ffffff;
    background: #1f1f26;
    border-bottom-color: var(--dm-primary);
}

/* Hide duplicate filter tabs from top category bar */
.main-navigation li.dm-filter-item,
#primary-menu li:has(a[href*="filter="]) {
    display: none !important;
}

/*--------------------------------------------------------------
# 6. XVideos Sub-Filters Bar (Trending, Best, New, Longest)
--------------------------------------------------------------*/
.dm-filter-bar {
    background: #141417;
    border-bottom: 1px solid #1f1f25;
    padding: 8px 0;
    margin-bottom: 18px;
}
.dm-filter-container {
    max-width: var(--dm-max-width);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.dm-filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.dm-filter-pills::-webkit-scrollbar {
    display: none;
}
.dm-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #1e1e24;
    color: #a8a8b4;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #282832;
    transition: all 0.15s;
    white-space: nowrap;
}
.dm-pill:hover,
.dm-pill.active {
    background: var(--dm-primary);
    color: #ffffff;
    border-color: var(--dm-primary);
    box-shadow: 0 2px 8px rgba(210, 35, 42, 0.4);
}
.dm-filter-right {
    font-size: 12px;
    color: var(--dm-text-muted);
    font-weight: 600;
}

/*--------------------------------------------------------------
# 7. Video Card Grid (XVideos 4-Column Responsive Layout)
--------------------------------------------------------------*/
.section-title {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 4px solid var(--dm-primary);
    padding-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.video-card {
    background: var(--dm-card-bg);
    border: 1px solid var(--dm-card-border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.video-card:hover {
    transform: translateY(-3px);
    border-color: var(--dm-card-hover);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.thumb-inside {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000000;
    overflow: hidden;
    cursor: pointer;
}
.thumb-inside a.thumb-link,
.thumb-inside > a {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    text-decoration: none;
    cursor: pointer;
}
.thumb-inside img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none !important;
    transition: transform 0.35s ease;
}
.video-card:hover .thumb-inside img {
    transform: scale(1.05);
}

/* Silent Micro-Trailer Video on Hover (pass clicks through to post link) */
.hover-trailer-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    display: none;
    background: #000;
    pointer-events: none !important;
}

/* Card Badges (pass clicks through to image link) */
.badge-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: var(--dm-duration-bg);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    pointer-events: none !important;
    user-select: none;
}
.badge-hd {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--dm-hd-badge);
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 8;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    pointer-events: none !important;
    user-select: none;
}

/* Card Body & Typography */
.card-body {
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.card-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    height: 35px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
    transition: color 0.15s;
}
.video-card:hover .card-title {
    color: var(--dm-primary);
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--dm-text-muted);
    margin-top: auto;
    font-weight: 600;
}
.card-views {
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-rating {
    color: var(--dm-rating-green);
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 700;
}

/* In-Feed Native Ad Card */
.infeed-ad-card {
    background: #141418;
    border: 1px dashed #33333d;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    font-size: 12px;
    color: #777785;
}

/*--------------------------------------------------------------
# 8. Single Video Watch Page (XVideos Player, Watermark & Actions)
--------------------------------------------------------------*/
.watch-container {
    max-width: 860px;
    margin: 15px auto 40px;
    padding: 0 16px;
}

.video-player-area {
    margin-bottom: 16px;
}

/* XVideos Multi-Server Switcher Bar */
.dm-server-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 6px 12px;
    background: #141418;
    border: 1px solid #22222a;
    border-radius: 6px;
}
.dm-server-label {
    font-size: 12px;
    font-weight: 800;
    color: #9999aa;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dm-server-btn {
    background: #1f1f26;
    border: 1px solid #333340;
    color: #cccccc;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.dm-server-btn:hover {
    background: #2a2a35;
    color: #ffffff;
    border-color: #444455;
}
.dm-server-btn.active {
    background: var(--dm-primary);
    border-color: var(--dm-primary);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(210, 35, 42, 0.45);
}

.responsive-player {
    position: relative;
    max-width: 860px;
    aspect-ratio: 16 / 9;
    max-height: 485px;
    margin: 0 auto;
    background: #000000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9);
}
.responsive-player video,
.responsive-player iframe,
.responsive-player .dm-iframe-wrapper,
.responsive-player .dm-video-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}
.responsive-player .dm-iframe-wrapper iframe,
.responsive-player .dm-video-wrapper video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    object-fit: contain;
}

/* Hide big play button & quality menu when iframe is active to prevent blocking user clicks */
.responsive-player.has-iframe .dm-player-big-btn,
.responsive-player.is-embed .dm-player-big-btn,
.responsive-player.has-iframe .dm-quality-control,
.responsive-player.is-embed .dm-quality-control {
    display: none !important;
    pointer-events: none !important;
}

/* 1. Loading Spinner */
.dm-player-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 35;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: none;
}
.dm-player-loader.is-loading {
    display: flex;
}
.dm-spinner-ring {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--dm-primary);
    border-radius: 50%;
    animation: dmSpin 0.75s linear infinite;
    box-shadow: 0 0 20px rgba(210, 35, 42, 0.5);
}
.dm-loader-text {
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.7);
    padding: 3px 12px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}
@keyframes dmSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 2. Big Center Play Button (Visible on Pause & Initial Load, Smooth Auto-Hide on Play) */
.dm-player-big-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 76px;
    height: 76px;
    background: rgba(210, 35, 42, 0.94);
    border: 3px solid #ffffff;
    border-radius: 50%;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    z-index: 38;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 35px rgba(210, 35, 42, 0.75), 0 4px 20px rgba(0, 0, 0, 0.85);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s ease, opacity 0.25s ease, visibility 0.25s ease;
    animation: dmPulsePlay 2s infinite alternate;
}
.dm-player-big-btn:hover {
    transform: translate(-50%, -50%) scale(1.12);
    background: #d2232a;
    box-shadow: 0 0 45px rgba(210, 35, 42, 0.9), 0 6px 25px rgba(0, 0, 0, 0.95);
}
.dm-player-big-btn.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transform: translate(-50%, -50%) scale(0.65) !important;
}
.dm-big-play-icon {
    margin-left: 5px; /* optical center */
    line-height: 1;
}
@keyframes dmPulsePlay {
    0% { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 40px rgba(210, 35, 42, 0.9); }
}

/* 2b. Tap to Unmute Overlay for Instant 1-Second Autoplay */
.dm-unmute-pill {
    position: absolute;
    top: 14px;
    left: 105px;
    z-index: 45;
    background: rgba(17, 17, 19, 0.9);
    border: 1.5px solid var(--dm-primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8), 0 0 10px rgba(210, 35, 42, 0.4);
    transition: transform 0.2s ease, background 0.2s ease;
    animation: dmPulseUnmute 1.5s infinite alternate;
}
.dm-unmute-pill:hover {
    transform: scale(1.06);
    background: var(--dm-primary);
}
@keyframes dmPulseUnmute {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); box-shadow: 0 0 15px rgba(210, 35, 42, 0.6); }
}

/* 3. Inbuilt Floating Watermark */
.dm-player-watermark {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 40;
    opacity: 0.6;
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
    user-select: none;
}
.dm-player-watermark:hover {
    opacity: 1;
    transform: scale(1.04);
}
.dm-wm-badge {
    display: inline-flex;
    align-items: center;
    font-weight: 900;
    font-size: 15px;
    letter-spacing: -0.3px;
    background: rgba(12, 12, 14, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 3px 8px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.dm-wm-badge .wm-white {
    color: #ffffff;
    margin-right: 2px;
}
.dm-wm-badge .wm-red {
    background: var(--dm-primary);
    color: #ffffff;
    padding: 1px 5px;
    border-radius: 3px;
}

/* 4. Adaptive Quality Gear Switcher */
.dm-quality-control {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 45;
    user-select: none;
}
.dm-quality-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(18, 18, 22, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.dm-quality-btn:hover,
.dm-quality-control.menu-open .dm-quality-btn {
    background: var(--dm-primary);
    border-color: var(--dm-primary);
}
.dm-quality-btn .gear-icon {
    font-size: 13px;
}
.dm-quality-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: 215px;
    background: rgba(18, 18, 22, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    z-index: 55;
    backdrop-filter: blur(12px);
}
.dm-quality-header {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 800;
    color: #9999a5;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.dm-quality-menu ul {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}
.dm-quality-menu li {
    padding: 7px 12px;
    font-size: 12.5px;
    color: #dddddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}
.dm-quality-menu li:hover {
    background: rgba(210, 35, 42, 0.25);
    color: #ffffff;
}
.dm-quality-menu li.active {
    color: var(--dm-primary);
    font-weight: 700;
    background: rgba(210, 35, 42, 0.15);
}
.dm-quality-menu li .q-check {
    width: 12px;
    visibility: hidden;
    color: var(--dm-primary);
}
.dm-quality-menu li.active .q-check {
    visibility: visible;
}
.dm-quality-menu li .q-badge {
    font-size: 9px;
    background: var(--dm-primary);
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 800;
    margin-left: auto;
}

/* 5. Watch Page Video Info & Action Bar */
.watch-info-bar {
    padding: 14px 0;
    border-bottom: 1px solid #1f1f26;
}
.watch-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.35;
    margin-bottom: 10px;
}
.watch-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}
.watch-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--dm-text-muted);
    font-weight: 600;
}
.watch-stats .views i,
.watch-stats .duration i,
.watch-stats .date i {
    margin-right: 4px;
}

.watch-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.vote-btn-group {
    display: inline-flex;
    background: #1c1c22;
    border: 1px solid #2a2a34;
    border-radius: 4px;
    overflow: hidden;
}
.vote-btn {
    background: transparent;
    border: none;
    color: #d0d0d8;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.vote-btn:hover {
    background: #2a2a34;
    color: #ffffff;
}
.vote-btn.like:hover, .vote-btn.like.voted {
    color: var(--dm-rating-green);
}
.vote-btn.dislike:hover, .vote-btn.dislike.voted {
    color: var(--dm-primary);
}
.vote-btn-divider {
    width: 1px;
    background: #2a2a34;
}

.btn-download-big {
    background: var(--dm-primary);
    color: #ffffff;
    padding: 9px 18px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 3px 12px rgba(210, 35, 42, 0.4);
}
.btn-download-big:hover {
    background: var(--dm-primary-hover);
    transform: translateY(-1px);
    color: #ffffff;
}
.btn-share {
    background: #1c1c22;
    border: 1px solid #2a2a34;
    color: #d0d0d8;
    padding: 8px 14px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-share:hover {
    background: #2a2a34;
    color: #ffffff;
}

/* Tags Cloud */
.watch-tags-wrap {
    margin: 18px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-label {
    font-size: 12px;
    font-weight: 800;
    color: #888894;
    text-transform: uppercase;
    margin-right: 4px;
}
.tag-pill {
    background: #17171c;
    border: 1px solid #24242e;
    color: #b5b5c2;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.15s;
}
.tag-pill:hover {
    background: var(--dm-primary);
    border-color: var(--dm-primary);
    color: #ffffff;
}

/* Ad Banners */
.banner-ad-box {
    background: #121215;
    border: 1px dashed #282832;
    border-radius: 4px;
    padding: 16px;
    text-align: center;
    margin: 16px 0;
    font-size: 12px;
    color: #6c6c78;
}

/*--------------------------------------------------------------
# 9. Pagination (XVideos Numbered Buttons)
--------------------------------------------------------------*/
.pagination-wrapper {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}
.pagination-wrapper .page-numbers {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.pagination-wrapper a.page-numbers,
.pagination-wrapper span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: #17171c;
    border: 1px solid #262632;
    border-radius: 4px;
    color: #c0c0cc;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.15s;
}
.pagination-wrapper a.page-numbers:hover {
    background: #252530;
    color: #ffffff;
    border-color: #3e3e50;
}
.pagination-wrapper span.page-numbers.current {
    background: var(--dm-primary);
    border-color: var(--dm-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(210, 35, 42, 0.4);
}

/*--------------------------------------------------------------
# 10. Footer (XVideos Legal, 2257, Disclaimer & Links)
--------------------------------------------------------------*/
.site-footer {
    background-color: var(--dm-header-bg);
    border-top: 2px solid #202026;
    margin-top: 40px;
    padding: 30px 16px 20px;
    font-size: 12px;
    color: var(--dm-text-muted);
}
.footer-container {
    max-width: var(--dm-max-width);
    margin: 0 auto;
}
.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}
.footer-col h4 {
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-col li {
    margin-bottom: 6px;
}
.footer-col a {
    color: #9898a4;
    transition: color 0.15s;
}
.footer-col a:hover {
    color: var(--dm-primary);
}

.footer-legal-box {
    border-top: 1px solid #1f1f25;
    padding-top: 18px;
    margin-top: 18px;
    text-align: center;
    line-height: 1.6;
}
.footer-legal-box p {
    margin-bottom: 8px;
    font-size: 11.5px;
}
.footer-legal-box .compliance-title {
    font-weight: 800;
    color: #d0d0d8;
}
.footer-copyright {
    margin-top: 15px;
    font-size: 11.5px;
    color: #666672;
}

/* Back to Top Floating Button */
.dm-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 42px;
    height: 42px;
    background: var(--dm-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 999;
}
.dm-back-to-top.show {
    opacity: 0.9;
    visibility: visible;
}
.dm-back-to-top:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Toast Notification */
.dm-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: rgba(22, 22, 26, 0.95);
    color: #ffffff;
    border: 1px solid var(--dm-primary);
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    z-index: 1000000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}
.dm-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/*--------------------------------------------------------------
# 11. Mobile Responsiveness
--------------------------------------------------------------*/
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    .footer-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-actions {
        display: none;
    }
    .header-row {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 52px;
        min-height: 52px;
        width: 100%;
        box-sizing: border-box;
    }
    .site-branding {
        margin: 0 auto;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .dm-logo-text {
        font-size: 22px;
        letter-spacing: -0.5px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .dm-logo-badge {
        font-size: 20px;
        padding: 2px 7px 3px;
        border-radius: 4px;
        margin-left: 3px;
    }
    .custom-logo-img {
        max-height: 36px;
        width: auto;
        margin: 0 auto;
    }
    .search-menu-mobile {
        position: static;
        display: block;
    }
    #dm-menu-toggle {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 22px;
        color: #ffffff;
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 20;
        padding: 0;
        margin: 0;
        border-radius: 4px;
        transition: background 0.2s ease, color 0.2s ease;
    }
    #dm-menu-toggle:hover,
    #dm-menu-toggle:active {
        color: #d2232a;
        background: rgba(255, 255, 255, 0.08);
    }
    #dm-search-toggle {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        color: #ffffff;
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 20;
        padding: 0;
        margin: 0;
        border-radius: 4px;
        transition: background 0.2s ease, color 0.2s ease;
    }
    #dm-search-toggle:hover,
    #dm-search-toggle:active {
        color: #d2232a;
        background: rgba(255, 255, 255, 0.08);
    }
    .header-search {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--dm-header-bg);
        padding: 10px 16px;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    .header-search.active {
        display: block;
    }
    .main-navigation {
        display: none;
    }
    .main-navigation.toggled {
        display: block;
    }
    .main-navigation ul {
        flex-direction: column;
        align-items: stretch;
    }
    .main-navigation li a {
        padding: 12px 16px;
        border-bottom: 1px solid #202026;
    }
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .card-title {
        font-size: 12px;
        height: 32px;
    }
    .watch-title {
        font-size: 16px;
    }
    .watch-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .watch-actions {
        width: 100%;
        justify-content: space-between;
    }
    .btn-download-big {
        flex: 1;
        justify-content: center;
    }
    .footer-links-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Video Player Calibration (XVideos Compact Ratio) */
    .watch-container {
        padding: 0 8px;
    }
    .video-player-area {
        margin-bottom: 14px;
        width: 100%;
    }
    .responsive-player,
    #dm-player-container {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 16 / 9 !important;
        max-height: 280px !important;
        height: auto !important;
        margin: 0 auto 10px !important;
        border-radius: 4px !important;
        overflow: hidden !important;
        position: relative !important;
        background: #000000 !important;
    }
    .responsive-player video,
    .responsive-player iframe,
    .responsive-player .dm-iframe-wrapper,
    .dm-iframe-wrapper iframe {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border: 0 !important;
        object-fit: contain !important;
        background: #000 !important;
    }

    /* Mobile Quality Selector Visibility & Touch Fit */
    .dm-quality-control {
        position: absolute !important;
        top: 10px !important;
        left: 10px !important;
        z-index: 99 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    .dm-quality-btn {
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
        background: rgba(15, 15, 20, 0.92) !important;
        color: #ffffff !important;
        border: 1.5px solid #d2232a !important;
        border-radius: 18px !important;
        padding: 4px 10px !important;
        font-size: 11px !important;
        font-weight: 800 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8) !important;
        cursor: pointer !important;
    }
    .dm-quality-btn .gear-icon {
        font-size: 12px !important;
    }
    .dm-quality-btn:active,
    .dm-quality-control.menu-open .dm-quality-btn {
        background: #d2232a !important;
        color: #ffffff !important;
    }
    .dm-quality-menu {
        position: absolute !important;
        top: calc(100% + 6px) !important;
        left: 0 !important;
        width: 195px !important;
        max-height: 170px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        background: rgba(14, 14, 18, 0.98) !important;
        border: 1px solid rgba(255, 255, 255, 0.25) !important;
        border-radius: 6px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95) !important;
        z-index: 100 !important;
    }
    .dm-quality-header {
        padding: 6px 10px !important;
        font-size: 10px !important;
        font-weight: 800 !important;
        color: #aaaaaa !important;
        letter-spacing: 0.5px !important;
    }
    .dm-quality-menu ul {
        padding: 2px 0 !important;
        margin: 0 !important;
    }
    .dm-quality-menu li {
        padding: 6px 10px !important;
        font-size: 12px !important;
        gap: 6px !important;
        color: #eeeeee !important;
    }
    .dm-quality-menu li:hover,
    .dm-quality-menu li:active {
        background: rgba(210, 35, 42, 0.3) !important;
    }
    .dm-quality-menu li.active {
        color: #d2232a !important;
        background: rgba(210, 35, 42, 0.18) !important;
        font-weight: 700 !important;
    }
    .dm-quality-menu li .q-badge {
        font-size: 9px !important;
        padding: 1px 4px !important;
        background: #d2232a !important;
        color: #ffffff !important;
        border-radius: 3px !important;
        margin-left: auto !important;
    }
}

@media (max-width: 480px) {
    .watch-container {
        padding: 0 4px;
    }
    .responsive-player,
    #dm-player-container {
        max-height: 220px !important;
        border-radius: 3px !important;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .responsive-player,
    #dm-player-container {
        max-height: 75vh !important;
        max-width: 80vw !important;
        margin: 0 auto !important;
    }
}
