/* TokFlow Standalone PHP/HTML/CSS Theme */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
}

.app-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background-color: #0d0d0d;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0) 100%);
}

.feed-tabs {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feed-tab {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.feed-tab.active {
    color: #fff;
}

.feed-tab.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 15%;
    right: 15%;
    height: 3px;
    background: #FE2C55;
    border-radius: 999px;
}

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

.admin-quick-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
}

.admin-quick-btn:hover {
    background: #FE2C55;
    border-color: #FE2C55;
    transform: scale(1.05);
}

/* Horizontal Category Bar */
.category-bar-wrapper {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 4px 12px 8px 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

.category-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 4px;
    pointer-events: auto;
}

.category-pills::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.85);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cat-pill:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
}

.cat-pill.active {
    background: linear-gradient(135deg, #FE2C55 0%, #FF0050 100%);
    color: #fff;
    border-color: rgba(254, 44, 85, 0.8);
    box-shadow: 0 2px 10px rgba(254, 44, 85, 0.45);
}

/* Floating Sound / Unmute Button */
.sound-floating-toggle {
    position: absolute;
    top: 96px;
    right: 14px;
    z-index: 42;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.25s;
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

.sound-floating-toggle:hover {
    background: rgba(254, 44, 85, 0.85);
    border-color: #FE2C55;
    transform: scale(1.04);
}

.sound-floating-toggle.unmuted {
    background: rgba(37, 244, 238, 0.25);
    border-color: #25F4EE;
    color: #25F4EE;
}

.sound-floating-toggle.unmuted .sound-icon {
    color: #25F4EE;
}

.sound-icon {
    font-size: 18px;
    color: #fff;
}

/* Video Feed Carousel */
.video-feed {
    flex: 1;
    position: relative;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    height: 100%;
}

.video-feed::-webkit-scrollbar {
    display: none;
}

.video-card {
    position: relative;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

/* Media wrapper for videos and iframes */
.video-media-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.video-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none; /* Let clicks pass to tap layer */
    transform: scale(1.02); /* Clean full bleed */
}

.native-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tap Layer for single tap play/pause & double tap heart */
.video-tap-layer {
    position: absolute;
    inset: 0;
    z-index: 15;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-indicator-icon {
    display: none;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    pointer-events: none;
}

.play-indicator-icon span {
    font-size: 40px;
    margin-left: 4px;
}

.video-card.is-paused .play-indicator-icon {
    display: flex;
    animation: popPlay 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popPlay {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.video-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 12;
    background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0.85) 100%);
}

/* Sidebar action icons */
.action-bar {
    position: absolute;
    right: 12px;
    bottom: 84px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.action-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    cursor: pointer;
    gap: 4px;
    transition: transform 0.15s;
}

.action-btn:active {
    transform: scale(0.9);
}

.action-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.15);
    transition: background 0.2s;
}

.action-btn:hover .action-icon-circle {
    background: rgba(254, 44, 85, 0.4);
    border-color: #FE2C55;
}

.action-count {
    font-size: 11px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Disc spinning audio */
.sound-disc {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #222;
    border: 3px solid #111;
    overflow: hidden;
    animation: spin 4s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    margin-top: 4px;
}

.sound-disc img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Video info at bottom */
.video-info {
    position: absolute;
    bottom: 74px;
    left: 14px;
    right: 76px;
    z-index: 30;
    pointer-events: auto;
}

.creator-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.creator-name {
    font-size: 15px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.creator-badge {
    background: #25F4EE;
    color: #000;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
}

.video-caption {
    font-size: 13px;
    color: #f1f1f1;
    line-height: 1.4;
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.category-badge-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.chip-cat {
    background: rgba(37, 244, 238, 0.16);
    border: 1px solid #25F4EE;
    color: #25F4EE;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.chip-tags {
    color: #25F4EE;
    font-size: 12px;
    font-weight: 700;
}

.sound-marquee {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

/* Bottom Bar Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #a19e9d;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    gap: 3px;
    transition: color 0.15s;
}

.nav-item:hover, .nav-item.active {
    color: #fff;
}

.plus-btn {
    position: relative;
    width: 44px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
}

.plus-btn:hover {
    transform: scale(1.08);
}

.plus-cyan {
    position: absolute;
    inset: 0;
    background: #25F4EE;
    border-radius: 8px;
    transform: translateX(-3px);
}

.plus-magenta {
    position: absolute;
    inset: 0;
    background: #FE2C55;
    border-radius: 8px;
    transform: translateX(3px);
}

.plus-white {
    position: absolute;
    inset: 0;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 20px;
    font-weight: bold;
}

/* Empty State Placeholder */
.no-videos-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    color: #fff;
}

/* Comment Drawer Modal */
.comment-drawer {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: rgba(0,0,0,0.6);
    display: none;
    flex-direction: column;
    justify-content: flex-end;
}

.comment-drawer.open {
    display: flex;
}

.drawer-content {
    background: #181818;
    border-radius: 20px 20px 0 0;
    padding: 16px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.comment-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-row {
    display: flex;
    gap: 10px;
    font-size: 13px;
}

.comment-input-row {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.comment-input {
    flex: 1;
    padding: 10px 14px;
    background: #222;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: #fff;
    outline: none;
    font-size: 13px;
}
