/* ========================================
   Techpedya 2026 - TIKTOK FEED MODE
   Mobile-only vertical swipe feed
   ======================================== */

/* === VARIABLES (inherit from main) === */
:root {
    --feed-dark-950: #000000;
    --feed-dark-900: #050505;
    --feed-dark-800: #0A0A0A;
    --feed-dark-700: #111111;
    --feed-neon-cyan: #00FFC8;
    --feed-neon-dim: #00BD94;
    --feed-neon-glow: rgba(0, 255, 200, 0.3);
    --feed-bottom-sheet-height: 70vh;
}

/* === RESET & BASE === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--feed-dark-950);
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* === NEWS TICKER (disabled) === */
.feed-ticker {
    display: none;
}

.feed-ticker__label {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 100%;
    border-right: 1px solid rgba(0, 0, 0, 0.15);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    color: #000;
    letter-spacing: 0.15em;
}

.feed-ticker__dot {
    width: 5px;
    height: 5px;
    background: #000;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.feed-ticker__track {
    flex: 1;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 12px;
}

.feed-ticker__scroll {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: feedTickerScroll 200s linear infinite;
}

.feed-ticker__item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(0, 0, 0, 0.8);
    padding: 0 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.feed-ticker__item-cat {
    font-weight: 700;
    color: #000;
}

@keyframes feedTickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* === FEED CONTAINER (below ticker, above bottom nav) === */
.feed-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    scroll-behavior: smooth;
}

/* Hide scrollbar */
.feed-container::-webkit-scrollbar {
    display: none;
}
.feed-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* === FEED CARD (each card = 1 full screen) === */
.feed-card {
    height: 100dvh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    overflow: hidden;
    background: var(--feed-dark-950);
}

/* === CARD IMAGE (3:4 ratio, top-aligned) === */
.feed-card__image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.feed-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* === CARD CONTENT (overlay on bottom of image) === */
.feed-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 60px 20px 12px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    z-index: 4;
}

/* Category badge */
.feed-card__category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--feed-neon-cyan);
    text-transform: uppercase;
}

.feed-card__category-dot {
    width: 6px;
    height: 6px;
    background: var(--feed-neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--feed-neon-glow);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.feed-card__date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 8px;
}


.feed-card__summary {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Actions row */
.feed-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

/* Read more button */
.feed-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--feed-neon-cyan);
    background: rgba(0, 255, 200, 0.08);
    border: 1px solid rgba(0, 255, 200, 0.2);
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.feed-card__cta:active {
    background: rgba(0, 255, 200, 0.15);
    border-color: rgba(0, 255, 200, 0.5);
}

/* Share button */
.feed-card__share {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.feed-card__share:active {
    background: rgba(0, 255, 200, 0.1);
    border-color: var(--feed-neon-cyan);
    color: var(--feed-neon-cyan);
}

/* Classic site button (fixed top-right) */
.feed-classic-btn {
    position: fixed;
    top: 20px;
    right: 12px;
    z-index: 50;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    letter-spacing: 0.08em;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.feed-classic-btn:active {
    border-color: var(--feed-neon-cyan);
    color: var(--feed-neon-cyan);
}

/* === EXPLORE GRID OVERLAY === */
.feed-explore {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: var(--feed-dark-950);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.feed-explore.open {
    transform: translateY(0);
}

.feed-explore__header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--feed-dark-700);
}

.feed-explore__title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--feed-neon-cyan);
    letter-spacing: 0.1em;
}

.feed-explore__close {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    cursor: pointer;
}

.feed-explore__close:active {
    border-color: var(--feed-neon-cyan);
    color: var(--feed-neon-cyan);
}

.feed-explore__grid {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: min-content;
    align-content: start;
    gap: 3px;
    padding: 3px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.feed-explore__item {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    cursor: pointer;
}

.feed-explore__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.feed-explore__item:active img {
    transform: scale(1.05);
}

.feed-explore__item-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.feed-explore__item-cat {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    font-weight: 600;
    color: var(--feed-neon-cyan);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* === BOTTOM NAVIGATION BAR (disabled — browser bar handles this) === */
.feed-bottomnav {
    display: none;
}

.feed-bottomnav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 0 8px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: color 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.feed-bottomnav__item:active {
    color: rgba(255, 255, 255, 0.8);
}

.feed-bottomnav__item--active {
    color: var(--feed-neon-cyan);
}

.feed-bottomnav__item--active svg {
    filter: drop-shadow(0 0 6px var(--feed-neon-glow));
}

/* === SIGNAL PROGRESS BAR (replaces numeric counter) === */
.feed-signal {
    position: fixed;
    right: 10px;
    top: 65px;
    z-index: 50;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.feed-signal__track {
    position: relative;
    width: 2px;
    height: 60px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1px;
}

.feed-signal__progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--feed-neon-cyan);
    border-radius: 1px;
    transition: height 0.4s ease;
    box-shadow: 0 0 6px var(--feed-neon-glow);
}

.feed-signal__dot {
    position: absolute;
    left: 50%;
    top: 0%;
    transform: translate(-50%, -50%);
    width: 5px;
    height: 5px;
    background: var(--feed-neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--feed-neon-cyan), 0 0 20px var(--feed-neon-glow);
    transition: top 0.4s ease;
}

.feed-signal__pct {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    font-weight: 600;
    color: var(--feed-neon-cyan);
    text-shadow: 0 0 8px var(--feed-neon-glow);
    letter-spacing: 0.05em;
    min-width: 28px;
    text-align: center;
}

/* === BOTTOM SHEET (article detail) === */
.feed-bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.3s ease;
}

.feed-bottom-sheet-backdrop.active {
    background: rgba(0, 0, 0, 0.6);
    pointer-events: auto;
}

.feed-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 101;
    height: var(--feed-bottom-sheet-height);
    background: var(--feed-dark-900);
    border-top: 1px solid rgba(0, 255, 200, 0.2);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.feed-bottom-sheet.open {
    transform: translateY(0);
}

/* Drag handle */
.feed-bottom-sheet__handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
    flex-shrink: 0;
}

.feed-bottom-sheet__handle-bar {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Sheet header */
.feed-bottom-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 12px;
    border-bottom: 1px solid var(--feed-dark-700);
    flex-shrink: 0;
}

.feed-bottom-sheet__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

.feed-bottom-sheet__close {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    cursor: pointer;
}

.feed-bottom-sheet__close:active {
    border-color: var(--feed-neon-cyan);
    color: var(--feed-neon-cyan);
}

/* Sheet body (scrollable) */
.feed-bottom-sheet__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.feed-bottom-sheet__title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.25;
    color: #fff;
    margin-bottom: 16px;
}

.feed-bottom-sheet__body p {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
}

.feed-bottom-sheet__body a {
    color: var(--feed-neon-cyan);
    text-decoration: underline;
}

.feed-bottom-sheet__source {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--feed-dark-700);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.feed-bottom-sheet__source a {
    color: var(--feed-neon-cyan);
    text-decoration: none;
}

/* === LOADING STATE === */
.feed-loading {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--feed-dark-950);
}

.feed-loading__bar {
    width: 120px;
    height: 2px;
    background: var(--feed-dark-700);
    position: relative;
    overflow: hidden;
}

.feed-loading__bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: var(--feed-neon-cyan);
    box-shadow: 0 0 8px var(--feed-neon-glow);
    animation: loading-slide 1s ease-in-out infinite;
}

@keyframes loading-slide {
    0% { left: -50%; }
    100% { left: 100%; }
}

.feed-loading__text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.15em;
}

/* === DESKTOP REDIRECT NOTICE === */
@media (min-width: 769px) {
    .feed-desktop-notice {
        display: flex !important;
    }
    .feed-container,
    .feed-counter,
    .feed-bottomnav,
    .feed-ticker {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .feed-desktop-notice {
        display: none !important;
    }
}

.feed-desktop-notice {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--feed-dark-950);
    text-align: center;
    padding: 40px;
}

.feed-desktop-notice__icon {
    font-size: 48px;
}

.feed-desktop-notice__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.feed-desktop-notice__text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    max-width: 400px;
    line-height: 1.6;
}

.feed-desktop-notice__link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--feed-neon-cyan);
    text-decoration: none;
    border: 1px solid rgba(0, 255, 200, 0.3);
    padding: 12px 24px;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.feed-desktop-notice__link:hover {
    background: rgba(0, 255, 200, 0.1);
    border-color: var(--feed-neon-cyan);
}

/* === ACCESSIBILITY: Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .feed-container {
        scroll-behavior: auto;
    }
}
