/* =========================================
   Xvideos Dark Theme (xHamster Mobile Style)
   ========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-main: #181818;
    --bg-header: #1c1c1c;
    --bg-subnav: #0c0c0c;
    --bg-card: #1f1f1f;
    --bg-pill: #2a2a2a;
    --bg-pill-active: #3f3f3f;
    --accent-red: #e53935;
    --accent-orange: #ff9000;
    --text-primary: #ffffff;
    --text-secondary: #9e9e9e;
    --border-color: #2b2b2b;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.4;
    padding-bottom: 80px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Top Header --- */
.top-header {
    background-color: var(--bg-header);
    height: 54px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo-img {
    height: 30px;
    width: auto;
    border-radius: 4px;
    background: #ffffff;
    padding: 2px 6px;
    object-fit: contain;
}

.region-badge {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    align-self: flex-start;
    margin-top: 1px;
}

.orientation-wrap {
    position: relative;
}

.orientation-btn {
    background: none;
    border: none;
    color: #e53935;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 16px;
    padding: 4px;
}

.chevron-down {
    color: #cccccc;
    font-size: 14px;
    margin-top: -4px;
}

.orientation-dropdown {
    display: none;
    position: absolute;
    top: 36px;
    left: 0;
    background: #222;
    border: 1px solid #383838;
    border-radius: 6px;
    min-width: 150px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    z-index: 150;
}

.orientation-dropdown.open {
    display: block;
}

.orientation-dropdown a {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: #e0e0e0;
}

.orientation-dropdown a:hover {
    background: #333;
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.icon-btn:hover {
    color: #ffffff;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background-color: var(--accent-red);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Search Bar --- */
.search-bar-container {
    display: none;
    background-color: #121212;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.search-bar-container.open {
    display: block;
}

.search-inner {
    display: flex;
    align-items: center;
    background: #262626;
    border-radius: 6px;
    padding: 0 6px 0 10px;
    max-width: 700px;
    margin: 0 auto;
    gap: 4px;
}

.search-inner input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 10px 4px;
    font-size: 14px;
    outline: none;
}

.clear-search-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 15px;
    cursor: pointer;
    padding: 4px 6px;
}

.go-search-btn {
    background: var(--accent-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* --- Sub Navigation --- */
.sub-nav {
    background-color: var(--bg-subnav);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 12px;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid #222;
    scrollbar-width: none;
}

.sub-nav::-webkit-scrollbar {
    display: none;
}

.sub-nav-item {
    background: none;
    border: none;
    color: #e5e5e5;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.sub-nav-item:hover {
    color: #ffffff;
}

.dot-red {
    width: 8px;
    height: 8px;
    background-color: var(--accent-red);
    border-radius: 50%;
    display: inline-block;
}

/* --- Promo Strip --- */
.promo-strip {
    background: linear-gradient(90deg, #3b1048 0%, #6d184d 50%, #2b0f35 100%);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.promo-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
}

.promo-cta {
    background-color: #ffffff;
    color: #111111;
    font-weight: 700;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.promo-close {
    background: none;
    border: none;
    color: #ddd;
    font-size: 16px;
    cursor: pointer;
}

/* --- Ad Slot --- */
.ad-slot-wrapper {
    padding: 10px 10px 4px;
    max-width: 1200px;
    margin: 0 auto;
}

.ad-box {
    background-color: #222222;
    border: 1px dashed #3a3a3a;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

.ad-label {
    display: block;
    font-size: 9px;
    color: #777;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.ad-placeholder {
    display: block;
    background: linear-gradient(90deg, #ff9000, #e53935);
    color: #ffffff;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 4px;
    font-weight: 600;
}

/* --- Main Section --- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 6px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 10px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.dots {
    color: var(--text-secondary);
    font-weight: 400;
}

.ad-notice {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ccc;
    color: #111;
    font-size: 10px;
    font-weight: 700;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    background-color: var(--bg-pill);
    color: #e0e0e0;
    border: none;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}

.filter-pill.active {
    background-color: var(--bg-pill-active);
    color: #ffffff;
    border: 1px solid #555;
}

.filter-pill:hover {
    background-color: #383838;
}

.sort-select {
    background-color: var(--bg-pill);
    color: #e0e0e0;
    border: none;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

/* --- Video Grid (Exact 2-Column Mobile Layout) --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 6px;
}

@media (min-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
}

/* --- Video Card --- */
.video-card {
    display: flex;
    flex-direction: column;
    background-color: transparent;
    cursor: pointer;
}

.thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background-color: #0d0d0d;
    border-radius: 3px;
    overflow: hidden;
}

.thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.video-card:hover .thumb-wrapper img {
    transform: scale(1.04);
}

.thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #252525, #121212);
    color: #cccccc;
    font-size: 11px;
    gap: 6px;
}

.play-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(229, 57, 53, 0.92);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    padding-left: 2px;
}

.quality-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.78);
    color: #ff9000;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
}

.duration-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.82);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
}

.video-info {
    padding: 6px 3px 4px;
}

.video-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
}

.video-title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f1f1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.video-more {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-avatar {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #383838;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Watch Page Styles --- */
.watch-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 20px;
}

.player-section {
    background: #141414;
    border-bottom: 1px solid var(--border-color);
}

.video-player-box {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000000;
}

.video-player-box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.watch-details {
    padding: 12px;
}

.watch-title {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.watch-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.watch-channel-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.channel-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.watch-quality-tag {
    background: #2c2c2c;
    color: var(--accent-orange);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

.watch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.action-chip {
    background: #272727;
    color: #e5e5e5;
    border: none;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.action-chip:hover,
.action-chip.liked {
    background: #3a3a3a;
    color: #ffffff;
}

.watch-affiliate-cta {
    display: block;
    background: linear-gradient(90deg, #ff9000, #ff6a00);
    color: #000000;
    text-align: center;
    padding: 11px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
}

.watch-affiliate-cta:hover {
    opacity: 0.92;
}

.watch-ad-slot {
    padding: 12px 10px 4px;
}

.related-section {
    padding: 10px 6px;
}

/* --- Side Drawer --- */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 200;
    display: none;
}

.drawer-overlay.open {
    display: block;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: -280px;
    width: 260px;
    height: 100%;
    background: #1c1c1c;
    z-index: 201;
    transition: right 0.25s ease;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}

.side-drawer.open {
    right: 0;
}

.drawer-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.drawer-title {
    font-weight: 700;
    font-size: 16px;
}

.close-drawer-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.drawer-links {
    list-style: none;
    padding: 10px 0;
}

.drawer-links li a {
    display: block;
    padding: 12px 18px;
    font-size: 14px;
    color: #e0e0e0;
}

.drawer-links li a:hover {
    background: #2a2a2a;
    color: #ffffff;
}

.drawer-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* --- Cookie Bar --- */
.cookie-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #242424;
    border-top: 1px solid #383838;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 150;
}

.cookie-text {
    font-size: 12px;
    color: #cccccc;
}

.cookie-text a {
    text-decoration: underline;
    color: #ffffff;
}

.cookie-ok-btn {
    background: #3d3d3d;
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.cookie-ok-btn:hover {
    background: #555555;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-secondary);
}

.reset-btn {
    margin-top: 12px;
    background: var(--accent-red);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}
