/* ============================================
   TikTube Frontend v3.0 - tik.porn Style
   Compact text, max video, avatar sidebar
   ============================================ */

/* Reset & Base */
.tiktube-feed-wrap, .tiktube-feed-wrap * { margin: 0; padding: 0; box-sizing: border-box; }

/* Kill ALL blue highlights from Astra/Chrome */
.tiktube-feed-wrap button,
.tiktube-feed-wrap .tiktube-menu-btn,
.tiktube-feed-wrap .tiktube-sound-btn,
.tiktube-feed-wrap .tiktube-menu-close,
.tiktube-feed-wrap .tiktube-action {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    background-color: transparent !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}
.tiktube-feed-wrap button:focus,
.tiktube-feed-wrap button:active,
.tiktube-feed-wrap button:hover,
.tiktube-feed-wrap .tiktube-menu-btn:focus,
.tiktube-feed-wrap .tiktube-menu-btn:active,
.tiktube-feed-wrap .tiktube-sound-btn:focus,
.tiktube-feed-wrap .tiktube-sound-btn:active,
.tiktube-feed-wrap .tiktube-menu-close:focus,
.tiktube-feed-wrap .tiktube-menu-close:active {
    outline: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
    border-color: transparent !important;
    color: #fff !important;
}

.tiktube-feed-wrap {
    position: fixed !important; top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100vh !important; height: 100dvh !important;
    background: #000 !important; overflow: hidden !important; z-index: 9999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    padding: 0 !important; margin: 0 !important; border: none !important;
}

/* Astra overrides */
body.tiktube-feed-active, body.tiktube-feed-active *:not(script):not(style):not(.tiktube-feed-wrap):not(.tiktube-feed-wrap *) {
    padding: 0 !important; margin: 0 !important; border: none !important; box-sizing: border-box !important;
}
body.tiktube-feed-active .ast-oembed-container *, body .ast-oembed-container .tiktube-media *,
body.tiktube-feed-active video, body.tiktube-feed-active img.tiktube-thumb {
    position: absolute !important; top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important; object-fit: cover !important;
}
body.tiktube-feed-active #wpadminbar { display: none !important; }
body.tiktube-feed-active html, html.tiktube-feed-active, html { margin-top: 0 !important; }
body.tiktube-feed-active #ast-scroll-top,
body.tiktube-feed-active header, body.tiktube-feed-active footer,
body.tiktube-feed-active .site-header, body.tiktube-feed-active .site-footer { display: none !important; }
body.tiktube-feed-active { overflow: hidden !important; margin-top: 0 !important; }

/* ============================================
   Scroll Container
   ============================================ */
.tiktube-scroll {
    width: 100%; height: 100vh; height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none; -ms-overflow-style: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}
.tiktube-scroll::-webkit-scrollbar { display: none; }

/* ============================================
   Individual Slide
   ============================================ */
.tiktube-slide {
    width: 100% !important; height: 100vh !important; height: 100dvh !important;
    scroll-snap-align: start; scroll-snap-stop: always;
    position: relative !important; overflow: hidden !important;
    background: #000 !important; padding: 0 !important; margin: 0 !important;
}

/* ============================================
   Video/Image
   ============================================ */
.tiktube-media {
    position: absolute !important; top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    cursor: pointer; padding: 0 !important; margin: 0 !important;
}
.tiktube-media video, .tiktube-media img.tiktube-thumb {
    width: 100% !important; height: 100% !important; object-fit: cover !important;
    background: #000 !important; display: block !important;
    max-width: none !important; max-height: none !important;
    position: absolute !important; top: 0 !important; left: 0 !important;
    transform: none !important; margin: 0 !important; padding: 0 !important;
}

/* Gradient - subtle, only bottom area */
.tiktube-slide::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 35%;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    pointer-events: none; z-index: 1;
}

/* ============================================
   Content Overlay (COMPACT - tik.porn style)
   ============================================ */
.tiktube-content {
    position: absolute; bottom: 0; left: 0; right: 60px;
    padding: 0 12px 60px;
    z-index: 2; color: #fff;
}

/* Model name + sponsor on same line */
.tiktube-content-meta {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}

/* Hidden title for SEO - visible to Google, not to users */
.tiktube-seo-title {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
    font-size: 16px; color: #fff;
}

.tiktube-model-name {
    font-size: 14px; font-weight: 700; color: #fff; text-decoration: none;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.tiktube-model-name:hover { text-decoration: underline; }

.tiktube-studio-pill {
    font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.12); padding: 2px 7px; border-radius: 3px;
    letter-spacing: 0.3px;
}

/* Description - 1 line compact */
.tiktube-desc-wrap {
    display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px;
}

.tiktube-desc {
    font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    max-width: calc(100% - 40px);
}
.tiktube-desc.expanded { white-space: normal; max-width: 100%; }

.tiktube-desc-toggle {
    color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
    background: none; border: none; cursor: pointer; padding: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Tags - STRICT 1 line horizontal scroll */
.tiktube-tags {
    display: flex; flex-wrap: nowrap; gap: 8px;
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
    white-space: nowrap; max-height: 20px;
}
.tiktube-tags::-webkit-scrollbar { display: none; }
.tiktube-tags a {
    display: inline; white-space: nowrap; flex-shrink: 0;
    color: rgba(255,255,255,0.65); font-size: 12px; font-weight: 500;
    text-decoration: none; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.tiktube-tags a:hover { color: #fff; }

/* ============================================
   Sidebar (right side - tik.porn style)
   ============================================ */
.tiktube-sidebar {
    position: absolute; right: 8px; bottom: 70px;
    z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.tiktube-action {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    text-decoration: none; color: #fff; transition: transform 0.2s;
    background: none; border: none; cursor: pointer; padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.tiktube-action:hover { transform: scale(1.1); }

/* Avatar circle */
.tiktube-avatar-action { margin-bottom: 4px; }
.tiktube-avatar-circle {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, #fe2c55, #25f4ee);
    border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 800; color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Action icons */
.tiktube-action-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
}

.tiktube-action-icon svg {
    width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}

.tiktube-action-count {
    font-size: 11px; color: rgba(255,255,255,0.8); font-weight: 500;
}

/* Sound button in sidebar */
.tiktube-sound-btn { outline: none; }
.tiktube-sound-btn .tiktube-action-icon svg {
    width: 28px; height: 28px;
}

/* ============================================
   Play/Pause Indicator
   ============================================ */
.tiktube-play-indicator {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 3; width: 56px; height: 56px; background: rgba(0,0,0,0.35);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.tiktube-play-indicator.show { opacity: 1; }
.tiktube-play-indicator svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }

/* ============================================
   Top Bar
   ============================================ */
.tiktube-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(rgba(0,0,0,0.6), transparent);
    pointer-events: none;
}
.tiktube-topbar > * { pointer-events: auto; }

.tiktube-logo {
    font-size: 22px; font-weight: 900; color: #fff; text-decoration: none;
    letter-spacing: -0.5px; text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    display: flex; align-items: center; flex-shrink: 0;
}
.tiktube-logo .logo-accent { color: #fe2c55; }

.tiktube-nav { display: flex; gap: 12px; align-items: center; flex: 1; justify-content: center; }
.tiktube-nav a {
    color: rgba(255,255,255,0.5); text-decoration: none; font-size: 13px; font-weight: 600;
    transition: color 0.2s; white-space: nowrap;
}
.tiktube-nav a:hover, .tiktube-nav a.active { color: #fff; }
.tiktube-nav a.active { border-bottom: 2px solid #fff; padding-bottom: 2px; }

/* Hamburger Menu Button */
.tiktube-menu-btn {
    background: none; border: none; cursor: pointer; padding: 6px;
    -webkit-tap-highlight-color: transparent; pointer-events: auto;
    outline: none; -webkit-appearance: none; appearance: none;
}
.tiktube-menu-btn svg { width: 24px; height: 24px; display: block; }

/* Menu Overlay */
.tiktube-menu-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 98;
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.tiktube-menu-overlay.open { opacity: 1; visibility: visible; }

/* Menu Panel */
.tiktube-menu-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 280px; max-width: 80vw;
    background: #111; z-index: 99;
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto; scrollbar-width: thin; scrollbar-color: #333 transparent;
    -webkit-overflow-scrolling: touch;
}
.tiktube-menu-panel.open { transform: translateX(0); }

/* Close Button */
.tiktube-menu-close {
    position: absolute; top: 12px; right: 12px;
    background: none; border: none; cursor: pointer; padding: 4px;
    -webkit-tap-highlight-color: transparent; z-index: 1;
}
.tiktube-menu-close svg { width: 24px; height: 24px; }

/* Menu Content */
.tiktube-menu-links { padding: 50px 0 20px; }

/* Grid of main nav boxes */
.tiktube-menu-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    padding: 0 16px 20px;
}
.tiktube-menu-box {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 12px 14px;
    color: #fff; text-decoration: none; font-size: 13px; font-weight: 600;
    transition: background 0.2s;
}
.tiktube-menu-box:hover { background: rgba(255,255,255,0.15); }
.tiktube-menu-box svg {
    width: 18px; height: 18px; fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}

/* Section */
.tiktube-menu-section { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.06); }
.tiktube-menu-section h3 {
    font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.4);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}

/* Menu items (studios, models) */
.tiktube-menu-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 0; color: #fff; text-decoration: none; font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04); transition: color 0.2s;
}
.tiktube-menu-item:last-child { border-bottom: none; }
.tiktube-menu-item:hover { color: #fe2c55; }
.tiktube-menu-count { font-size: 12px; color: rgba(255,255,255,0.3); }

/* Tags in menu */
.tiktube-menu-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tiktube-menu-tags a {
    display: inline-block; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 6px;
    padding: 6px 10px; color: rgba(255,255,255,0.7); font-size: 12px;
    text-decoration: none; transition: background 0.2s, color 0.2s;
}
.tiktube-menu-tags a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.tiktube-menu-tags a span { color: rgba(255,255,255,0.35); font-size: 11px; }

/* Footer */
.tiktube-menu-footer {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 20px 16px; margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.tiktube-menu-footer a { color: rgba(255,255,255,0.35); font-size: 12px; text-decoration: none; }
.tiktube-menu-footer a:hover { color: #fff; }
.tiktube-menu-footer span { color: rgba(255,255,255,0.15); }

/* ============================================
   Bottom Navigation Bar
   ============================================ */
.tiktube-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-around;
    height: 48px;
    background: rgba(0,0,0,0.95);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.tiktube-nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; text-decoration: none; color: rgba(255,255,255,0.4);
    transition: color 0.15s; padding: 4px 12px;
    -webkit-tap-highlight-color: transparent;
}
.tiktube-nav-item.active { color: #fff; }
.tiktube-nav-item:hover { color: rgba(255,255,255,0.75); }

.tiktube-nav-item svg {
    width: 20px; height: 20px; fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.tiktube-nav-item.active svg { stroke-width: 2.2; }
.tiktube-nav-label { font-size: 9px; font-weight: 500; }

/* Counter */
.tiktube-counter {
    position: fixed; top: 48px; right: 14px; z-index: 10;
    color: rgba(255,255,255,0.3); font-size: 11px; font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ============================================
   Loading / Spinner
   ============================================ */
.tiktube-loading {
    height: 100vh; height: 100dvh;
    display: flex; align-items: center; justify-content: center; background: #000;
}
.tiktube-spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(255,255,255,0.08); border-top-color: #fe2c55;
    border-radius: 50%; animation: tiktube-spin 0.7s linear infinite;
}
@keyframes tiktube-spin { to { transform: rotate(360deg); } }

/* ============================================
   Desktop Layout
   ============================================ */
@media (min-width: 768px) {
    .tiktube-feed-wrap {
        display: flex !important; align-items: center !important; justify-content: center !important;
        background: #0a0a0a !important;
    }
    .tiktube-scroll { width: 420px; max-width: 420px; height: 100vh; height: 100dvh; position: relative; box-shadow: 0 0 80px rgba(0,0,0,0.6); }
    .tiktube-topbar { width: 420px; left: 50%; transform: translateX(-50%); }
    .tiktube-bottom-nav { width: 420px; left: 50%; transform: translateX(-50%); }
    .tiktube-counter { display: none; }

    .tiktube-desktop-panel {
        display: block; position: fixed; left: calc(50% + 230px); top: 50%;
        transform: translateY(-50%); width: 340px; max-height: 80vh;
        overflow-y: auto; padding: 28px; color: #ccc;
        scrollbar-width: thin; scrollbar-color: #333 transparent;
    }
    .tiktube-desktop-panel h3 { font-size: 18px; color: #fff; margin-bottom: 12px; line-height: 1.3; font-weight: 700; }
    .tiktube-desktop-panel .tiktube-dp-counter { font-size: 12px; color: rgba(255,255,255,0.3); margin-bottom: 16px; }
    .tiktube-desktop-panel .tiktube-dp-models { font-size: 14px; color: #fe2c55; margin-bottom: 12px; }
    .tiktube-desktop-panel .tiktube-dp-models a { color: #fe2c55; text-decoration: none; font-weight: 600; }
    .tiktube-desktop-panel .tiktube-dp-models a:hover { text-decoration: underline; }
    .tiktube-desktop-panel .tiktube-dp-desc { font-size: 13px; line-height: 1.6; color: #777; margin-bottom: 16px; }
    .tiktube-desktop-panel .tiktube-dp-studio { font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; font-weight: 600; }
    .tiktube-desktop-panel .tiktube-dp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
    .tiktube-desktop-panel .tiktube-dp-tags a { display: inline-block; background: rgba(255,255,255,0.05); color: #666; font-size: 12px; padding: 4px 12px; border-radius: 4px; text-decoration: none; transition: background 0.2s, color 0.2s; }
    .tiktube-desktop-panel .tiktube-dp-tags a:hover { background: rgba(255,255,255,0.1); color: #fff; }
    .tiktube-desktop-panel .tiktube-dp-cta { display: inline-flex; align-items: center; gap: 8px; background: #fe2c55; color: #fff; font-size: 14px; font-weight: 700; padding: 12px 28px; border-radius: 6px; text-decoration: none; margin-top: 20px; transition: background 0.2s, transform 0.15s; }
    .tiktube-desktop-panel .tiktube-dp-cta:hover { background: #e91e45; color: #fff; text-decoration: none; transform: scale(1.02); }
}

@media (max-width: 767px) { .tiktube-desktop-panel { display: none !important; } }

/* Performance */
.tiktube-slide { will-change: transform; }
.tiktube-media video, .tiktube-media img { will-change: opacity; }

/* Fix Astra leaking */
.tiktube-feed-wrap .tiktube-content, .tiktube-feed-wrap .tiktube-content * { position: static; display: revert; }
.tiktube-feed-wrap .tiktube-content { position: absolute; }
.tiktube-feed-wrap .tiktube-sidebar .tiktube-action-icon svg,
.tiktube-feed-wrap .tiktube-bottom-nav svg { position: static !important; display: block !important; }
.tiktube-feed-wrap .tiktube-sidebar .tiktube-avatar-circle { position: static !important; }
