/* ==========================================================================
   ADULTFLIX DEDICATED MOBILE CSS (TOUCH-FIRST, SOLID UI, DUAL-THEME)
   ========================================================================== */

:root, [data-theme="dark"] {
    --bg-primary: #0e1117;
    --bg-secondary: #161b22;
    --surface-card: #161b22;
    --surface-elevated: #21262d;
    --border-color: #30363d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #ff2a5f;
    --accent-hover: #e02454;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --surface-card: #ffffff;
    --surface-elevated: #e2e8f0;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #dc2626;
    --accent-hover: #b91c1c;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    font-size: 14px;
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 20px));
    -webkit-font-smoothing: antialiased;
}

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

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

.mobile-container {
    padding: 0 16px;
}

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

.mobile-brand {
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-brand-badge {
    background-color: var(--accent);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: var(--radius-sm);
}

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

.mobile-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-icon-btn:active {
    opacity: 0.6;
}

.mobile-icon-btn .theme-icon-sun,
.mobile-icon-btn .theme-icon-moon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    line-height: 0;
    pointer-events: none;
}

.mobile-icon-btn svg,
.mobile-icon-btn .theme-icon-sun svg,
.mobile-icon-btn .theme-icon-moon svg {
    display: block;
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0;
    flex-shrink: 0;
}

/* Mobile Search Bar */
.mobile-search-bar {
    padding: 12px 16px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.mobile-search-input-wrap {
    position: relative;
    width: 100%;
}

.mobile-search-input {
    width: 100%;
    height: 44px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 16px 0 40px;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
}

.mobile-search-input:focus {
    border-color: var(--accent);
}

.mobile-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Mobile Hero Highlight */
.mobile-hero {
    position: relative;
    margin: 16px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.mobile-hero-cover {
    aspect-ratio: 16/9;
    background-color: #000000;
    position: relative;
}

.mobile-hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-hero-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.mobile-hero-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-hero-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.mobile-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Horizontal Swipe Lists */
.mobile-section {
    margin-top: 24px;
}

.mobile-section-header {
    padding: 0 16px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-section-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 16px 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mobile-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

/* Mobile Filter Pills */
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-pill.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.filter-pill.active .filter-count {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.filter-pill-female.active {
    background-color: rgba(244, 63, 94, 0.16);
    border-color: #f43f5e;
    color: #f43f5e;
}

.filter-pill-female.active .filter-count {
    background-color: #f43f5e;
    color: #ffffff;
}

.filter-pill-male.active {
    background-color: rgba(56, 189, 248, 0.16);
    border-color: #38bdf8;
    color: #38bdf8;
}

.filter-pill-male.active .filter-count {
    background-color: #38bdf8;
    color: #ffffff;
}

.filter-pill-trans.active {
    background-color: rgba(192, 132, 252, 0.16);
    border-color: #c084fc;
    color: #c084fc;
}

.filter-pill-trans.active .filter-count {
    background-color: #c084fc;
    color: #ffffff;
}

.filter-count {
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 9999px;
    background-color: rgba(0, 0, 0, 0.25);
    color: var(--text-muted);
    font-weight: 700;
}

.filter-check {
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
}

.gender-symbol-pill {
    font-weight: 800;
    font-size: 0.88rem;
    line-height: 1;
}

.gender-symbol-pill.female { color: #f43f5e; }
.gender-symbol-pill.male { color: #38bdf8; }
.gender-symbol-pill.trans { color: #c084fc; }

.performer-flag-img {
    border-radius: 2px;
    vertical-align: middle;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.mobile-performer-bubble {
    flex: 0 0 85px;
    text-align: center;
    scroll-snap-align: start;
}

.mobile-performer-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    margin: 0 auto 6px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    background-color: var(--surface-elevated);
}

.mobile-performer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-performer-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Scene Feed Cards */
.mobile-scenes-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 16px;
}

.mobile-scene-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.mobile-scene-card:active {
    opacity: 0.9;
}

.mobile-scene-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background-color: #000000;
}

.mobile-scene-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-scene-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.mobile-scene-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-scene-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.mobile-scene-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Mobile Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-align: center;
}

.bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-item:active {
    opacity: 0.6;
}

/* Mobile Drawer */
.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80%;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 310;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
}

.mobile-drawer.active {
    transform: translateX(0);
}

.mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 20px;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-drawer-link:active {
    background-color: var(--surface-elevated);
}

.mobile-footer {
    text-align: center;
    padding: 30px 16px 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.mobile-switch-view-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

/* Canvas Performer Info Grid (Mobile) */
.canvas-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 16px;
}

.canvas-tabs-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    overflow-x: auto;
}

.canvas-tab {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.canvas-tab.active {
    color: #10b981;
    border-bottom-color: #10b981;
    font-weight: 700;
}

.canvas-body {
    padding: 14px;
}

.canvas-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.canvas-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    min-height: 40px;
    gap: 8px;
}

.canvas-pill-label {
    background-color: #334155;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.canvas-cell-val {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile Performer Portrait Cards (Matching avatar.png Spec) */
.mobile-performer-card {
    flex: 0 0 130px;
    scroll-snap-align: start;
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.performer-media-wrap {
    position: relative;
    aspect-ratio: 9/14;
    background-color: var(--surface-elevated);
    overflow: hidden;
}

.performer-media-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.performer-flag {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    font-size: 16px;
    line-height: 1;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7));
}

.performer-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.75) 30%, rgba(15, 23, 42, 0.95) 100%);
    padding: 6px 8px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.performer-age {
    font-size: 11px;
    font-weight: 600;
    color: #f8fafc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.gender-ico {
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.gender-ico-female {
    color: #ec4899;
}

.gender-ico-male {
    color: #3b82f6;
}

.gender-ico-trans {
    color: #a855f7;
}

.performer-footer {
    padding: 8px 10px;
    background-color: var(--surface-card);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.performer-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

/* Mobile Content Tabs & Tab Panes */
.mobile-content-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-content-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.mobile-content-tab-btn:active {
    opacity: 0.8;
}

.mobile-content-tab-btn.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.mobile-content-tab-badge {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 9999px;
    background-color: rgba(0, 0, 0, 0.25);
    color: inherit;
    font-weight: 700;
}

.mobile-content-tab-btn.active .mobile-content-tab-badge {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Mobile Movies Grid */
.mobile-movies-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 14px;
}

.mobile-movie-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.mobile-movie-poster {
    position: relative;
    aspect-ratio: 2/3;
    background-color: #000000;
    overflow: hidden;
}

.mobile-movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-movie-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.mobile-movie-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.mobile-movie-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   MOBILE SITES & STUDIOS GRID (2-COLUMN UNIFORM CARDS)
   ========================================================================== */
.mobile-sites-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 14px;
}

.mobile-site-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease;
}

.mobile-site-card:active {
    transform: scale(0.98);
}

.mobile-site-logo-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background-color: #ffffff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.mobile-site-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-site-body {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.mobile-site-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-site-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}




