:root {
    /* Layout Dimensions */
    --sidebar-width: 280px;
    --header-height: 70px;

    /* Modern Theme Base - Glass 3.0 */
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-light: rgba(99, 102, 241, 0.1);
    --primary-hover: #4f46e5;

    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-highlight: rgba(255, 255, 255, 0.8);

    /* Elegant Depth Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 30px 60px -20px rgba(99, 102, 241, 0.2);

    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
}

[data-bs-theme="dark"] {
    --primary-color: #818cf8;
    --primary-light: rgba(129, 140, 248, 0.15);
    --primary-hover: #6366f1;

    --glass-bg: rgba(15, 12, 28, 0.8);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.04);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 16px 40px rgba(129, 140, 248, 0.15);
}

/* Telegram Web App Native Integration overrides */
body.tg-web-app {
    /* Map Telegram theme params to Bootstrap/App core variables */
    --bs-body-bg: var(--tg-theme-bg-color, #ffffff);
    --bs-body-color: var(--tg-theme-text-color, #000000);
    --bs-secondary-color: var(--tg-theme-hint-color, #999999);
    --bs-secondary-bg: var(--tg-theme-secondary-bg-color, #f4f4f5);
    --primary-color: var(--tg-theme-button-color, #2481cc);

    /* Make glass elements slightly more transparent in TG environment to let native background bleed through nicely */
    --glass-bg: color-mix(in srgb, var(--tg-theme-bg-color) 75%, transparent);
}

[data-bs-theme="dark"] body.tg-web-app {
    --glass-bg: color-mix(in srgb, var(--tg-theme-bg-color) 65%, transparent);
}

/* TWA Immersive Layout Overrides */
html.is-twa .sidebar {
    display: none !important;
}

html.is-twa .main-content {
    margin-left: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

html.is-twa .app-header {
    left: 0 !important;
    width: 100% !important;
    border-radius: 0 !important;
}

html.is-twa .btb {
    background: var(--tg-theme-secondary-bg-color, var(--glass-bg));
    backdrop-filter: blur(20px);
}


/* Global Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Page Transitions */
@keyframes slideInRight {
    from {
        transform: translateX(18px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-18px);
        opacity: 0;
    }
}

.page-enter {
    animation: slideInRight 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.page-exit {
    animation: slideOutLeft 0.22s cubic-bezier(0.4, 0, 1, 1) both;
    pointer-events: none;
}

/* Page Transitions (Back Direction) */
@keyframes slideInLeft {
    from {
        transform: translateX(-18px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(18px);
        opacity: 0;
    }
}

.page-enter-back {
    animation: slideInLeft 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.page-exit-back {
    animation: slideOutRight 0.22s cubic-bezier(0.4, 0, 1, 1) both;
    pointer-events: none;
}

html,
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    /* Soft mesh gradient background */
    background: radial-gradient(circle at top left, rgba(235, 229, 255, 0.3) 0%, transparent 40%),
        radial-gradient(circle at bottom right, rgba(200, 230, 255, 0.2) 0%, transparent 40%),
        var(--bs-body-bg);
    background-attachment: fixed;
    color: var(--bs-body-color);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
    width: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Aurora Hero Section */
.hero-section {
    position: relative;
    padding: 5rem 1.5rem;
    margin: -1.5rem -1.5rem 3rem -1.5rem;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-aurora {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.5;
}

.aurora-blob {
    position: absolute;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    will-change: transform, filter;
    animation: aurora-float 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.aurora-1 {
    background: #6366f1;
    top: 10%;
    left: 10%;
}

.aurora-2 {
    background: #a855f7;
    top: 20%;
    right: 10%;
    animation-delay: -5s;
}

.aurora-3 {
    background: #ec4899;
    bottom: 10%;
    left: 20%;
    animation-delay: -10s;
}

@keyframes aurora-float {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    100% {
        transform: translate(15%, 15%) rotate(90deg) scale(1.2);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    width: 100%;
}

.hero-search-container {
    max-width: 680px;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

@media (max-width: 576px) {
    .hero-search-container {
        padding: 0 1.25rem;
    }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    font-weight: 400;
}

.hero-search-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-search-glass:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

.hero-search-input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    flex-grow: 1;
    outline: none !important;
}

.hero-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.hero-search-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 1rem 2.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

.hero-search-btn:hover {
    background: var(--primary-hover);
    transform: translateX(2px);
}

[id] {
    scroll-margin-top: calc(var(--header-height) + 20px);
}


[data-bs-theme="dark"] body {
    background: radial-gradient(circle at top left, rgba(93, 63, 211, 0.08) 0%, transparent 40%),
        var(--bs-body-bg);
    background-attachment: fixed;
}

body.tg-web-app {
    /* Pure native background in Telegram */
    background: var(--bs-body-bg) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: margin-left 0.3s ease;
}

@media (min-width: 992px) {
    .main-content {
        margin-left: calc(var(--sidebar-width) + 2rem);
    }
}

.content-wrapper {
    flex-grow: 1;
    padding: 1.5rem;
    margin-top: var(--header-height);
    /* Offset for the fixed top header */
}

/* Sidebar Components */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    align-self: flex-start;
    background-color: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: fixed;
    /* Changed from sticky for absolute stability */
    top: 1rem;
    left: 1rem;
    /* New property for fixed positioning */
    height: calc(100vh - 2rem);
    z-index: 1035;
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1.5rem 1.25rem;
    min-height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    display: flex;
    align-items: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.sidebar-brand .material-symbols-outlined {
    font-size: 1.8rem;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 0.35rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link .material-symbols-outlined {
    font-size: 1.35rem;
    transition: transform 0.2s;
}

.nav-link:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

.nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background-color: var(--bs-border-color);
    margin: 1rem 0.5rem;
    opacity: 0.5;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    transition: background-color 0.2s;
}

.user-profile:hover {
    background-color: var(--bs-secondary-bg);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-info {
    flex-grow: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bs-body-color);
}

.logout-button {
    color: var(--bs-secondary-color);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.logout-button:hover {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-danger);
}

/* App Header (Top Navbar) */
.app-header {
    background-color: var(--glass-bg);
    /* Solid glass background */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: env(safe-area-inset-top, 0px) 1rem;
    min-height: var(--header-height);
    height: var(--header-height);
    flex-shrink: 0;
    position: fixed;
    /* True fixed positioning */
    top: 0;
    right: 0;
    left: 0;
    z-index: 1040;
    /* High enough to stay above nearly everything */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

/* Adjust for the fixed sidebar on desktop */
@media (min-width: 992px) {
    .app-header {
        left: calc(var(--sidebar-width) + 2rem);
        border-bottom-left-radius: 1.5rem;
        /* Optional: matching the glass aesthetic */
        margin-left: 0;
        width: auto;
    }
}

/* Header Search */
.header-search-container {
    flex: 1;
    max-width: 440px;
}

.header-search-input {
    background: var(--bs-tertiary-bg);
    border: 1px solid transparent;
    padding-left: 2.75rem;
    height: 42px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.header-search-input:focus {
    background: var(--bs-body-bg);
    border-color: var(--primary-color);
    box-shadow:
        0 0 0 4px var(--primary-light),
        0 4px 12px rgba(93, 63, 211, 0.1);
}


.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary-color);
    font-size: 1.25rem;
    pointer-events: none;
    transition: color 0.2s;
}

.header-search-input:focus ~ .search-icon {
    color: var(--primary-color);
}

/* Page Title refinement */
.page-title {
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--bs-secondary-color);
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--bs-danger);
    border-radius: 50%;
    border: 2px solid var(--bs-body-bg);
}

.btn-subtle {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
    font-weight: 500;
    border-radius: 2rem;
    padding: 0.45rem 1.2rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-subtle:hover {
    background: var(--bs-secondary-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Modern Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(93, 63, 211, 0.25);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(93, 63, 211, 0.4);
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .btn-primary {
    color: #fff;
}

/* ── Form Controls & Inputs Polish ────────────────── */
.form-control,
.form-select {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.02),
        0 0 0 4px rgba(93, 63, 211, 0.15) !important;
    background-color: var(--bs-body-bg);
}

/* Dark mode inputs deep contrast */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(157, 132, 255, 0.15) !important;
}

/* Checkboxes & Switches */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(93, 63, 211, 0.3);
}

.form-check-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(93, 63, 211, 0.15);
}

[data-bs-theme="dark"] .form-check-input:checked {
    box-shadow: 0 2px 8px rgba(157, 132, 255, 0.3);
}

/* ── Global Button Touch Feedback ─────────────────── */
/* Physical press-down sense on tap/click for all buttons */
.btn {
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.15s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.btn:active {
    transform: scale(0.98) translateY(1px);
    box-shadow: none !important;
}

/* Exclude buttons that have their own active transform */
.btb-fab:active {
    transform: scale(0.94) !important;
}

/* Nav links & icon buttons */
.nav-link:active,
.btn-icon:active,
.btb-item:active {
    opacity: 0.7;
    transform: scale(0.97);
}

/* Glassmorphism 2.0: Dark mode card inner highlight edge */
[data-bs-theme="dark"] .glass-panel,
[data-bs-theme="dark"] .m3-post-card {
    /* Layered border: top-left edge catches ambient light, creating depth */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        /* top inner highlight */
        inset 1px 0 0 rgba(255, 255, 255, 0.03),
        /* left edge subtle light */
        var(--shadow-sm);
    border-color: rgba(255, 255, 255, 0.09);
}

[data-bs-theme="dark"] .glass-panel:hover,
[data-bs-theme="dark"] .m3-post-card:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 1px 0 0 rgba(255, 255, 255, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.35),
        0 12px 36px rgba(157, 132, 255, 0.14);
    border-color: rgba(157, 132, 255, 0.22);
}

.badge {
    padding: 0.5rem 0.9rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

/* Post Card Refinements */
.m3-post-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.m3-post-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 60px -15px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.card-cover-img {
    width: 100%;
    aspect-ratio: 1 / 1; /* Squarer cards in mobile lists often look better */
    border-radius: 1.5rem;
    overflow: hidden;
    margin-bottom: 0.85rem;
    position: relative;
    background: var(--bs-tertiary-bg);
}

@media (min-width: 768px) {
    .card-cover-img {
        aspect-ratio: 3 / 2;
    }
}

.card-badges-overlay {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 2;
}

.overlay-badge-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.overlay-badge {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    color: #1a1a1a;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 0.9rem;
    border-radius: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: none;
    width: fit-content;
}

.verification-icon-badge {
    background: #ffc107; /* Material Gold */
    color: #000;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.verification-icon-badge .material-symbols-outlined {
    font-size: 18px;
    font-variation-settings: 'FILL' 1;
}

.m3-post-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.m3-post-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--bs-body-color);
}

.badge.bg-warning.text-dark {
    background: #ffc107 !important;
    color: #000 !important;
    font-weight: 700;
    padding: 0.6rem 1rem;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.card-divider {
    height: 1px;
    background: var(--bs-border-color-translucent);
    margin: 0.25rem 0;
    opacity: 0.5;
}

.m3-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
}

.m3-post-price {
    color: #5865f2; /* Premium Blurple */
    font-weight: 800;
    font-size: 1.2rem;
    font-family: 'Outfit';
}

.m3-post-time {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
}

/* Detail Page Containers */
.info-tile {
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.detail-description {
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--bs-body-color);
    letter-spacing: 0.5px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* Skeleton 3.0 Loading */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(var(--bs-emphasis-color-rgb), 0.03) 25%,
            rgba(var(--bs-emphasis-color-rgb), 0.08) 50%,
            rgba(var(--bs-emphasis-color-rgb), 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.dark-theme .skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
}

.skeleton-text {
    width: 100%;
    height: 0.875rem;
    margin-bottom: 0.75rem;
}

.skeleton-title {
    height: 2.5rem;
    width: 80%;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
}

.skeleton-card {
    height: 180px;
    border-radius: 1.25rem;
}

/* ── Premium Details Page Components ────────────────── */
.info-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-tile {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none !important;
    color: inherit;
}

.info-tile:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.info-tile .tile-icon {
    font-size: 1.25rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.info-tile .tile-label {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
}

.info-tile .tile-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bs-body-color);
    font-family: 'Outfit';
}

/* Author Identity Card */
.author-identity-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 1.25rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.author-identity-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.author-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--glass-bg);
    box-shadow: var(--shadow-sm);
}

.author-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--primary-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid var(--glass-bg);
}

.author-info {
    flex-grow: 1;
    min-width: 0;
}

.author-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-body-color);
}

.author-meta {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
}

/* Post Action Bar */
.post-action-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2.5rem;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
}

/* ── Bottom Tab Bar ─────────────────────────────────── */
.btb {
    display: none;
    /* Hidden by default, shown on mobile via media query */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 1040;
    align-items: center;
    justify-content: space-around;
}

.btb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--bs-secondary-color);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.15s ease;
    padding: 0;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.btb-item:active {
    transform: scale(0.9);
}

.btb-item.active,
.btb-item:hover {
    color: var(--primary-color);
}

.btb-icon {
    font-size: 1.5rem;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btb-item.active .btb-icon {
    font-variation-settings: 'FILL' 1;
    /* Filled icon when active */
}

.btb-item:hover .btb-icon,
.btb-item.active .btb-icon {
    transform: scale(1.1) translateY(-1px);
}

.btb-label {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1;
}

/* FAB: Center "publish" button */
.btb-fab {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(93, 63, 211, 0.45);
    margin-top: -20px;
    /* Float above the bar */
    position: relative;
    top: -4px;
    flex-direction: row;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btb-fab:hover {
    background: var(--primary-hover) !important;
    box-shadow: 0 8px 20px rgba(93, 63, 211, 0.6);
    transform: scale(1.05) translateY(-2px);
}

.btb-fab .btb-icon {
    font-size: 1.75rem;
}

[data-bs-theme="dark"] .btb-fab {
    color: #fff !important;
}

/* Mobile & Responsive Layout */
@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }

    .sidebar.active,
    .offcanvas-body .sidebar {
        display: flex;
        width: 100%;
        height: 100%;
        position: static;
        border-right: 0;
    }

    /* Hide hamburger menu - replaced by bottom tab bar */
    .btn-icon.d-lg-none {
        display: none !important;
    }

    .app-header {
        position: fixed;
        width: 100%;
        min-height: calc(56px + env(safe-area-inset-top, 0px));
        height: auto;
        padding-top: env(safe-area-inset-top, 0px);
        z-index: 1030;
    }

    .content-wrapper {
        margin-top: calc(56px + env(safe-area-inset-top, 0px));
        padding: 0.75rem 0;
        /* Leave room for bottom tab bar + iOS safe area */
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 12px) + 1rem);
        overflow-x: hidden;
    }

    .content-wrapper>.container,
    .content-wrapper>.container-fluid {
        padding-left: 0;
        padding-right: 0;
        overflow-x: hidden;
    }

    /* Prevent Bootstrap .row from pulling content outside of padding-less container */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .row>* {
        padding-left: 0.75rem !important;
        /* Restore equivalent of g-3 padding for columns */
        padding-right: 0.75rem !important;
    }

    .card,
    .m3-post-card {
        border-radius: 1rem;
        margin-bottom: 0.5rem;
    }

    /* Item 4: Responsive card cover height */
    .m3-post-card .card-cover-img {
        height: 140px;
    }

    /* Item 5: Filter bar — keep original 2-col wrap grid */
    .glass-panel .row.g-2 {
        flex-wrap: wrap;
        overflow-x: visible;
    }
    .glass-panel .row.g-2 > [class*="col-6"] {
        flex: initial;
        width: auto;
        min-width: auto;
    }

    /* Item 6: Info tile always 2-col on mobile */
    .info-tile-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }

    /* Item 7: Interaction bar full width on mobile */
    .interaction-bar {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        border-radius: 1rem;
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .interaction-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.82rem;
    }

    /* Show Bottom Tab Bar on mobile */
    .btb {
        display: flex;
    }

    /* Update bottom padding for taller tab bar */
    .content-wrapper {
        padding-bottom: calc(68px + env(safe-area-inset-bottom, 12px) + 1rem);
    }
}

/* --- M3 Style Post Card - Global Standard --- */
.m3-post-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 1.25rem;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.m3-post-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

[data-bs-theme="dark"] .m3-post-card {
    background: rgba(20, 17, 40, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .m3-post-card:hover {
    background: rgba(30, 25, 55, 0.9);
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: 0 16px 36px rgba(129, 140, 248, 0.12);
}

/* Fix 8: Mobile filter select text size */
@media (max-width: 576px) {
    .form-select.form-select-sm {
        font-size: 0.78rem;
        padding-left: 0.5rem;
    }
}


.m3-post-card .card-cover-img {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
}

.m3-post-card .card-cover-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.m3-post-card:hover .card-cover-img img {
    transform: scale(1.08);
}

/* Badges Overlay on Image */
.card-badges-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.overlay-badge {
    background: rgba(255, 255, 255, 0.75);
    color: #1a1a1a !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 2rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 2px;
}

[data-bs-theme="dark"] .overlay-badge {
    background: rgba(0, 0, 0, 0.5);
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Card Content Area */
.m3-post-content {
    padding: 0.85rem 1rem !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.m3-post-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--bs-emphasis-color);
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.m3-post-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color-translucent);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.m3-post-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.m3-post-time {
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Post Status Badge (for Profile) */
.post-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
}

/* Animation */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Toast Entry Animation */
.animate-fade-in-up {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Modal Styling Improvements */
.modal-backdrop.show {
    backdrop-filter: blur(6px) saturate(180%);
    -webkit-backdrop-filter: blur(6px) saturate(180%);
    opacity: 0.6 !important;
}

.modal-content {
    border: 1px solid var(--glass-border);
    background-color: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow-hover);
}

/* ── Progressive Image Loading (Blur-up) ───────────── */
.progressive-img-container {
    position: relative;
    overflow: hidden;
    background-color: var(--bs-secondary-bg);
}

.img-blur {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(15px);
    transform: scale(1.1);
    /* Prevent white edges from blur */
    transition: opacity 0.4s ease-out;
    z-index: 1;
}

.img-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.progressive-img-container.is-loaded .img-full {
    opacity: 1;
}

.progressive-img-container.is-loaded .img-blur {
    opacity: 0;
}

/* ── Hot Tags & Regions ─────────────────────────── */
.hot-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    background: var(--primary-light);
    border: 1.5px solid transparent;
    border-radius: 50rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hot-tag-pill:hover {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px) scale(1.05);
}

.hot-tag-pill.active {
    background: var(--primary-color);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sidebar-widget {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Outfit';
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

/* Post Details Elite Components */
.info-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.info-tile {
    background: rgba(var(--bs-primary-rgb), 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.info-tile:hover {
    background: rgba(var(--bs-primary-rgb), 0.06);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.tile-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.tile-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    font-weight: 600;
}

.tile-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Outfit';
    color: var(--bs-emphasis-color);
}

.section-separator {
    height: 1px;
    background: linear-gradient(to right, var(--glass-border), transparent);
    margin: 2.5rem 0;
    opacity: 0.5;
}

.interaction-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    width: fit-content;
    margin: 2rem auto;
    box-shadow: var(--shadow-sm);
}

[data-bs-theme="dark"] .interaction-bar {
    background: rgba(0, 0, 0, 0.2);
}

.interaction-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 100px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--bs-secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.interaction-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--bs-body-color);
}

.interaction-btn.active-primary {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.3);
}

.interaction-btn.active-warning {
    background: #ffc107;
    color: #000;
    border-color: #ffc107;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.interaction-btn.active-danger {
    background: var(--bs-danger);
    color: #fff;
    border-color: var(--bs-danger);
    box-shadow: 0 4px 12px rgba(var(--bs-danger-rgb), 0.3);
}

.interaction-divider {
    width: 1px;
    height: 24px;
    background: var(--glass-border);
    margin: 0 0.25rem;
}

.sidebar-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

/* Sticky Sidebar Utility */
.sticky-sidebar-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: fit-content;
    align-self: flex-start;
    z-index: 1000;
}

.sidebar-list-item:hover {
    background: var(--primary-light);
    transform: translateX(4px);
}

.sidebar-list-item .item-index {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
}

.sidebar-list-item .item-img {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.sidebar-list-item .item-content {
    flex-grow: 1;
    min-width: 0;
}

.sidebar-list-item .item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bs-body-color);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.sidebar-list-item:hover .item-title {
    color: var(--primary-color);
}

.sidebar-list-item .item-meta {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.hot-tag-label {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
}

/* Sticky Sidebar Wrapper (Right Sidebar) */
.sticky-sidebar-wrapper {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    /* Stick below header */
    z-index: 1010;
    transition: all 0.3s ease;
}

/* Ensure parents don't break stickiness in grid */
.col-lg-4,
.col-lg-3 {
    display: flex;
    flex-direction: column;
}