:root {
    --org-primary: #1E3A8A;
    --org-primary-light: #3B82F6;
    --org-bg-main: #F0F2F5;
    /* Social feed background */
    --org-bg-card: #FFFFFF;
    --org-border: #E4E6EB;
    --org-text-main: #1C1E21;
    --org-text-muted: #65676B;
    --org-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 8px 16px rgba(0, 0, 0, .1);
    --org-radius: 12px;
    --transition-speed: 0.4s;
}

/* Eye-Protection Dark Mode */
[data-theme="dark"] {
    --org-bg-main: #121212;
    --org-bg-card: #1E1E1E;
    --org-border: #333333;
    --org-text-main: #E4E6EB;
    --org-text-muted: #B0B3B8;
    --org-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        color var(--transition-speed) ease;
}

body {
    background-color: var(--org-bg-main);
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--org-text-main);
    line-height: 1.4;
}

/* ── Navbar ── */
.navbar {
    background: var(--org-bg-card);
    border-bottom: 1px solid var(--org-border);
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1);
}

.navbar.nav-hidden {
    transform: translateY(-100%);
}

.nav-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.search-container {
    background: var(--org-bg-main);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-container input {
    background: none;
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--org-text-main);
}

.search-container:focus-within {
    background: var(--org-bg-card);
    box-shadow: 0 0 0 2px var(--org-primary-light);
}

/* ── Elite Navbar (Desktop) Redesign ── */
.main-header-desktop {
    background: #FFFFFF;
    padding: 1.5rem 0 0 0;
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 1000;
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-header-desktop.nav-hidden, .navbar.nav-hidden {
    transform: translateY(-100%) !important;
}

.nav-tier-top {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem 1.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.nav-tier-bottom {
    background: #3D3D3D;
    padding: 0.8rem 0;
}

@media (max-width: 1024px) {
    .nav-tier-bottom {
        display: none !important;
    }
}

.nav-links-center {
    display: flex;
    justify-content: center;
    gap: 3.5rem;
}

.elite-logo-img {
    height: 75px;
    width: auto;
    object-fit: contain;
    display: block;
}

.elite-socials {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
}

.elite-link {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    opacity: 0.9;
}

.elite-link:hover,
.elite-link.active {
    color: #FFFFFF;
    opacity: 1;
}

.elite-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #FFFFFF;
    transition: width 0.3s ease;
}

.elite-link:hover::after,
.elite-link.active::after {
    width: 100%;
}

.social-icon {
    color: #3D3D3D;
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
    color: #000000;
}

.mobile-only-toggle {
    display: none;
    background: none;
    border: none;
    color: #1E293B;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .header-right {
        display: none;
    }

    .mobile-only-toggle {
        display: block;
    }

    .nav-content-elite {
        padding: 0 1rem;
    }
}

.search-highlight {
    background: rgba(59, 130, 246, 0.2);
    color: var(--org-primary-light);
    padding: 0 2px;
    border-radius: 2px;
}

/* ── Theme Toggle Button ── */
.theme-toggle {
    background: var(--org-bg-main);
    border: 1px solid var(--org-border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--org-primary-light);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}

[data-theme="dark"] .ti-sun {
    display: block;
}

[data-theme="dark"] .ti-moon {
    display: none;
}

.ti-sun {
    display: none;
}

.ti-moon {
    display: block;
}

/* ── Feed Layout (X.com Style) ── */
.feed-layout {
    max-width: 1250px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 275px minmax(0, 600px) 350px;
    gap: 0;
    padding: 0;
}

.feed-content {
    border-left: 1px solid var(--org-border);
    border-right: 1px solid var(--org-border);
    min-height: 100vh;
    padding-bottom: 5rem;
}

.sticky-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--org-border);
    padding: 1rem;
    z-index: 100;
    transition: background-color var(--transition-speed) ease;
}

[data-theme="dark"] .sticky-header {
    background: rgba(18, 18, 18, 0.85);
}

/* ── Sidebars ── */
.sidebar-sticky {
    position: sticky;
    top: 5rem;
    height: fit-content;
}

.sidebar-card {
    background: transparent;
    border-radius: var(--org-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    /* X uses slightly darker/lighter background for trending box */
    background: var(--org-bg-main); 
}

/* ── Social Feed Cards (X.com Style) ── */
.post-card {
    background: transparent;
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--org-border);
    transition: background 0.2s;
    cursor: pointer;
}

.post-card:hover {
    transform: none;
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .post-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.post-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-author-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--org-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.post-header-info {
    flex: 1;
}

.post-author-name {
    font-weight: 700;
    font-size: 0.95rem;
    display: block;
}

.post-meta {
    font-size: 0.8rem;
    color: var(--org-text-muted);
}

.post-body {
    padding: 0.5rem 1rem 1rem;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.post-text {
    font-size: 0.95rem;
    color: var(--org-text-main);
    margin-bottom: 1rem;
}

.post-media {
    width: 100%;
    height: 300px;
    background: var(--org-bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ── Interaction Bar ── */
.post-stats {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--org-border);
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--org-text-muted);
}

.post-actions {
    padding: 0.25rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--org-text-muted);
    transition: background 0.2s;
}

.action-btn:hover {
    background: var(--org-bg-main);
}

.action-btn.active-like {
    color: #EC4899;
}

.action-btn.active-bookmark {
    color: #3B82F6;
}

/* ── Badges ── */
.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.badge-tech {
    background: #E0E7FF;
    color: #4338CA;
}

.badge-design {
    background: #FCE7F3;
    color: #BE185D;
}

/* ── Filters (X.com Nav Style) ── */
.filter-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.filter-item {
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--org-text-main);
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.filter-item i {
    font-size: 1.75rem;
}

.filter-item:hover {
    background: rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .filter-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.filter-item.active {
    font-weight: 700;
    background: transparent;
    color: var(--org-text-main);
}

/* ── Toasts ── */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 2000;
}

.toast {
    background: var(--org-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    box-shadow: var(--org-shadow);
    animation: slideUp 0.3s ease;
}

/* ── Post Modal (Single Post View) ── */
.post-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 3000;
    overflow-y: auto;
    padding: 2rem 1rem;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--org-bg-card);
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--org-radius);
    position: relative;
    box-shadow: var(--org-shadow);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--org-bg-main);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--org-text-main);
    z-index: 10;
}

.modal-body {
    padding: 2.5rem;
}

.modal-featured-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--org-radius) var(--org-radius) 0 0;
}

.modal-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.modal-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--org-text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--org-border);
}

.post-full-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--org-text-main);
}

.post-full-text p {
    margin-bottom: 1.5rem;
}

/* ── FAQ Section ── */
.faq-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--org-bg-main);
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid var(--org-border);
    border-radius: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 1rem;
    background: var(--org-bg-main);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    padding: 1rem;
    display: none;
    background: var(--org-bg-card);
    line-height: 1.6;
}

/* ── Comments Mockup ── */
.comments-section {
    margin-top: 3rem;
    background: var(--org-bg-main);
    padding: 2rem;
    border-radius: var(--org-radius);
}

.comment-input-area {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.comment-input {
    flex: 1;
    background: var(--org-bg-card);
    border: 1px solid var(--org-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    outline: none;
}

/* ── Related Posts ── */
.related-section {
    margin-top: 3rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.related-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.related-item:hover {
    transform: scale(1.02);
}

.related-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.related-title {
    font-size: 0.9rem;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* ── Mobile Navigation & Responsive ── */
.blog-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--org-bg);
    border-top: 1px solid var(--org-border);
    padding: 0.6rem 0;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.blog-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--org-text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
}

.blog-nav-item.active {
    color: var(--org-primary);
}

.blog-nav-item i {
    font-size: 1.3rem;
}

#mobileCategoryToggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--org-text);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .sidebar-left {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 260px;
        z-index: 2000;
        background: var(--org-bg);
        transition: left 0.3s ease;
        padding: 1.5rem !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        display: block !important;
    }

    .sidebar-left.active {
        left: 0;
    }

    .feed-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
        padding-bottom: 5rem;
    }

    .sidebar-right {
        display: none;
    }

    .blog-bottom-nav {
        display: flex;
    }

    #mobileCategoryToggle {
        display: block;
    }

    /* Full-screen Modal for Mobile */
    .post-modal {
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        background: var(--org-bg-card);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        box-shadow: var(--org-shadow);
    }
}

@media (max-width: 480px) {
    .navbar .search-container {
        display: none;
    }

    .main-feed {
        padding: 0;
    }
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
}

.mobile-overlay.active {
    display: block;
}

/* ── Mobile Search Overlay ── */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--org-bg);
    z-index: 2500;
    display: none;
    flex-direction: column;
    padding: 1.5rem;
    animation: slideUp 0.3s ease;
}

.search-overlay.active {
    display: flex;
}

.search-overlay-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-overlay-input {
    flex: 1;
    background: var(--org-bg-card);
    border: 1px solid var(--org-border);
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.1rem;
    color: var(--org-text);
    outline: none;
}

.search-overlay-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--org-text-muted);
    cursor: pointer;
}