/* FILE: /public/css/feeds.css */
:root {
    --dx-bg: #0a0b0d;
    --dx-surface: #14161a;
    --dx-surface-2: #1c1f25;
    --dx-border: rgba(255, 255, 255, 0.08);
    --dx-border-strong: rgba(255, 255, 255, 0.14);
    --dx-text: #f5f7fb;
    --dx-text-muted: #8b949e;
    --dx-accent: #d97757;
    --dx-accent-hover: #e58b6d;
    --dx-accent-glow: rgba(217, 119, 87, 0.15);
    --dx-success: #10b981;
    --dx-danger: #ef4444;
}
.text-muted {
    --bs-text-opacity: 1;
    color: rgb(156 156 156 / 75%) !important;
}
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: var(--dx-bg);
    overflow: hidden;
}

body {
    color: var(--dx-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
}

/* Dynamic Viewport Absolute Base Wrapper */
.feeds-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #000;
}

/* Top Search Header Bar */
.feeds-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0 16px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 30%, transparent);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.brand-title i {
    color: var(--dx-accent);
}

.search-container {
    flex: 1;
    max-width: 320px;
    position: relative;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--dx-border);
    color: #fff;
    border-radius: 99px;
    padding: 6px 14px 6px 36px;
    font-size: 13px;
    outline: none;
    transition: all 0.25s ease;
}

.search-input:focus {
    border-color: var(--dx-accent);
    box-shadow: 0 0 12px var(--dx-accent-glow);
    background: rgba(255, 255, 255, 0.12);
}

.search-icon-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--dx-text-muted);
    font-size: 14px;
    padding: 0;
    cursor: pointer;
}

/* Terminal Stats Panel Toggle Button */
.stats-trigger {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--dx-border);
    color: var(--dx-text);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.stats-trigger:hover,
.stats-trigger.active {
    background: var(--dx-accent);
    color: #fff;
    border-color: var(--dx-accent);
}

/* Bulletproof Absolute Scroll Container */
.snap-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    z-index: 10;
}

.snap-container::-webkit-scrollbar {
    display: none;
}

/* Snapping child */
.feed-item {
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Player Render Frame */
.video-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* FIXED: Changed from cover to contain so 16:9 horizontal videos do not crop or stretch to vertical 9:16 borders */
.video-viewport video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Play Button Overlay */
.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.play-icon-box {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--dx-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 32px;
    padding-left: 6px;
    box-shadow: 0 0 30px var(--dx-accent-glow);
    transition: transform 0.2s ease;
}

.play-overlay:hover .play-icon-box {
    transform: scale(1.1);
    background: var(--dx-accent-hover);
}

/* Compact Sidebar Interaction Icons */
.sidebar-actions {
    position: absolute;
    right: 16px;
    bottom: 80px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.creator-profile-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--dx-accent);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    background: var(--dx-surface-2);
    display: grid;
    place-items: center;
    font-weight: 700;
}

.creator-profile-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.action-btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.action-circle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--dx-border);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-circle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--dx-border-strong);
}

.action-circle-btn.liked {
    background: #ff4a4a;
    border-color: #ff4a4a;
    color: #fff;
}

.action-count-text {
    font-size: 10px;
    font-weight: 700;
    color: var(--dx-text);
}

/* Elevated Bottom Left Metadata Panel */
.metadata-panel {
    position: absolute;
    left: 16px;
    bottom: 80px;
    right: 80px;
    z-index: 30;
    pointer-events: none;
}

.metadata-panel * {
    pointer-events: auto;
}

.creator-tag {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-follow-pill {
    background: var(--dx-accent);
    color: #fff;
    border: none;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 99px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-follow-pill:hover {
    background: var(--dx-accent-hover);
}

.btn-follow-pill.following {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--dx-border);
}

.video-title-tag {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    margin-bottom: 4px;
}

.video-description-text {
    font-size: 12px;
    color: var(--dx-text-muted);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Fixed Solid Bottom Navigation Bar */
.public-footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #030406;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.nav-icon-link {
    background: none;
    border: none;
    color: var(--dx-text-muted);
    font-size: 20px;
    padding: 10px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.nav-icon-link:hover,
.nav-icon-link.active {
    color: var(--dx-accent);
}

.upload-plus-btn {
    background: var(--dx-accent);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modals Overlay */
.full-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 16px;
}

.feeds-modal-card {
    background: var(--dx-surface);
    border: 1px solid var(--dx-border);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

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

.modal-close-btn {
    background: none;
    border: none;
    color: var(--dx-text-muted);
    font-size: 18px;
    cursor: pointer;
}

.feeds-modal-body {
    padding: 20px;
}

.upload-drop-zone {
    border: 2px dashed var(--dx-border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
}

.feeds-input {
    width: 100%;
    background: var(--dx-surface-2);
    border: 1px solid var(--dx-border);
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    outline: none;
    font-size: 14px;
}

.feeds-input:focus {
    border-color: var(--dx-accent);
}

/* Comment list styling */
.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dx-accent);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 11px;
    color: #fff;
}

.comment-bubble {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--dx-border);
    border-radius: 12px;
    padding: 8px 12px;
}

.comment-author {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}

.comment-body {
    font-size: 13px;
    color: #cbd5e1;
    margin: 0;
}

/* Creator Profile grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.profile-thumb-box {
    aspect-ratio: 9/16;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--dx-border);
    cursor: pointer;
    position: relative;
}

.profile-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.profile-thumb-box:hover .profile-thumb-overlay {
    opacity: 1;
}

/* Telemetry Sidebar */
.stats-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: rgba(11, 13, 17, 0.95);
    border-left: 1px solid var(--dx-border-strong);
    backdrop-filter: blur(12px);
    z-index: 500;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 96px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.stats-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--dx-border);
    border-radius: 12px;
    padding: 14px;
}

.stats-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dx-text-muted);
}

.stats-val {
    font-family: 'Fira Code', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--dx-accent);
    margin-top: 4px;
}

/* Toast */
.feeds-toast {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(17, 19, 23, 0.9);
    border: 1px solid var(--dx-border-strong);
    color: #fff;
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    z-index: 2000;
    display: none;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}