/**
 * InstaPlus - Official Instagram UI Stylesheet
 * Supports Dark & Light Modes, RTL Persian & LTR, Mobile & Desktop
 */

:root {
    --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --insta-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --insta-blue: #0095f6;
    --insta-blue-hover: #1877f2;
    --insta-like: #ed4956;
}

/* ----------------------------------------------------
   DARK THEME (Default)
   ---------------------------------------------------- */
body.insta-dark {
    --bg-primary: #000000;
    --bg-secondary: #121212;
    --bg-card: #1c1c1c;
    --bg-hover: rgba(255, 255, 255, 0.08);
    --border-color: #262626;
    --border-subtle: #363636;
    --text-primary: #f5f5f5;
    --text-secondary: #a8a8a8;
    --text-muted: #737373;
    --btn-secondary-bg: #363636;
    --btn-secondary-text: #ffffff;
    --btn-secondary-hover: #262626;
    --modal-backdrop: rgba(0, 0, 0, 0.85);
    --input-bg: #121212;
}

/* ----------------------------------------------------
   LIGHT THEME
   ---------------------------------------------------- */
body.insta-light {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-card: #ffffff;
    --bg-hover: rgba(0, 0, 0, 0.05);
    --border-color: #dbdbdb;
    --border-subtle: #efefef;
    --text-primary: #262626;
    --text-secondary: #737373;
    --text-muted: #8e8e8e;
    --btn-secondary-bg: #efefef;
    --btn-secondary-text: #000000;
    --btn-secondary-hover: #dbdbdb;
    --modal-backdrop: rgba(0, 0, 0, 0.65);
    --input-bg: #fafafa;
}

/* ----------------------------------------------------
   GLOBAL RESETS
   ---------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

img, video {
    display: block;
    max-width: 100%;
}

.insta-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}

.insta-hashtag, .insta-mention {
    color: var(--insta-blue);
    direction: ltr;
    display: inline-block;
}

/* ----------------------------------------------------
   MAIN APP LAYOUT (Instagram Desktop & Mobile)
   ---------------------------------------------------- */
.insta-app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ----------------------------------------------------
   DESKTOP SIDEBAR (Closed 72px by default, Expand on Hover)
   ---------------------------------------------------- */
.insta-sidebar {
    width: 72px;
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    border-left: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.22s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.22s ease;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Expand smoothly on hover to reveal text labels */
.insta-sidebar:hover {
    width: 220px;
    box-shadow: -4px 0 28px rgba(0, 0, 0, 0.08);
}

.insta-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.insta-logo-wrap {
    padding: 10px 10px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 48px;
}

.insta-brand-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.insta-brand-link:hover {
    transform: scale(1.08);
}

.insta-brand-camera-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insta-brand-camera-icon svg {
    width: 26px;
    height: 26px;
    color: var(--text-primary);
    stroke-width: 2;
    display: block;
}

.insta-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    margin-top: 6px;
}

/* Nav items - strictly NO background color on hover ("رنگ بک نمیخواد") */
.insta-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 8px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    background: transparent !important;
    background-color: transparent !important;
    white-space: nowrap;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.insta-nav-item:hover {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary);
    transform: scale(1.05);
}

.insta-nav-item.active {
    font-weight: 700;
}

.insta-nav-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-avatar-mini {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* In closed state: labels are hidden. On sidebar hover: labels fade in */
.insta-nav-label {
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    white-space: nowrap;
}

.insta-sidebar:hover .insta-nav-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.insta-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.insta-theme-switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    background: transparent !important;
}

.theme-switch-text {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.insta-sidebar:hover .theme-switch-text {
    opacity: 1;
    visibility: visible;
}

/* Theme Toggle Button Icons */
body.insta-dark .icon-sun { display: inline-block; }
body.insta-dark .icon-moon { display: none; }
body.insta-light .icon-sun { display: none; }
body.insta-light .icon-moon { display: inline-block; }

/* ----------------------------------------------------
   MAIN CONTENT WRAPPER
   ---------------------------------------------------- */
.insta-main-content {
    flex: 1;
    margin-right: 72px;
    min-height: 100vh;
    padding: 20px 24px 60px;
    display: flex;
    justify-content: center;
}

.insta-profile-wrapper {
    width: 100%;
    max-width: 1350px;
}

.insta-single-post-wrapper {
    width: 100%;
    max-width: 935px;
}

/* MOBILE TOP HEADER */
.insta-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.mobile-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 17px;
}

.mobile-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-icon-btn {
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

/* MOBILE BOTTOM NAV */
.insta-mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-around;
    z-index: 100;
}

.mobile-nav-item {
    color: var(--text-primary);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

/* ----------------------------------------------------
   PROFILE HEADER SECTION (Centered Instagram Desktop Layout)
   ---------------------------------------------------- */
.insta-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 auto 20px;
}

.profile-header-main {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 40px;
    width: 100%;
    max-width: 650px;
}

.profile-avatar-column {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-ring-container {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

.avatar-ring-container.has-active-story {
    background: var(--insta-gradient);
    border: none;
    padding: 3px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.avatar-ring-container.has-active-story:hover {
    transform: scale(1.03);
}

.avatar-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--bg-primary);
    padding: 3px;
    overflow: hidden;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.story-badge-pulse {
    position: absolute;
    bottom: 6px;
    left: 6px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background-color: #00d26a;
    border: 2px solid var(--bg-primary);
}

.profile-details-column {
    flex: 1;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profile-row-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.profile-username {
    font-size: 20px;
    font-weight: 600;
    direction: ltr;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.profile-verified-badge {
    display: flex;
    align-items: center;
}

.insta-badge-verified {
    width: 18px;
    height: 18px;
    color: var(--insta-blue);
}

.btn-profile-icon {
    color: var(--text-primary);
    padding: 4px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.btn-profile-icon svg {
    width: 20px;
    height: 20px;
}

/* FULL NAME / TAGLINE */
.profile-full-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin: 0;
}

/* STATS */
.profile-stats-list {
    display: flex;
    gap: 24px;
    list-style: none;
    font-size: 14px;
    margin: 2px 0;
    padding: 0;
}

.stat-item {
    display: flex;
    gap: 5px;
    align-items: baseline;
}

.stat-num {
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-primary);
    font-weight: 400;
}

.mobile-stats {
    display: none;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    margin-bottom: 14px;
    justify-content: space-around;
}

/* BIO */
.profile-bio-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13.5px;
    line-height: 1.35;
    margin-top: 2px;
}

.profile-category {
    color: var(--text-secondary);
    font-size: 12.5px;
    margin-bottom: 1px;
}

.profile-bio-text {
    white-space: pre-line;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.38;
}

.profile-website-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--insta-blue);
    direction: ltr;
    justify-content: flex-end;
    margin-top: 2px;
}

.profile-website-link svg {
    width: 14px;
    height: 14px;
}

/* ====================================================
   ENAMAD TRUST SEAL BADGE
   ==================================================== */
.profile-bio-layout {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.profile-bio-text-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-enamad-wrapper {
    flex-shrink: 0;
    align-self: flex-start;
}

.enamad-badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 6px 10px 6px;
    text-decoration: none !important;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    min-width: 84px;
    text-align: center;
}

body.insta-dark .enamad-badge-card {
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.enamad-badge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 149, 246, 0.2);
    border-color: var(--insta-blue);
}

.enamad-img-wrap,
.enamad-code-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 64px;
}

.enamad-code-inner a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    line-height: 0;
}

.enamad-img,
.enamad-code-inner img {
    max-width: 58px;
    max-height: 64px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.enamad-badge-title {
    font-size: 9.5px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 3px;
    white-space: nowrap;
    line-height: 1.2;
    display: block;
}

.enamad-badge-subtitle {
    font-size: 8px;
    font-weight: 600;
    color: #0077c8;
    margin-top: 1px;
    white-space: nowrap;
    line-height: 1.2;
    display: block;
}

/* ACTION BUTTONS (FOLLOW & MESSAGE) */
.profile-user-actions-desktop {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-user-actions-desktop .btn-profile-follow,
.profile-user-actions-desktop .btn-profile-secondary {
    flex: none;
    height: 32px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.mobile-bio,
.mobile-actions-bar {
    display: none;
}

.profile-actions-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 14px auto 0;
    width: 100%;
    max-width: 650px;
}

.btn-profile-follow, .btn-profile-secondary {
    flex: 1;
    max-width: 280px;
    height: 32px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-profile-follow {
    background-color: var(--insta-blue);
    color: #ffffff;
}

.btn-profile-follow:hover {
    background-color: var(--insta-blue-hover);
}

.btn-profile-follow.is-following {
    background-color: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

.btn-profile-secondary {
    background-color: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

.btn-profile-secondary:hover {
    background-color: var(--btn-secondary-hover);
}

/* ----------------------------------------------------
   STORY HIGHLIGHTS ROW (Centered Desktop Layout)
   ---------------------------------------------------- */
.insta-highlights-section {
    margin: 0 auto 20px;
    width: 100%;
    padding: 0;
    display: flex;
    justify-content: center;
}

.highlights-scroll-wrapper {
    display: flex;
    justify-content: center;
    gap: 22px;
    overflow-x: auto;
    padding: 6px 12px;
    scrollbar-width: none;
    max-width: 100%;
}

.highlights-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.highlight-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.highlight-item:hover {
    transform: scale(1.05);
}

.highlight-cover-ring {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    padding: 2px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.highlight-cover-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.highlight-cover-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.highlight-title {
    font-size: 11.5px;
    font-weight: 500;
    max-width: 72px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

/* ----------------------------------------------------
   PROFILE TABS (Icon Only Compact View)
   ---------------------------------------------------- */
.insta-profile-tabs {
    direction: rtl; /* RTL order: Grid on right, Reels in middle, Tagged on left */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(50px, 14vw, 130px);
    border-top: none;
    border-bottom: 1px solid var(--border-color);
    margin: 0 auto;
    width: 100%;
}

.profile-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    width: 64px;
    padding: 0;
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    background: transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.profile-tab-btn .tab-btn-text {
    display: none; /* Icon-only tabs matching authentic Instagram desktop */
}

.profile-tab-btn:hover {
    color: var(--text-primary);
}

.profile-tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.profile-tab-btn svg {
    width: 22px;
    height: 22px;
}

.insta-tab-pane {
    display: none;
}

.insta-tab-pane.active {
    display: block;
}

/* ----------------------------------------------------
   FEED GRID (5-Columns Square 1:1 on Desktop)
   ---------------------------------------------------- */
/* ----------------------------------------------------
   FEED GRID (Vertical 3:4 Aspect Ratio, 5-Columns on Desktop)
   ---------------------------------------------------- */
.insta-media-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    width: 100%;
}

.grid-card-item {
    position: relative;
    cursor: pointer;
    aspect-ratio: 3 / 4; /* Official Instagram profile vertical aspect ratio */
    background-color: var(--bg-card);
    overflow: hidden;
    border-radius: 2px;
}

.card-media-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}

.card-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.grid-card-item:hover .card-thumb-img {
    transform: scale(1.02);
}

/* Top Right Badge Indicators */
.card-badges-wrap {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.card-badge {
    color: #ffffff;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-badge svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Instagram Hover Overlay */
.card-hover-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 3;
}

.grid-card-item:hover .card-hover-overlay {
    opacity: 1;
}

.overlay-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 700;
    font-size: 17px;
}

.overlay-stat svg {
    width: 22px;
    height: 22px;
}

/* ----------------------------------------------------
   REELS GRID (9:16 Vertical Cards - 5 Columns on Desktop)
   ---------------------------------------------------- */
.insta-reels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
}

.reel-card-item {
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-card);
}

.reel-media-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}

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

.reel-bottom-meta {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.reel-bottom-meta svg {
    width: 18px;
    height: 18px;
}

/* EMPTY STATE */
.insta-empty-state {
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.empty-icon-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.empty-icon-circle svg {
    width: 32px;
    height: 32px;
}

/* ----------------------------------------------------
   POST LIGHTBOX MODAL
   ---------------------------------------------------- */
.insta-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: var(--modal-backdrop);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.insta-modal-backdrop.open {
    display: flex;
    pointer-events: auto;
}

.insta-modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #ffffff;
    z-index: 1010;
    padding: 8px;
    transition: transform var(--transition-fast);
}

.insta-modal-close:hover {
    transform: scale(1.15);
}

.insta-modal-close svg {
    width: 30px;
    height: 30px;
}

/* Circular Arrows for Next / Prev Post Navigation */
.modal-post-nav-circle {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.92);
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1020;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    border: none;
    outline: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, opacity 0.2s ease;
}

.modal-post-nav-circle:hover {
    background-color: #ffffff;
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.modal-post-nav-circle:active {
    transform: translateY(-50%) scale(0.95);
}

.modal-post-nav-circle svg {
    width: 22px;
    height: 22px;
}

/* RTL: Right is Previous post, Left is Next post */
.nav-prev-post {
    right: 24px;
}

.nav-next-post {
    left: 24px;
}

@media (min-width: 1220px) {
    .nav-prev-post {
        right: calc(50% - 525px - 60px);
    }
    .nav-next-post {
        left: calc(50% - 525px - 60px);
    }
}

@media (max-width: 768px) {
    .modal-post-nav-circle {
        width: 36px;
        height: 36px;
    }
    .modal-post-nav-circle svg {
        width: 18px;
        height: 18px;
    }
    .nav-prev-post {
        right: 8px;
    }
    .nav-next-post {
        left: 8px;
    }
}

.insta-post-modal-container {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 1050px;
    height: 85vh;
    max-height: 800px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    position: relative;
    border: 1px solid var(--border-color);
}

/* POP HEART DOUBLE TAP */
.insta-pop-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 50;
    pointer-events: none;
    opacity: 0;
}

.insta-pop-heart svg {
    width: 105px;
    height: 105px;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.65));
}

.insta-pop-heart.animate {
    animation: igHeartPop 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes igHeartPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    18% {
        transform: translate(-50%, -50%) scale(1.25);
        opacity: 0.95;
    }
    35% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 1;
    }
    55% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
    }
    75% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.7) translateY(-25px);
        opacity: 0;
    }
}

/* LEFT: MEDIA CAROUSEL */
.insta-modal-media-col {
    flex: 1.3;
    background-color: #000000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-media-carousel {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide-item {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

.carousel-slide-item.active {
    display: flex;
}

.carousel-slide-item img, .carousel-slide-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    color: #262626;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: background var(--transition-fast);
}

.carousel-arrow:hover {
    background: #ffffff;
}

.carousel-prev { right: 14px; }
.carousel-next { left: 14px; }

.carousel-dots {
    position: absolute;
    bottom: 14px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.carousel-dot.active {
    background-color: #ffffff;
    transform: scale(1.3);
}

/* Modal Media Volume Toggle Button */
.modal-media-volume-btn {
    position: absolute;
    bottom: 14px;
    left: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 12;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.modal-media-volume-btn:hover {
    background-color: rgba(0, 0, 0, 0.85);
    transform: scale(1.08);
}

.modal-media-volume-btn:active {
    transform: scale(0.92);
}

.modal-media-volume-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.modal-media-volume-btn.muted .icon-vol-off { display: block; }
.modal-media-volume-btn.muted .icon-vol-on { display: none; }
.modal-media-volume-btn:not(.muted) .icon-vol-off { display: none; }
.modal-media-volume-btn:not(.muted) .icon-vol-on { display: block; }

/* RIGHT: INFO & COMMENTS */
.insta-modal-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    position: relative;
}

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

.modal-author-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.modal-author-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-author-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-author-name {
    font-weight: 700;
    font-size: 14px;
}

.dot-separator {
    color: var(--text-muted);
}

.btn-modal-follow {
    color: var(--insta-blue);
    font-weight: 700;
    font-size: 13px;
}

.modal-post-location {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-icon-more {
    color: var(--text-primary);
}

/* COMMENTS SCROLL AREA */
.modal-comments-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scrollbar-width: thin;
}

.comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 14px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comment-text-wrap {
    line-height: 1.45;
}

.comment-author {
    font-weight: 700;
    margin-left: 6px;
}

.comment-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ACTIONS BAR */
.modal-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 6px;
    border-top: 1px solid var(--border-color);
}

.actions-left {
    display: flex;
    gap: 16px;
}

.action-btn {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    transition: transform var(--transition-fast);
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn svg {
    width: 24px;
    height: 24px;
}

/* Heart like states */
.btn-like .icon-liked { display: none; }
.btn-like.liked .icon-unliked { display: none; }
.btn-like.liked .icon-liked { display: inline-block; }

/* Bookmark save states */
.btn-save .icon-saved { display: none; }
.btn-save.saved .icon-unsaved { display: none; }
.btn-save.saved .icon-saved { display: inline-block; color: var(--text-primary); }

.modal-likes-box {
    padding: 0 16px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    gap: 4px;
}

.modal-post-time {
    padding: 4px 16px 12px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ADD COMMENT FORM */
.modal-add-comment-form {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.comment-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

.comment-submit-btn {
    color: var(--insta-blue);
    font-weight: 700;
    font-size: 14px;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.comment-submit-btn.ready {
    opacity: 1;
    pointer-events: auto;
}

/* ----------------------------------------------------
   STORY VIEWER MODAL
   ---------------------------------------------------- */
html.story-open,
body.story-open {
    overflow: hidden !important;
}

.insta-story-viewer-backdrop {
    position: fixed;
    inset: 0;
    background-color: #1a1a1a;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    pointer-events: none;
}

.insta-story-viewer-backdrop.open {
    display: flex;
    pointer-events: auto;
}

.story-viewer-container {
    width: 100%;
    max-width: 420px;
    height: 92vh;
    max-height: 840px;
    background-color: #000000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
}

.story-top-vignette {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.25) 65%, transparent 100%);
    z-index: 18;
    pointer-events: none;
}

.story-progress-wrapper {
    position: absolute;
    top: max(12px, env(safe-area-inset-top, 12px));
    left: max(12px, env(safe-area-inset-left, 12px));
    right: max(12px, env(safe-area-inset-right, 12px));
    display: flex;
    gap: 4px;
    z-index: 25;
}

.story-bar-segment {
    flex: 1;
    height: 2.5px;
    background-color: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    overflow: hidden;
}

.story-bar-fill {
    width: 0%;
    height: 100%;
    background-color: #ffffff;
    transition: width linear;
}

.story-viewer-header {
    position: absolute;
    top: calc(max(12px, env(safe-area-inset-top, 12px)) + 12px);
    left: max(12px, env(safe-area-inset-left, 12px));
    right: max(12px, env(safe-area-inset-right, 12px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 25;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.story-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.story-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255,255,255,0.6);
    flex-shrink: 0;
}

.story-header-title {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.story-header-time {
    font-size: 12px;
    opacity: 0.75;
    white-space: nowrap;
    flex-shrink: 0;
}

.story-header-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.story-tool-btn,
.story-viewer-close {
    color: #ffffff;
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.75));
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.story-tool-btn:hover,
.story-viewer-close:hover {
    opacity: 0.85;
    transform: scale(1.08);
}

.story-tool-btn svg,
.story-viewer-close svg {
    width: 20px;
    height: 20px;
}

/* Pause / Play State Toggle */
#btnStoryPausePlay .icon-story-pause {
    display: block;
}
#btnStoryPausePlay .icon-story-play {
    display: none;
}
#btnStoryPausePlay.paused .icon-story-pause {
    display: none;
}
#btnStoryPausePlay.paused .icon-story-play {
    display: block;
}

/* Sound Volume State Toggle */
#btnStoryVolume .icon-sound-on {
    display: block;
}
#btnStoryVolume .icon-sound-off {
    display: none;
}
#btnStoryVolume.muted .icon-sound-on {
    display: none;
}
#btnStoryVolume.muted .icon-sound-off {
    display: block;
}

.story-media-stage {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-media-stage img, .story-media-stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-tap-zone {
    position: absolute;
    top: 50px;
    bottom: 80px;
    width: 45%;
    z-index: 15;
    cursor: pointer;
}
.story-tap-zone.zone-next { left: 0; right: auto; }
.story-tap-zone.zone-prev { right: 0; left: auto; }

.story-bottom-overlay {
    position: absolute;
    bottom: 20px;
    left: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 20;
    color: #ffffff;
}

.story-caption-text {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.4);
    padding: 8px 16px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.story-link-sticker {
    background: #ffffff;
    color: #262626;
    font-weight: 700;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform var(--transition-fast);
}

.story-link-sticker:hover {
    transform: scale(1.05);
}

/* Instagram Story Action Bar: Add to Highlight Button */
.story-viewer-actions {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 25;
}

.story-highlight-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8));
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    padding: 4px;
}

.story-highlight-btn:hover {
    transform: scale(1.08);
}

.story-highlight-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Instagram Highlight Picker Sheet / Modal */
.story-highlight-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.story-highlight-sheet-backdrop.open {
    display: flex;
}

.story-highlight-sheet {
    background: #262626;
    color: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 380px;
    max-height: 82vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    gap: 16px;
    direction: rtl;
}

.story-highlight-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 12px;
}

.story-highlight-sheet-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.story-highlight-close {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    line-height: 1;
}

.story-highlight-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
}

.story-highlight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.story-highlight-item:hover {
    background: rgba(255, 255, 255, 0.14);
}

.story-highlight-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.story-highlight-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    background: #333;
}

.story-highlight-name {
    font-size: 14px;
    font-weight: 600;
}

.story-highlight-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.story-highlight-item.selected .story-highlight-check {
    background: var(--ig-primary);
    border-color: var(--ig-primary);
}

.story-highlight-item.selected .story-highlight-check svg {
    display: block;
}

.story-highlight-check svg {
    display: none;
    width: 14px;
    height: 14px;
    fill: #ffffff;
}

.story-new-highlight-box {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.story-new-highlight-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    direction: rtl;
}

.story-new-highlight-btn {
    background: var(--ig-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* Prevent native mobile context menu / callout on all videos */
video,
.feed-stream-video,
.modal-video-player,
.story-video,
.card-thumb-img,
.reel-thumb-img {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* ----------------------------------------------------
   QUICK SEARCH DRAWER
   ---------------------------------------------------- */
.insta-search-drawer {
    position: fixed;
    top: 0;
    right: 72px;
    bottom: 0;
    width: 380px;
    background-color: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 24px rgba(0,0,0,0.18);
    z-index: 950;
    display: none !important;
    opacity: 0;
    pointer-events: none;
    transform: translateX(30px);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
    padding: 24px 16px;
    flex-direction: column;
}

.insta-search-drawer.open {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.search-box-wrap {
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
}

.search-box-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

.search-results-list {
    margin-top: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-item-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.search-item-result:hover {
    background-color: var(--bg-hover);
}

.search-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
}

.search-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.search-item-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-type {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ----------------------------------------------------
   TOAST NOTIFICATION
   ---------------------------------------------------- */
.insta-toast {
    position: fixed;
    bottom: 30px;
    right: 50%;
    transform: translateX(50%) translateY(100px);
    background-color: #262626;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.insta-toast.show {
    transform: translateX(50%) translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .insta-toast {
        top: 24px;
        bottom: auto;
        transform: translateX(50%) translateY(-80px);
    }
    .insta-toast.show {
        transform: translateX(50%) translateY(0);
        opacity: 1;
    }
}

/* ----------------------------------------------------
   RESPONSIVE DESIGN (Tablets & Mobile)
   ---------------------------------------------------- */
@media (max-width: 1264px) {
    .insta-media-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }
    .insta-reels-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

@media (max-width: 1024px) {
    .insta-sidebar {
        width: 72px !important;
        padding: 12px 6px !important;
    }
    .btn-sidebar-toggle, .insta-nav-label, .theme-switch-text {
        display: none !important;
    }
    .insta-logo-wrap {
        padding: 16px 0;
        justify-content: center;
        text-align: center;
    }
    .insta-nav-item {
        justify-content: center;
        padding: 12px;
        width: 48px;
        height: 48px;
        margin: 0 auto;
        border-radius: 50%;
        gap: 0;
    }
    .insta-theme-switch-row {
        justify-content: center;
        padding: 6px 0;
    }
    .btn-sidebar-toggle-bottom {
        justify-content: center;
        width: 48px;
        height: 48px;
        margin: 0 auto;
        border-radius: 50%;
    }
    .insta-main-content {
        margin-right: 72px !important;
    }
    .insta-search-drawer {
        right: 72px !important;
    }
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw;
    }
    .insta-sidebar {
        display: none !important;
    }
    .insta-mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 52px;
        background-color: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        padding: 0 16px;
        align-items: center;
        justify-content: space-between;
        z-index: 100;
    }
    .insta-mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 50px;
        background-color: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        align-items: center;
        justify-content: space-around;
        z-index: 100;
    }
    .insta-app-layout {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .insta-main-content {
        margin-right: 0 !important;
        padding: 56px 0 60px !important;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
        display: block;
    }
    .insta-profile-wrapper {
        padding: 0 16px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .insta-profile-header {
        width: 100%;
        max-width: 100%;
        margin: 8px 0 12px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    /* Top row: Avatar + Name & Stats */
    .profile-header-main {
        display: flex;
        align-items: center;
        gap: 20px;
        width: 100%;
        max-width: 100%;
        margin-bottom: 14px;
    }
    .profile-avatar-column {
        flex-shrink: 0;
        width: 80px;
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .avatar-ring-container {
        width: 80px;
        height: 80px;
    }
    .profile-details-column {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        max-width: 100%;
    }
    .profile-row-user,
    .desktop-bio,
    .profile-user-actions-desktop {
        display: none !important;
    }
    .profile-full-name {
        font-size: 14px;
        font-weight: 700;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }
    .profile-stats-list {
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .profile-stats-list .stat-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2px;
    }
    .profile-stats-list .stat-num {
        font-size: 16px;
        font-weight: 700;
        color: var(--text-primary);
    }
    .profile-stats-list .stat-label {
        font-size: 12px;
        color: var(--text-primary);
        font-weight: 400;
    }

    /* Bio Box below avatar + stats */
    .mobile-bio {
        display: flex !important;
        flex-direction: column;
        gap: 3px;
        width: 100%;
        margin: 0 0 14px;
        font-size: 13.5px;
        line-height: 1.4;
    }
    .profile-category {
        color: var(--text-secondary);
        font-size: 12.5px;
        font-weight: 600;
    }
    .profile-bio-text {
        color: var(--text-primary);
        font-size: 13.5px;
        line-height: 1.4;
    }
    .profile-website-link {
        display: flex;
        align-items: center;
        gap: 6px;
        font-weight: 600;
        font-size: 13px;
        direction: ltr;
        justify-content: flex-end;
        margin-top: 2px;
    }
    .profile-enamad-wrapper.mobile-enamad .enamad-badge-card {
        min-width: 68px;
        padding: 4px 6px 4px;
        border-radius: 10px;
    }
    .profile-enamad-wrapper.mobile-enamad .enamad-img-wrap,
    .profile-enamad-wrapper.mobile-enamad .enamad-code-inner {
        width: 44px;
        height: 48px;
    }
    .profile-enamad-wrapper.mobile-enamad .enamad-code-inner img {
        max-width: 44px;
        max-height: 48px;
    }
    .profile-enamad-wrapper.mobile-enamad .enamad-badge-title {
        font-size: 8px;
    }
    .profile-translation-link .btn-see-translation {
        background: none;
        border: none;
        padding: 0;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-primary);
        cursor: pointer;
        margin-top: 3px;
        display: inline-block;
    }

    /* Action Buttons (Follow / Message / Suggested) */
    .mobile-actions-bar {
        display: flex !important;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin: 0 0 16px;
        box-sizing: border-box;
    }
    .btn-mobile-follow, .btn-mobile-message {
        flex: 1;
        max-width: none;
        height: 34px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 0 12px;
        box-sizing: border-box;
    }
    .btn-profile-icon-action {
        width: 34px;
        height: 34px;
        border-radius: 8px;
        background: var(--btn-secondary-bg);
        color: var(--btn-secondary-text);
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
    }
    .btn-profile-icon-action svg {
        width: 18px;
        height: 18px;
    }

    /* Highlights Section */
    .insta-highlights-section {
        width: 100%;
        max-width: 100%;
        margin: 0 0 14px;
        overflow: hidden;
    }
    .highlights-scroll-wrapper {
        display: flex;
        justify-content: flex-start;
        gap: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 2px 0 8px;
        max-width: 100%;
    }
    .highlights-scroll-wrapper::-webkit-scrollbar {
        display: none;
    }
    .highlight-item {
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        width: 64px;
    }
    .highlight-cover-ring {
        width: 62px;
        height: 62px;
    }
    .highlight-title {
        font-size: 11px;
        max-width: 64px;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Profile Navigation Tabs */
    .insta-profile-tabs {
        width: 100%;
        display: flex;
        direction: rtl;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        margin: 0 0 2px;
    }
    .profile-tab-btn {
        flex: 1;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        border-bottom: 2px solid transparent;
        background: none;
        color: var(--text-secondary);
        padding: 0;
        cursor: pointer;
    }
    .profile-tab-btn.active {
        color: var(--text-primary);
        border-bottom-color: var(--text-primary);
    }
    .profile-tab-btn .tab-btn-text {
        display: none !important;
    }
    .profile-tab-btn svg {
        width: 24px;
        height: 24px;
    }

    /* Grid & Reels on Mobile */
    .insta-media-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
        width: 100%;
    }
    .card-hover-overlay {
        display: none !important; /* Disable hover on mobile touch */
    }
    .insta-reels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
        width: 100%;
    }

    /* Hide desktop post arrows & carousel arrows on mobile */
    #btnModalPrevPost,
    #btnModalNextPost,
    .modal-post-nav-circle,
    #carouselPrev,
    #carouselNext,
    .carousel-arrow {
        display: none !important;
    }

    /* Modal mobile - Full Screen Edge-to-Edge like Instagram */
    .insta-modal-backdrop {
        padding: 0 !important;
    }
    .insta-post-modal-container {
        flex-direction: column;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    .insta-modal-media-col {
        width: 100vw !important;
        max-width: 100vw !important;
        flex: none !important;
        max-height: 60vh !important;
        border-radius: 0 !important;
    }
    .carousel-slide-item img,
    .carousel-slide-item video,
    .modal-video-player {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        object-fit: cover !important;
        border-radius: 0 !important;
    }
    .insta-modal-info-col {
        flex: 1;
        width: 100vw !important;
        max-width: 100vw !important;
    }

    /* Single Post on Mobile */
    .insta-single-post-wrapper {
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .single-page-container {
        border-radius: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    .single-media-col {
        border-radius: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    .single-media-col video,
    .single-media-col img {
        width: 100vw !important;
        max-width: 100vw !important;
        object-fit: cover !important;
        border-radius: 0 !important;
    }

    /* Story Viewer on Mobile - Fullscreen and Flush Top Alignment */
    .insta-story-viewer-backdrop {
        padding: 0 !important;
        align-items: flex-start !important;
        justify-content: center !important;
        height: 100% !important;
        height: 100dvh !important;
        width: 100% !important;
        width: 100vw !important;
        overflow: hidden !important;
    }
    .story-viewer-container {
        width: 100% !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        top: 0 !important;
        left: 0 !important;
        box-shadow: none !important;
        position: relative !important;
    }
    .story-top-vignette {
        height: 130px !important;
    }
    .story-progress-wrapper {
        top: max(10px, env(safe-area-inset-top, 10px)) !important;
        left: max(10px, env(safe-area-inset-left, 10px)) !important;
        right: max(10px, env(safe-area-inset-right, 10px)) !important;
    }
    .story-viewer-header {
        top: calc(max(10px, env(safe-area-inset-top, 10px)) + 12px) !important;
        left: max(12px, env(safe-area-inset-left, 12px)) !important;
        right: max(12px, env(safe-area-inset-right, 12px)) !important;
    }
    .story-header-tools {
        gap: 6px !important;
    }
    .story-tool-btn,
    .story-viewer-close {
        width: 32px !important;
        height: 32px !important;
    }
    .story-media-stage {
        width: 100% !important;
        width: 100vw !important;
        height: 100% !important;
        height: 100dvh !important;
        border-radius: 0 !important;
    }
    .story-media-stage img,
    .story-media-stage video,
    .story-video {
        width: 100% !important;
        width: 100vw !important;
        height: 100% !important;
        height: 100dvh !important;
        object-fit: cover !important;
        border-radius: 0 !important;
    }

    /* Mobile Continuous Feed Stream - Flush to Screen Edges */
    .insta-mobile-feed-view {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .mobile-feed-scroll-container {
        width: 100vw !important;
        max-width: 100vw !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }
    .feed-post-item {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }
    .feed-card-media-col {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    .feed-video-player-wrap,
    .feed-single-image-wrap,
    .feed-carousel-player-wrap {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .feed-stream-video,
    .feed-single-image-wrap img,
    .feed-carousel-slide-item img {
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
        object-fit: cover !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .feed-carousel-slide-item {
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
    }

    .insta-search-drawer {
        right: 0 !important;
        width: 100% !important;
    }
}

/* ----------------------------------------------------
   ATTRACTIVE THEME PILL SWITCHER
   ---------------------------------------------------- */
.insta-theme-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.theme-switch-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-theme-pill-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
}

.pill-track {
    width: 64px;
    height: 32px;
    border-radius: 30px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 7px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 1px 2px rgba(255,255,255,0.05);
    transition: background 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(255,255,255,0.12);
}

body.insta-light .pill-track {
    background: linear-gradient(135deg, #38bdf8, #f59e0b);
    border-color: rgba(0,0,0,0.08);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 2px 6px rgba(245, 158, 11, 0.25);
}

.pill-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.pill-icon svg {
    width: 14px;
    height: 14px;
}

.sun-icon {
    color: #fbbf24;
}

.moon-icon {
    color: #c084fc;
}

.pill-thumb {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Mode: Thumb on Right (Sun side) */
body.insta-light .pill-thumb {
    transform: translateX(0);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* Dark Mode: Thumb on Left (Moon side) */
body.insta-dark .pill-thumb {
    transform: translateX(-32px);
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(192, 132, 252, 0.4);
}

/* Mobile Icon Toggle Animation */
.btn-theme-pill-mobile {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-theme-pill-mobile:hover {
    transform: scale(1.08);
}

/* ----------------------------------------------------
   TWO-INPUT COMMENT FORM & MODERATION
   ---------------------------------------------------- */
.comment-inputs-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 10px;
}

.comment-author-input {
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast);
}

.comment-author-input:focus {
    border-color: var(--insta-blue);
}

.modal-add-comment-form textarea.comment-input {
    resize: none;
    padding: 4px 0;
    font-size: 14px;
    line-height: 1.4;
    min-height: 24px;
    max-height: 80px;
}

.comment-pending-badge {
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-block;
    margin-right: 8px;
}

body.insta-dark .comment-pending-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.modal-comments-disabled-msg {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-secondary);
}

.modal-comments-disabled-msg svg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
}

/* ----------------------------------------------------
   DIRECT MESSAGE / CONTACT MODAL
   ---------------------------------------------------- */
.insta-dm-modal-container {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 440px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(0,0,0,0.4);
    position: relative;
    border: 1px solid var(--border-color);
    animation: modal-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.dm-modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.dm-header-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dm-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.dm-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dm-header-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.dm-header-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.dm-modal-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dm-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dm-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.dm-form-group label .required {
    color: #ef4444;
}

.dm-input, .dm-textarea {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dm-input:focus, .dm-textarea:focus {
    border-color: var(--insta-blue);
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.15);
}

.dm-help-text {
    font-size: 11px;
    color: var(--text-muted);
}

.dm-status-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

.dm-status-box.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

body.insta-dark .dm-status-box.success {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.3);
}

.dm-status-box.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

body.insta-dark .dm-status-box.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.dm-submit-btn {
    background: var(--insta-gradient);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 39, 67, 0.45);
}

.dm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Video Reel Fallback Preview Cover */
.reel-video-preview {
    object-fit: cover;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ----------------------------------------------------
   INSTAGRAM MOBILE CONTINUOUS POSTS FEED VIEW
   ---------------------------------------------------- */
.insta-mobile-feed-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2600;
    background-color: var(--bg-primary);
    display: none;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none;
}

.insta-mobile-feed-view.open {
    display: flex;
    pointer-events: auto;
}

body.feed-open {
    overflow: hidden !important;
}

/* Feed Top Navbar */
.mobile-feed-navbar {
    height: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 20;
}

.btn-feed-nav-back {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
}

.btn-feed-nav-back svg {
    width: 24px;
    height: 24px;
}

.mobile-feed-nav-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    text-align: center;
}

.mobile-feed-nav-actions {
    min-width: 36px;
    display: flex;
    justify-content: flex-end;
}

.btn-feed-follow-badge {
    background-color: var(--insta-blue);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.btn-feed-follow-badge.is-following {
    background-color: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

/* Feed Scroll Stream */
.mobile-feed-scroll-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px;
}

/* Feed Post Item */
.feed-post-item {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
}

/* Feed Header */
.feed-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
}

.feed-card-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.feed-card-meta {
    display: flex;
    flex-direction: column;
}

.feed-card-author-line {
    display: flex;
    align-items: center;
    gap: 4px;
}

.feed-card-username {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.feed-card-subline {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.feed-btn-more-dots {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.feed-btn-more-dots svg {
    width: 20px;
    height: 20px;
}

/* Media Column (Full Width - Edge to Edge like Instagram App) */
.feed-card-media-col {
    width: 100%;
    position: relative;
    background-color: #000000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.feed-single-image-wrap,
.feed-video-player-wrap,
.feed-carousel-player-wrap {
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

.feed-single-image-wrap img,
.feed-stream-video,
.feed-carousel-slide-item img {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto;
    max-height: 85vh;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

/* Video Corner Speaker Button */
.feed-volume-btn {
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.65);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 6;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform var(--transition-fast);
}

.feed-volume-btn:active {
    transform: scale(0.92);
}

.feed-volume-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.feed-volume-btn.muted .icon-vol-off { display: block; }
.feed-volume-btn.muted .icon-vol-on { display: none; }
.feed-volume-btn:not(.muted) .icon-vol-off { display: none; }
.feed-volume-btn:not(.muted) .icon-vol-on { display: block; }

/* Carousel Scroller (Swipe Gesture, No Arrows) */
.feed-carousel-scroller {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.feed-carousel-scroller::-webkit-scrollbar {
    display: none;
}

.feed-carousel-slide-item {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.feed-carousel-pill-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(18, 18, 18, 0.7);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    z-index: 6;
    letter-spacing: 0.5px;
}

.feed-carousel-indicator-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    z-index: 6;
    pointer-events: none;
}

.feed-carousel-indicator-dots .c-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.45);
    transition: background-color 0.2s, transform 0.2s;
}

.feed-carousel-indicator-dots .c-dot.active {
    background-color: var(--insta-blue);
    transform: scale(1.25);
}

/* Double-tap Pop Heart */
.feed-heart-pop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    z-index: 25;
}

.feed-heart-pop svg {
    width: 85px;
    height: 85px;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.65));
}

.feed-heart-pop.animate {
    animation: igHeartPop 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Actions Bar */
.feed-card-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 4px;
}

.feed-actions-group-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feed-act-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.feed-act-btn:active {
    transform: scale(1.15);
}

.feed-act-btn svg {
    width: 24px;
    height: 24px;
}

.btn-feed-like .icon-liked { display: none; }
.btn-feed-like .icon-unliked { display: block; }
.btn-feed-like.liked .icon-liked { display: block; fill: #ed4956; stroke: #ed4956; }
.btn-feed-like.liked .icon-unliked { display: none; }

.btn-feed-save .icon-saved { display: none; }
.btn-feed-save .icon-unsaved { display: block; }
.btn-feed-save.saved .icon-saved { display: block; fill: currentColor; }
.btn-feed-save.saved .icon-unsaved { display: none; }

/* Likes */
.feed-card-likes-row {
    padding: 2px 14px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Caption */
.feed-card-caption-wrap {
    padding: 2px 14px 4px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
}

.feed-caption-user {
    font-weight: 700;
    margin-left: 6px;
}

.btn-expand-feed-caption {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12.5px;
    cursor: pointer;
    padding: 0;
    display: inline;
}

/* Comments Trigger */
.feed-card-comments-link {
    padding: 2px 14px 4px;
}

.feed-comments-trigger {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: right;
    display: block;
}

/* Timestamp */
.feed-card-timestamp {
    display: block;
    padding: 2px 14px 12px;
    font-size: 10.5px;
    color: var(--text-muted);
}

/* ----------------------------------------------------
   MOBILE COMMENTS BOTTOM SHEET DRAWER
   ---------------------------------------------------- */
.mobile-comments-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2800;
    background-color: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: flex-end;
    pointer-events: none;
}

.mobile-comments-sheet-backdrop.open {
    display: flex;
    pointer-events: auto;
}

.mobile-comments-sheet-panel {
    width: 100%;
    max-height: 80vh;
    height: 75vh;
    background-color: var(--bg-primary);
    border-radius: 18px 18px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.comments-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--border-color);
    margin: 8px auto 4px;
    flex-shrink: 0;
}

.comments-sheet-header {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.comments-sheet-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.btn-close-comments-sheet {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.btn-close-comments-sheet svg {
    width: 20px;
    height: 20px;
}

.comments-sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
}

.comments-sheet-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    flex-shrink: 0;
}

.sheet-form-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sheet-author-input,
.sheet-text-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.sheet-text-input {
    resize: none;
}

.sheet-submit-btn {
    background-color: var(--insta-blue);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-end;
    pointer-events: auto !important;
    opacity: 1 !important;
    transition: opacity 0.2s, background-color 0.2s, transform 0.1s;
    user-select: none;
    -webkit-user-select: none;
}

.sheet-submit-btn:active {
    transform: scale(0.96);
}

.sheet-submit-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed;
}

