/* ============= CSS Variables & Theme ============= */
:root {
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #e8e8ed;
    --bg-card: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --border-color: #d2d2d7;
    --accent-color: #007aff;
    --accent-hover: #0056b3;
    --success-color: #34c759;
    --error-color: #ff3b30;
    --warning-color: #ff9500;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(0, 122, 255, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-card: #1c1c1e;
    --text-primary: #ffffff;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6e6e73;
    --border-color: #38383a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 122, 255, 0.3);
}

/* ============= Modern Animated Background ============= */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 122, 255, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 70%);
    z-index: -2;
    animation: gradientShift 15s ease infinite;
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

[data-theme="light"] .bg-grid {
    background-image: 
        linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
}

/* Hide background effects on mobile for performance */
@media (max-width: 640px) {
    .bg-grid { display: none; }
    .bg-gradient { opacity: 0.5; }
}

/* ============= Gradient Text Utility ============= */
.gradient-text {
    background: linear-gradient(135deg, #007aff 0%, #5856d6 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============= Global Animation Utilities ============= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 0.5; }
    100% { transform: scale(4); opacity: 0; }
}

/* Animation classes */
.animate-fadeIn { animation: fadeIn 0.4s ease-out; }
.animate-fadeInUp { animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-fadeInDown { animation: fadeInDown 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-scaleIn { animation: scaleIn 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-slideInRight { animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-slideInLeft { animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

/* ============= Page Loading Overlay ============= */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Modern 3-dot bounce loader */
.spinner-circle {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.spinner-circle::before,
.spinner-circle::after,
.spinner-circle span {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-color);
    animation: dotBounce 1.4s ease-in-out infinite;
}

.spinner-circle::before {
    animation-delay: 0s;
}

.spinner-circle span {
    animation-delay: 0.16s;
}

.spinner-circle::after {
    animation-delay: 0.32s;
}

@keyframes dotBounce {
    0%, 80%, 100% { 
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Alternative: Pulsing logo loader */
.spinner-logo {
    font-size: 3rem;
    animation: logoPulse 1.5s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.7;
    }
    50% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

.spinner-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Content fade-in animation */
.content-fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton loading for cards */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 300px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.skeleton-media {
    height: 180px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    padding: 16px;
}

.skeleton-line {
    height: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line.title {
    width: 80%;
    height: 16px;
}

.skeleton-line.short {
    width: 50%;
}

/* ============= Reset & Base ============= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============= Typography ============= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

/* ============= Buttons ============= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.25s ease,
                border-color 0.25s ease;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 200%;
    height: 200%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-1px);
}

.btn-outline:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-text {
    background: transparent;
    color: var(--accent-color);
    padding: 0.5rem;
}

.btn-text:hover {
    background: var(--bg-tertiary);
}

.btn-danger {
    background: var(--error-color);
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background: #d32f2f;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-secondary);
    border-radius: 50%;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-full {
    width: 100%;
}

/* ============= Header ============= */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Back Button - Enhanced with Modern Transitions */
.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.25rem;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.back-btn:hover::before,
.back-btn:focus::before {
    width: 120%;
    height: 120%;
}

.back-btn:hover,
.back-btn:focus {
    border-color: var(--accent-color);
    color: white;
    transform: translateX(-4px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
}

.back-btn:active {
    transform: translateX(-2px) scale(0.95);
    transition-duration: 0.1s;
}

.back-arrow {
    font-weight: 600;
    line-height: 1;
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-btn:hover .back-arrow {
    transform: translateX(-3px);
    animation: arrowPulse 0.6s ease-in-out infinite alternate;
}

@keyframes arrowPulse {
    from { transform: translateX(-2px); }
    to { transform: translateX(-5px); }
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.header-title:hover {
    color: var(--accent-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Theme Toggle */
#themeToggle {
    position: relative;
}

#themeToggle .icon-sun,
#themeToggle .icon-moon {
    font-size: 1.125rem;
    line-height: 1;
}

[data-theme="dark"] #themeToggle .icon-sun { display: inline; }
[data-theme="dark"] #themeToggle .icon-moon { display: none; }
[data-theme="light"] #themeToggle .icon-sun { display: none; }
[data-theme="light"] #themeToggle .icon-moon { display: inline; }

/* ============= User Bar ============= */
.user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.user-bar.hidden {
    display: none;
}

#userGreeting {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============= Main Content ============= */
.main-content {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* ============= Category Tabs ============= */
.category-tabs-container {
    position: sticky;
    top: 56px;
    z-index: 99;
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    margin: 0 -1rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.category-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.25rem;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.category-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* ============= Sections ============= */
.section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.125rem;
    color: var(--text-primary);
}

.see-all {
    font-size: 0.875rem;
    color: var(--accent-color);
}

/* ============= Posts Scroll (Horizontal) ============= */
.posts-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.posts-scroll::-webkit-scrollbar {
    display: none;
}

.posts-scroll .post-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

/* ============= Posts Grid ============= */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

/* ============= Posts List - Responsive Content Grid ============= */
.posts-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1rem 0.75rem;
}

/* Tablet: 2 columns */
@media (min-width: 600px) {
    .posts-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1.25rem 1rem;
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .posts-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.75rem;
        padding: 1.5rem 2rem;
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* Large Desktop: 4 columns */
@media (min-width: 1400px) {
    .posts-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
        max-width: 1800px;
    }
}

/* ============= Post Card ============= */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease;
    cursor: pointer;
    position: relative;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.03) 0%, 
        transparent 50%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.post-card:hover::before {
    opacity: 1;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12),
                0 2px 8px rgba(0, 122, 255, 0.08);
    border-color: var(--accent-color);
}

.post-card:active {
    transform: translateY(-2px) scale(0.99);
    transition-duration: 0.1s;
}

/* Post Card Media - Instagram-style flexible container */
.post-card-media {
    position: relative;
    width: 100%;
    min-height: 180px;
    max-height: 500px;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Media Slider Container (Card sliders) */
.media-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.media-slider {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    touch-action: pan-y pinch-zoom;
}

.media-slide {
    flex: 0 0 100%;
    min-width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.media-slide img,
.media-slide video {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

/* Slider Navigation Dots (Card) */
.media-slider-container .slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 6px 12px;
    z-index: 5;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

/* Slider Arrow Buttons */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.post-card-media:hover .slider-nav {
    opacity: 1;
}

.slider-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.slider-nav.prev {
    left: 8px;
}

.slider-nav.next {
    right: 8px;
}

.slider-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Media Count Badge */
.post-card-media .media-count {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    z-index: 5;
}

/* Single image - Instagram-style contain */
.post-card-media > img,
.post-card-media > video {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

/* Media Error Placeholder */
.media-error-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: 0.875rem;
    padding: 2rem;
    text-align: center;
    gap: 0.75rem;
}

.media-error-placeholder .media-error-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.media-error-placeholder .retry-media-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    transition: var(--transition-fast);
}

.media-error-placeholder .retry-media-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.media-error-placeholder .retry-media-btn:active {
    transform: scale(0.98);
}

/* Reaction button active state */
.card-reaction-btn.active {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.card-reaction-btn.reacting {
    animation: reactionPulse 0.3s ease;
}

@keyframes reactionPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Loading shimmer effect for images */
.media-loading {
    background: linear-gradient(90deg, 
        var(--bg-tertiary) 25%, 
        var(--bg-secondary) 50%, 
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Image load transition - fade in smoothly */
.post-card-media img,
.post-card-media video,
.slider-item img,
.slider-item video {
    opacity: 1;
}

.post-card-body {
    padding: 0.875rem;
}

.post-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-caption {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.post-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Card Reactions (Homepage) */
.card-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.card-reaction-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1.5px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 24px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.card-reaction-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 122, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.card-reaction-btn:hover::before {
    width: 150%;
    height: 150%;
}

.card-reaction-btn:hover {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-color: var(--accent-color);
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-reaction-btn:active {
    transform: scale(0.92);
    transition-duration: 0.1s;
}

.card-reaction-btn.reacting {
    animation: reactionBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes reactionBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3) rotate(-5deg); }
    50% { transform: scale(0.9) rotate(5deg); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.card-reaction-btn .emoji {
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.card-reaction-btn .count {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 0;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.card-reaction-btn:hover .count {
    color: var(--accent-color);
}

/* ============= Loading & Error States ============= */
.loading-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-tertiary);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-state {
    text-align: center;
    padding: 3rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Back Button */
.back-btn {
    font-size: 1.25rem;
    padding: 0.5rem;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state h2 {
    margin-bottom: 0.5rem;
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ============= Load More Button ============= */
.load-more {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
}

.load-more.hidden {
    display: none;
}

/* ============= Post Detail Page ============= */
.post-detail-page {
    padding: 0;
}

.post-detail {
    max-width: 100%;
}

.post-detail.hidden {
    display: none;
}

/* Media Slider (Post Detail) */
.media-slider {
    position: relative;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.slider-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}

.slider-container::-webkit-scrollbar {
    display: none;
}

.slider-item {
    flex: 0 0 100%;
    min-width: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    max-height: 80vh;
    background: var(--bg-tertiary);
    position: relative;
}

.slider-item img,
.slider-item video {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.slider-item audio {
    width: 90%;
    max-width: 400px;
}

/* Post Detail Slider Nav (wrapper for prev/dots/next) */
.media-slider > .slider-nav,
#sliderNav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
    border-radius: 0;
    transform: none;
    opacity: 1;
    z-index: 10;
}

#sliderNav.hidden {
    display: none;
}

.slider-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Post Detail slider dots */
#sliderDots,
.media-slider .slider-dots {
    display: flex;
    gap: 0.5rem;
}

/* Post Detail slider dot (overrides card dot style) */
#sliderDots .slider-dot,
.media-slider .slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

#sliderDots .slider-dot.active,
.media-slider .slider-dot.active {
    background: #fff;
    width: 24px;
    border-radius: 4px;
}

/* Post Info */
.post-info {
    padding: 1rem;
}

.post-title {
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.post-caption {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.6;
}

.post-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--accent-color);
}

.post-link:hover {
    background: var(--bg-tertiary);
}

.post-link.hidden {
    display: none;
}

/* Reactions Bar */
.reactions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.reactions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.875rem;
    position: relative;
    overflow: visible;
}

.reaction-btn:hover {
    background: var(--bg-primary);
    transform: scale(1.1);
}

.reaction-btn:active {
    transform: scale(0.9);
}

.reaction-btn.active {
    background: var(--accent-color);
    color: #fff;
    animation: reactionPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Cool reaction click animation */
@keyframes reactionPop {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Emoji bounce on click */
.reaction-btn .emoji {
    font-size: 1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.reaction-btn:active .emoji {
    animation: emojiBounce 0.4s ease;
}

@keyframes emojiBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-8px) scale(1.2); }
    50% { transform: translateY(0) scale(0.9); }
    75% { transform: translateY(-4px) scale(1.1); }
}

/* Floating emoji animation for reactions */
.reaction-btn.just-reacted::after {
    content: attr(data-emoji);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    animation: floatUp 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px) scale(1.5);
    }
}

.reaction-btn .count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    min-width: 14px;
    text-align: center;
}

.reaction-btn.active .count {
    color: #fff;
}

/* Count change animation */
.reaction-btn .count.counting {
    animation: countBump 0.3s ease;
}

@keyframes countBump {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: var(--accent-color);
    color: #fff;
    transform: scale(1.05);
}

.share-btn:active {
    transform: scale(0.95);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--accent-color);
    color: #fff;
    transform: scale(1.05);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.active {
    background: var(--accent-color);
    color: #fff;
}

.action-btn.report-btn:hover {
    background: var(--danger-color);
}

/* Report Modal */
.report-modal {
    max-width: 450px;
}

.report-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.report-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.report-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-option:hover {
    background: var(--bg-secondary);
}

.report-option input[type="radio"] {
    margin-top: 0.25rem;
    accent-color: var(--accent-color);
}

.report-option .option-text {
    display: flex;
    flex-direction: column;
}

.report-option .option-text strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.report-option .option-text small {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Reply Indicator */
.reply-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--accent-color);
    color: #fff;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.cancel-reply-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.25rem;
    opacity: 0.8;
}

.cancel-reply-btn:hover {
    opacity: 1;
}

/* Comment Actions */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.reply-btn,
.view-replies-btn,
.report-comment-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.reply-btn:hover,
.view-replies-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-color);
}

.report-comment-btn:hover {
    background: var(--bg-tertiary);
    color: var(--danger-color);
}

/* Replies Container */
.replies-container {
    margin-top: 0.75rem;
    margin-left: 2.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--border-color);
}

.reply-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.reply-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #fff;
    flex-shrink: 0;
}

.reply-content {
    flex: 1;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.reply-username {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.reply-time {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.reply-text {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ============= Comments Section ============= */
.comments-section {
    padding: 1rem;
}

.comments-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.comments-title span {
    font-weight: 400;
    color: var(--text-tertiary);
}

/* Comments Disabled State */
.comments-disabled {
    padding: 2rem;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 0.9375rem;
}

/* Comment Form */
.comment-form-wrapper {
    margin-bottom: 1.5rem;
}

.login-prompt {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    text-align: center;
    color: var(--text-secondary);
}

.login-prompt a {
    color: var(--accent-color);
    font-weight: 500;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment-form.hidden {
    display: none;
}

.comment-form textarea {
    resize: none;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.comment-form button {
    align-self: flex-end;
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.comment-item:hover {
    background: var(--bg-tertiary);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.comment-username {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.comment-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    word-wrap: break-word;
}

.comment-delete {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: var(--error-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.comment-item:hover .comment-delete {
    opacity: 1;
}

/* ============= Modal ============= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal:not(.hidden) .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close:hover {
    background: var(--error-color);
    color: #fff;
    transform: rotate(90deg) scale(1.1);
}

/* ============= Auth Forms ============= */
.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-form.hidden {
    display: none;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.input-prefix {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    overflow: hidden;
}

.input-prefix span {
    padding: 0 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: 0.9375rem;
    border-right: 1px solid var(--border-color);
}

.input-prefix input {
    border: none;
    border-radius: 0;
}

.input-prefix input:focus {
    box-shadow: none;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* OTP Input */
.otp-instruction {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.otp-input {
    width: 45px !important;
    height: 50px;
    text-align: center;
    font-size: 1.25rem !important;
    font-weight: 600;
}

.resend-otp {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============= Toast ============= */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    padding: 1rem 1.75rem;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(40px) scale(0.85);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    max-width: 90vw;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-success {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.95) 0%, rgba(48, 179, 80, 0.95) 100%);
    color: #fff;
    box-shadow: 0 10px 40px rgba(52, 199, 89, 0.3);
}

.toast-error {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.95) 0%, rgba(230, 52, 42, 0.95) 100%);
    color: #fff;
    box-shadow: 0 10px 40px rgba(255, 59, 48, 0.3);
}

.toast-warning {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.95) 0%, rgba(230, 134, 0, 0.95) 100%);
    color: #fff;
    box-shadow: 0 10px 40px rgba(255, 149, 0, 0.3);
}

.toast-info {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.95) 0%, rgba(0, 102, 214, 0.95) 100%);
    color: #fff;
    box-shadow: 0 10px 40px rgba(0, 122, 255, 0.3);
}

/* ============= Pagination ============= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
}

.page-btn:hover:not(.disabled):not(.active) {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.page-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    color: var(--text-secondary);
    padding: 0 0.25rem;
}

/* ============= Card Link Button ============= */
.card-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.card-link-btn:active {
    transform: translateY(0);
}

/* ============= Utility Classes ============= */
.hidden {
    display: none !important;
}

/* ============= Responsive ============= */
@media (max-width: 480px) {
    .header {
        padding: 0.5rem 0.75rem;
    }
    
    .header-title {
        font-size: 1.125rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .posts-scroll .post-card {
        flex: 0 0 240px;
    }
    
    .reaction-btn {
        padding: 0.375rem 0.5rem;
    }
    
    .reaction-btn .emoji {
        font-size: 0.875rem;
    }
    
    /* Mobile card reactions */
    .card-reactions {
        gap: 0.2rem;
    }
    
    .card-reaction-btn {
        padding: 0.3rem 0.45rem;
        font-size: 0.75rem;
    }
    
    .post-card-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Better touch targets */
    .back-btn {
        width: 36px;
        height: 36px;
    }
}

/* Touch device improvements */
@media (pointer: coarse) {
    .card-reaction-btn {
        min-height: 36px;
        min-width: 36px;
    }
    
    .back-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ============= Animations ============= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: slideUp 0.3s ease;
}
/* ============= Hamburger Menu Button ============= */
.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 200;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}

.menu-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-btn.active .menu-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-btn.active .menu-icon span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active .menu-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============= Side Menu ============= */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 150;
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100%;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 160;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.side-menu.active {
    left: 0;
}

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.side-menu-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.side-menu-close,
.close-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.side-menu-close:hover,
.close-menu:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.side-menu-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.side-menu-list {
    list-style: none;
    padding: 0.75rem;
    margin: 0;
    flex: 1;
}

.side-menu-list li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.side-menu-list li a:hover {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-color: var(--border-color);
    transform: translateX(4px);
}

.side-menu-list li a.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, #5856d6 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
    border-color: transparent;
}

.side-menu-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
    background: var(--bg-secondary);
}

.side-menu-section {
    margin-bottom: 1.5rem;
}

.side-menu-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.side-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.side-menu-item:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.side-menu-item.active {
    background: var(--accent-color);
    color: #fff;
}

.side-menu-item-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.side-menu-item-text {
    font-size: 0.9375rem;
    font-weight: 500;
}

.side-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

/* ============= Bot Start Prompt ============= */
.bot-start-prompt {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    text-align: center;
}

.bot-start-prompt.show {
    display: block;
}

.bot-start-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.bot-start-prompt p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.bot-start-prompt .bot-start-note {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.bot-start-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #0088cc;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.2s ease;
    width: 100%;
}

.bot-start-link:hover {
    background: #006699;
    color: #fff;
}

.bot-started-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--success-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    width: 100%;
}

.bot-started-btn:hover {
    background: #218838;
}

/* ============= Desktop / PC Specific Styles ============= */
@media (min-width: 1024px) {
    /* Header improvements for desktop */
    .header {
        padding: 1rem 2rem;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
    
    /* Main content container */
    .main-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 1.5rem 2rem;
    }
    
    /* Post detail page - centered with max width */
    .post-detail-page {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .post-detail {
        background: var(--bg-card);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
        overflow: hidden;
    }
    
    /* Media slider improvements */
    .media-slider .slider-item img,
    .media-slider .slider-item video {
        max-height: 70vh;
    }
    
    .media-slider .slider-item {
        max-height: 70vh;
    }
    
    /* Post info section */
    .post-info {
        padding: 1.5rem 2rem;
    }
    
    .post-title {
        font-size: 1.75rem;
    }
    
    .post-caption {
        font-size: 1.0625rem;
        line-height: 1.7;
    }
    
    /* Reactions bar */
    .reactions-bar {
        padding: 1rem 2rem;
    }
    
    .reaction-btn {
        padding: 0.625rem 1rem;
    }
    
    /* Comments section */
    .comments-section {
        padding: 1.5rem 2rem;
    }
    
    .comments-list {
        max-height: 600px;
        overflow-y: auto;
    }
    
    /* Modal improvements for desktop */
    .modal-content {
        max-width: 450px;
    }
    
    .modal-large {
        max-width: 700px;
    }
    
    /* User bar */
    .user-bar {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0.75rem 2rem;
    }
    
    /* Better hover states for desktop */
    .post-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 0 0 1px var(--accent-color);
    }
    
    .btn:hover {
        transform: translateY(-1px);
    }
    
    /* Side menu improvements */
    .side-menu {
        width: 320px;
    }
    
    /* Category tabs - centered and spaced */
    .category-tabs-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0.75rem 2rem;
    }
    
    /* Home hero - more horizontal space */
    .home-hero {
        max-width: 1200px;
        margin: 0.75rem auto 1.25rem;
        padding: 2rem 2.5rem;
        border-radius: var(--radius-xl);
    }
    
    /* Section header  */
    .section-header {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* Pagination centered */
    .pagination-modern {
        max-width: 1400px;
        margin: 1.5rem auto;
        padding: 0 2rem;
    }
}

/* Large desktop - extra wide screens */
@media (min-width: 1600px) {
    .main-content {
        max-width: 1400px;
    }
    
    .post-detail-page {
        max-width: 1000px;
    }
    
    .home-hero {
        max-width: 1400px;
    }
    
    .category-tabs-container {
        max-width: 1400px;
    }
}
/* ============= Modern Home Page Styles ============= */
/* Home page body */
.home-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
}

/* Modern Header */
.header-modern {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .header-modern {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.header-modern .header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-modern .logo-icon {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.header-modern .logo-text {
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Glow button small */
.btn-glow-sm {
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.25);
}

.btn-glow-sm:hover {
    box-shadow: 0 0 25px rgba(0, 122, 255, 0.4);
}

/* Home Hero Section */
.home-hero {
    padding: 1.5rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.08) 0%, 
        rgba(99, 102, 241, 0.05) 50%,
        rgba(16, 185, 129, 0.03) 100%);
    border-radius: var(--radius-xl);
    margin: 0.5rem 0 1rem;
    border: 1px solid rgba(0, 122, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.home-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, 
        rgba(0, 122, 255, 0.1) 0%, 
        transparent 50%);
    animation: heroGlow 10s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heroGlow {
    0%, 100% { transform: translate(-25%, -25%); }
    50% { transform: translate(25%, 25%); }
}

.home-hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(0, 122, 255, 0.15);
    border: 1px solid rgba(0, 122, 255, 0.3);
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
}

.hero-badge-sm .badge-icon {
    font-size: 0.875rem;
}

.home-hero-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.home-hero-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Modern Category Tabs */
.category-modern {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    margin: 0 0 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .category-modern {
    background: rgba(255, 255, 255, 0.6);
}

.category-modern .category-tab {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.category-modern .category-tab:hover {
    background: rgba(0, 122, 255, 0.1);
    border-color: rgba(0, 122, 255, 0.2);
}

.category-modern .category-tab.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, #5856d6 100%);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

/* Modern Section Header */
.section-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    font-size: 1.5rem;
    animation: pulse 3s ease-in-out infinite;
}

.section-header-modern h2 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modern Posts List */
.posts-list-modern {
    padding: 0;
}

/* Modern Post Card */
.posts-modern .post-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.posts-modern .post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--accent-color) 0%, 
        #5856d6 50%, 
        #10b981 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.posts-modern .post-card:hover::before {
    opacity: 1;
}

.posts-modern .post-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 0 30px rgba(0, 122, 255, 0.1);
    border-color: var(--accent-color);
}

/* Modern Loading Placeholder */
.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
    color: var(--text-tertiary);
}

.loading-spinner-sm {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.loading-spinner-sm::before,
.loading-spinner-sm::after,
.loading-spinner-sm span {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-color);
    animation: dotBounce 1.4s ease-in-out infinite;
}

.loading-spinner-sm::before {
    animation-delay: 0s;
}

.loading-spinner-sm span {
    animation-delay: 0.16s;
}

.loading-spinner-sm::after {
    animation-delay: 0.32s;
}

/* Modern Pagination */
.pagination-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
}

.pagination-modern .btn {
    min-width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.pagination-modern .btn.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, #5856d6 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

/* Main Modern Container */
.main-modern {
    position: relative;
    z-index: 1;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .home-hero {
        padding: 1.25rem 1rem;
        margin: 0.25rem 0 0.75rem;
    }
    
    .home-hero-title {
        font-size: 1.5rem;
    }
    
    .home-hero-subtitle {
        font-size: 0.85rem;
    }
    
    .hero-badge-sm {
        font-size: 0.7rem;
        padding: 0.3rem 0.75rem;
    }
    
    .section-header-modern h2 {
        font-size: 1.1rem;
    }
    
    .section-icon {
        font-size: 1.25rem;
    }
}

/* ============= Modern Post Detail Page Styles ============= */
.post-detail-modern {
    position: relative;
}

.post-detail-modern .post-info {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-radius: var(--radius-lg);
    margin: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.post-detail-modern .post-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.post-detail-modern .post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post-detail-modern .reactions-bar {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-lg);
    margin: 0 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.post-detail-modern .comments-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

/* Post Link Button Modern */
.post-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #5856d6 100%);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    margin-top: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.post-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 122, 255, 0.4);
    color: white;
}

/* ============= NEW FEATURES: Tags, Trending, Gestures ============= */

/* ========== Tags System ========== */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}

.post-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(88, 86, 214, 0.08) 100%);
    color: var(--accent-color);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    border: 1px solid rgba(0, 122, 255, 0.2);
}

.post-tag:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.2) 0%, rgba(88, 86, 214, 0.15) 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
    color: var(--accent-color);
}

.post-tag:active {
    transform: scale(0.95);
}

[data-theme="dark"] .post-tag {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15) 0%, rgba(88, 86, 214, 0.12) 100%);
    border-color: rgba(0, 122, 255, 0.3);
}

[data-theme="dark"] .post-tag:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.25) 0%, rgba(88, 86, 214, 0.2) 100%);
}

/* ========== Tag Page Hero ========== */
.tag-hero {
    padding: 2rem 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.tag-hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.back-to-home {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent-color);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: opacity 0.2s;
}

.back-to-home:hover {
    opacity: 0.8;
}

.tag-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, var(--accent-color) 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tag-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

.tag-posts-section {
    padding: 0 1rem;
}

.tag-posts-section .posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    width: 100%;
}

@media (max-width: 768px) {
    .tag-title {
        font-size: 2rem;
    }
    
    .tag-posts-section .posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Tag Pills (Admin Preview) */
.tag-pill {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--accent-color);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.25rem;
}

/* ========== Trending Badge ========== */
.trending-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, #ff3b30 0%, #ff9500 100%);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
    z-index: 10;
    animation: trendingPulse 2s ease-in-out infinite;
}

@keyframes trendingPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 18px rgba(255, 59, 48, 0.6);
    }
}

.trending-badge .rank {
    font-size: 1rem;
    font-weight: 800;
}

/* ========== Pull to Refresh (Modern) ========== */
.pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pull-refresh-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: var(--bg-card);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border-color);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pull-refresh-indicator.pulling .pull-refresh-content {
    opacity: 1;
    transform: scale(1);
}

.pull-refresh-arrow {
    color: var(--accent-color);
    transition: transform 0.3s ease;
}

.pull-refresh-indicator.ready .pull-refresh-arrow {
    transform: rotate(180deg);
}

.pull-refresh-indicator.refreshing .pull-refresh-arrow {
    animation: refreshSpin 0.8s linear infinite;
}

@keyframes refreshSpin {
    to { transform: rotate(360deg); }
}

.pull-refresh-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.pull-refresh-indicator.ready .pull-refresh-text {
    color: var(--accent-color);
}

.pull-refresh-indicator.refreshing .pull-refresh-text {
    color: var(--accent-color);
}

/* ========== Tag Page Styles ========== */
.tag-header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08) 0%, rgba(88, 86, 214, 0.05) 100%);
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
}

.tag-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.tag-header .post-count {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
    margin-bottom: 1.5rem;
}

.back-button:hover {
    background: var(--bg-secondary);
    transform: translateX(-3px);
    color: var(--text-primary);
}

/* ========== Trending Page Styles ========== */
.trending-hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.1) 0%, rgba(255, 149, 0, 0.08) 100%);
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.trending-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(circle, rgba(255, 59, 48, 0.15) 0%, transparent 70%);
    animation: heroGlow 4s ease-in-out infinite;
}

@keyframes heroGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.trending-hero h1 {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ff3b30 0%, #ff9500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.trending-hero p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-top: 0.75rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination button {
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    min-width: 44px;
}

.pagination button:hover:not(:disabled) {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.pagination button.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========== Mobile Optimizations ========== */
@media (max-width: 640px) {
    .trending-badge {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
        gap: 0.25rem;
    }
    
    .tag-header h1 {
        font-size: 2rem;
    }
    
    .trending-hero h1 {
        font-size: 2.25rem;
    }
    
    .preview-counter {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .long-press-hint {
        font-size: 0.6875rem;
        padding: 0.375rem 0.75rem;
    }
}
/* ========== Enhanced Touch & Interaction UX ========== */

/* Smooth press feedback for touchable elements */
.post-card,
.btn,
.reaction-btn,
.slider-nav,
.slider-dot,
.category-btn,
.nav-item {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Active state for touch feedback */
.post-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.btn:active,
.reaction-btn:active,
.category-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Smooth page transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(10px);
}

.page-transition-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Image loading states */
.media-loading-container {
    position: relative;
    background: var(--bg-tertiary);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Smoother scrolling on iOS */
.posts-container,
.slider-container,
.comments-section {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Better focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .content-fade-in,
    .animate-fadeIn,
    .animate-fadeInUp {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Pull-to-refresh indicator style */
.pull-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--bg-card);
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.pull-indicator.visible {
    transform: translateX(-50%) translateY(0);
}

.pull-indicator .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Toast notifications improvements */
.toast {
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Card hover effects for desktop */
@media (hover: hover) and (pointer: fine) {
    .post-card {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .post-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }
    
    .reaction-btn:hover {
        transform: scale(1.1);
        background: var(--bg-secondary);
    }
}

/* Safe area insets for modern phones with notches */
.main-content {
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

.header {
    padding-top: env(safe-area-inset-top, 0);
}

.bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Optimized image rendering */
.post-card-media img,
.slider-item img,
.media-slide img {
    image-rendering: -webkit-optimize-contrast;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Smooth skeleton loading pulse */
@keyframes skeletonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton-pulse {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

/* Better modal animations */
.modal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal:not(.hidden) .modal-content {
    transform: translateY(0) scale(1);
}

/* Loading button state */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
}

/* ============= Scroll to Top Button ============= */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 90;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 122, 255, 0.45);
}

.scroll-to-top:active {
    transform: scale(0.92);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}
