@charset "UTF-8";
@import url('https://fonts.cdnfonts.com/css/billabong');
:root {
    --bg-body: #000000;
    --bg-card: #000000;
    --text-main: #f5f5f5;
    --text-secondary: #a8a8a8;
    --border-color: #262626;
    --primary-blue: #0057B8;
    --primary-yellow: #FFD700;
    --button-blue: #0095f6;
    --sidebar-width: 245px;
    --hover-overlay: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-body); color: var(--text-main); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow-x: hidden; }

a { color: var(--text-main); text-decoration: none; }
a.link-blue { color: var(--button-blue); font-weight: 600; font-size: 12px; }

.main-wrapper { display: flex; max-width: 1300px; margin: 0 auto; justify-content: center; }

/* SIDEBAR LEFT */
.sidebar-left { position: fixed; top: 0; left: 0; width: 72px; height: 100vh; border-right: 1px solid var(--border-color); padding: 12px; display: none; flex-direction: column; z-index: 10; background: var(--bg-body); transition: width 0.2s; }
@media (min-width: 1264px) {
    .sidebar-left { width: var(--sidebar-width); padding: 24px 12px; align-items: flex-start; }
    .nav-row span { display: inline-block !important; }
    .brand-logo { display: block !important; padding-left: 12px; }
    .logo-icon { display: none !important; }
}
@media (min-width: 768px) {
    .sidebar-left { display: flex; }
    .app-header, .bottom-nav { display: none !important; }
    .feed-container { margin-left: 72px; }
}
@media (min-width: 1264px) { .feed-container { margin-left: var(--sidebar-width); } }

/* Force collapse sidebar when panel is open OR sidebar-collapsed class is present */
body.panel-open .sidebar-left,
.sidebar-left.sidebar-collapsed { width: 72px !important; align-items: center; } /* Reset align from flex-start */

body.panel-open .nav-row span,
.sidebar-left.sidebar-collapsed .nav-row span { display: none !important; }

body.panel-open .brand-logo,
.sidebar-left.sidebar-collapsed .brand-logo { display: none !important; }

body.panel-open .logo-icon,
.sidebar-left.sidebar-collapsed .logo-icon { display: block !important; }

body.panel-open .sidebar-left,
.sidebar-left.sidebar-collapsed { padding: 12px; } /* Reset padding */

.brand-logo { margin-bottom: 30px; font-family: 'Billabong', cursive; font-size: 28px; background: linear-gradient(45deg, var(--primary-blue), var(--primary-yellow)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; display: none; padding-top: 10px; }
.logo-icon { display: block; margin-bottom: 30px; padding: 10px; }
.nav-row { display: flex; align-items: center; padding: 12px; margin: 4px 0; border-radius: 8px; cursor: pointer; transition: background 0.2s; color: var(--text-main); width: 100%; }
.nav-row:hover { background-color: var(--hover-overlay); }
.nav-row svg { width: 24px; height: 24px; flex-shrink: 0; transition: transform 0.2s; }
.nav-row span { margin-left: 16px; font-size: 16px; font-weight: 400; display: none; }
.nav-row.active span { font-weight: 700; }
.nav-row:active svg { transform: scale(0.9); }

.nav-row.panel-active {
    border: 1px solid var(--border-color);
    background: var(--hover-overlay);
}
.nav-row.panel-active span { font-weight: 700; }
.nav-row.panel-active svg { transform: scale(1.1); }

/* MORE MENU POPOVER */
.more-menu-popover {
    position: fixed;
    bottom: 80px; 
    left: 12px;
    width: 266px;
    background: #262626;
    border-radius: 16px;
    padding: 8px;
    display: none;
    z-index: 100;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.more-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    color: white;
    transition: background 0.2s;
    font-size: 15px;
    text-decoration: none;
}
.more-menu-item:hover {
    background: rgba(255,255,255,0.1);
}
.more-menu-item svg {
    margin-right: 12px;
    width: 18px;
    height: 18px;
}
.more-menu-separator {
    height: 6px;
    background: #363636;
    margin: 8px -8px; 
    border-bottom: 1px solid #121212;
    border-top: 1px solid #121212;
}
.more-menu-separator.thin {
    height: 1px;
    border: none;
    background: #363636;
    margin: 8px 0;
}

/* FEED */
.feed-container { width: 100%; max-width: 630px; padding-bottom: 60px; padding-top: 30px; }
.feed-container.reels-view { max-width: 100%; padding: 0; background: black; }

/* REELS PAGE */
.reels-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px; /* Space for top tabs */
}

/* Hide scrollbar for reels-container */
.reels-container::-webkit-scrollbar { display: none; }

.reels-nav-tabs {
    position: fixed;
    top: 0;
    left: 72px; /* collapsed sidebar */
    right: 0;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background: black;
    z-index: 10;
    font-weight: 600;
}
@media (min-width: 1264px) {
    .reels-nav-tabs { left: var(--sidebar-width); }
}
body.panel-open .reels-nav-tabs { left: 72px; }

.reels-nav-tabs span { cursor: pointer; color: var(--text-secondary); font-size: 16px; }
.reels-nav-tabs span.active { color: white; border-bottom: 2px solid white; padding-bottom: 4px; }

.reel-wrapper {
    height: calc(100vh - 80px); /* slightly less than full viewport to show centering */
    scroll-snap-align: start;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    width: 600px; /* reel width + actions */
}

.reel-item {
    position: relative;
    height: 100%;
    aspect-ratio: 9/16;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.reel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    z-index: 2;
}

.reel-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.reel-user .user-avatar { width: 32px; height: 32px; border: 1px solid white; }
.reel-username { font-weight: 600; font-size: 14px; }
.btn-follow {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.reel-caption { font-size: 14px; margin-bottom: 12px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }

.reel-music {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 4px;
    width: fit-content;
}

.reel-actions-side {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-left: 12px;
    padding-bottom: 20px;
    gap: 16px;
    height: 100%;
}

.reel-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.reel-action-btn span { font-size: 12px; font-weight: 400; color: white; }
.reel-action-btn svg:hover { color: var(--text-secondary); }
.reel-action-btn.liked svg { color: #ed4956; fill: #ed4956; }

.reel-audio-preview {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid white;
    overflow: hidden;
    margin-top: 10px;
}
.reel-audio-preview img { width: 100%; height: 100%; object-fit: cover; }

.reels-side-nav {
    position: fixed;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}
.reel-nav-arrow {
    width: 32px;
    height: 32px;
    background: #262626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
}
.reel-nav-arrow:hover { background: #363636; }

/* REELS Volume/Mute */
.reel-mute-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}
.feed-container.reels-view { display: flex; justify-content: center; }

/* SIDEBAR RIGHT */
.sidebar-right { width: 320px; display: none; padding: 30px 0 0 40px; }
@media (min-width: 1100px) { .sidebar-right { display: block; } .main-wrapper { justify-content: flex-start; } }
.mini-profile, .suggestion-item { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.user-info-stacked { display: flex; flex-direction: column; }
.u-name { font-weight: 600; font-size: 14px; }
.u-sub { color: var(--text-secondary); font-size: 12px; }
.suggestions-header { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }

/* BUTTONS */
.btn-primary {
    background: var(--button-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-primary:hover {
    background: #1877f2;
}
.btn-secondary {
    background: #363636;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-secondary:hover {
    background: #262626;
}

/* POSTS */
.post-card { background: var(--bg-card); border-bottom: 1px solid var(--border-color); margin-bottom: 15px; }
.post-header { padding: 14px 4px; display: flex; align-items: center; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; margin-right: 10px; object-fit: cover; }
.username { font-weight: 600; font-size: 14px; color: var(--text-main); }
.more-btn { margin-left: auto; background: none; border: none; color: var(--text-main); cursor: pointer; }
.post-image { width: 100%; border-radius: 4px; border: 1px solid var(--border-color); display: block; }
.post-actions { padding: 12px 0 8px; display: flex; gap: 16px; }
.action-btn { background: none; border: none; color: var(--text-main); cursor: pointer; padding: 0; }
.action-btn svg { width: 24px; height: 24px; }
.like-btn.liked { color: #ed4956; }
.post-likes { margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.post-caption { font-size: 14px; padding: 4px 4px 8px; }
.post-comment-input-area {
    display: flex;
    align-items: center;
    padding: 12px 4px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}
.post-comment-input-area svg {
    margin-right: 12px;
    color: var(--text-main);
}
.card-comment-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
}
.card-post-btn {
    background: none;
    border: none;
    color: var(--button-blue);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-left: 12px;
}
.card-post-btn:disabled {
    opacity: 0.5;
    cursor: default;
}
.post-comments-preview {
    padding: 4px 4px 8px;
}
.comment-preview {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 18px;
}
.view-all-comments {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 0;
}
.view-all-comments:hover {
    color: var(--text-main);
}
.comment-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
}
.comment-action-btn:hover {
    color: var(--text-main);
}
.comment-like-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
}
.comment-like-btn:hover {
    color: var(--text-main);
}
.post-time { margin-top: 8px; font-size: 10px; color: var(--text-secondary); text-transform: uppercase; }

/* STORIES */
.stories-bar { padding: 16px 0; margin-bottom: 24px; display: flex; overflow-x: auto; gap: 16px; background: var(--bg-body); border-bottom: 1px solid var(--border-color); }
.story-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; width: 66px; }
.story-ring { width: 66px; height: 66px; border-radius: 50%; padding: 2px; background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888, #2e86de); }
.story-ring.add-story { background: none; border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; }
.story-ring img { width: 100%; height: 100%; border-radius: 50%; border: 2px solid black; object-fit: cover; }
.story-username { font-size: 12px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; text-align: center; }

/* STORY VIEWER OVERLAY */
.story-viewer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #1a1a1a; z-index: 2000; display: none; justify-content: center; align-items: center; }
.story-viewer-overlay.active { display: flex; }
.story-container-frame { width: 100%; max-width: 400px; height: 100vh; max-height: 800px; background: black; position: relative; border-radius: 8px; overflow: hidden; display: flex; justify-content: center; align-items: center; }
@media (min-width: 768px) { .story-container-frame { height: 90vh; } }
.story-media-content { width: 100%; height: 100%; object-fit: contain; position: absolute; top: 0; left: 0; z-index: 1; }
.story-progress-container { position: absolute; top: 10px; left: 10px; right: 10px; height: 2px; background: rgba(255,255,255,0.3); z-index: 10; border-radius: 2px; display: flex; gap: 4px; }
.story-progress-bar { flex-grow: 1; height: 100%; background: transparent; border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: white; }
.story-header-info { position: absolute; top: 20px; left: 10px; right: 10px; z-index: 10; display: flex; align-items: center; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
#story-user-avatar { width: 32px; height: 32px; border-radius: 50%; margin-right: 10px; border: 1px solid rgba(255,255,255,0.2); }
#story-user-name { font-weight: 600; font-size: 14px; margin-right: 10px; }
#story-time { font-size: 12px; opacity: 0.7; }
.close-story-btn { margin-left: auto; background: none; border: none; color: white; font-size: 24px; cursor: pointer; padding: 0 10px; }
.story-nav-area { position: absolute; top: 0; bottom: 0; width: 30%; z-index: 5; }
.story-nav-area.left { left: 0; }
.story-nav-area.right { right: 0; }

/* REELS */
.reels-container { 
    width: 100%; 
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
    display: flex;
    flex-direction: column;
    align-items: center;
    background: black;
    padding-top: 0;
}
.reels-container::-webkit-scrollbar { 
    display: none; 
}

.reel-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    justify-content: center;
    align-items: center;
}

.reel-item { 
    position: relative; 
    width: 100%; 
    max-width: 350px; /* Instagram web reel width */
    height: calc(100vh - 40px);
    max-height: 850px;
    background: #111; 
    border-radius: 4px; 
    overflow: hidden; 
    border: 1px solid var(--border-color);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
@media (max-width: 450px) {
    .reel-item { width: 100%; max-width: 100%; height: 100vh; border-radius: 0; border: none; }
}

.reel-item video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    cursor: pointer;
}

/* OVERLAYS */
.reel-overlay { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    padding: 20px; 
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 60%);
    pointer-events: none; /* Let clicks pass through to video */
}

.reel-user { 
    display: flex; 
    align-items: center; 
    margin-bottom: 12px; 
    pointer-events: auto;
}

.reel-user-info {
    display: flex;
    align-items: center;
}

.reel-username {
    color: white;
    font-weight: 600;
    margin-right: 10px;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.reel-user .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-follow {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.reel-caption {
    font-size: 14px;
    color: white;
    margin-bottom: 12px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    max-height: 80px;
    overflow: hidden;
    pointer-events: auto;
}

.reel-music {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: white;
    gap: 6px;
    margin-bottom: 8px;
}

/* RIGHT SIDE ACTIONS */
.reel-actions-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-left: 20px;
    margin-bottom: 40px; /* Align with bottom of video */
    align-self: flex-end; /* Stick to bottom right corner of wrapper */
    padding-bottom: 60px; /* Offset for desktop */
}

.reel-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: transform 0.1s;
}
.reel-action-btn:active { transform: scale(0.9); }
.reel-action-btn svg {
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}
.reel-action-btn span {
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.reel-action-btn.liked { color: #ed4956; }
.reel-action-btn.liked svg { fill: #ed4956; stroke: none; } /* Wait, standard heart is stroke, filled is fill */

.reel-audio-preview {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid white;
    overflow: hidden;
    margin-top: 10px;
}
.reel-audio-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* PROFILE PAGE */
.profile-header { display: flex; max-width: 935px; margin: 0 auto 44px; padding: 30px 20px 0; align-items: flex-start; }
.profile-avatar-container { flex-grow: 1; margin-right: 30px; display: flex; justify-content: center; }
.profile-avatar-large { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; }
.profile-info { flex-grow: 2; color: var(--text-main); }
.profile-actions { display: flex; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.profile-username { font-size: 20px; font-weight: 400; margin-right: 20px; }
.btn-profile { background-color: #363636; color: white; border: none; padding: 7px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn-profile:hover { background-color: #262626; }
.profile-stats { display: flex; margin-bottom: 20px; font-size: 16px; }
.profile-stats span { margin-right: 40px; }
.stat-count { font-weight: 700; }
.profile-fullname { font-weight: 600; }
.highlights { display: flex; gap: 40px; padding: 0 40px 44px; max-width: 935px; margin: 0 auto; overflow-x: auto; }
.highlight-item { display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; }
.highlight-circle { width: 77px; height: 77px; border-radius: 50%; border: 1px solid #363636; background: #121212; display: flex; justify-content: center; align-items: center; color: #a8a8a8; }
.profile-tabs { display: flex; justify-content: center; border-top: 1px solid var(--border-color); color: var(--text-secondary); font-size: 12px; font-weight: 600; letter-spacing: 1px; gap: 60px; max-width: 935px; margin: 0 auto; }
.tab-item { padding: 18px 0; cursor: pointer; display: flex; align-items: center; gap: 6px; text-transform: uppercase; }
.tab-item.active { border-top: 1px solid var(--text-main); margin-top: -1px; color: var(--text-main); }
.tab-item svg { width: 12px; height: 12px; }
.profile-grid-wrapper { max-width: 935px; margin: 0 auto; }
.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.grid-post { aspect-ratio: 1; overflow: hidden; cursor: pointer; position: relative; }
.grid-post img, .grid-post video { width: 100%; height: 100%; object-fit: cover; }
.grid-post:hover .grid-item-overlay { display: flex; }

.grid-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: none;
    justify-content: center;
    align-items: center;
    gap: 30px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    z-index: 5;
}

.grid-item-overlay .overlay-stat {
    display: flex;
    align-items: center;
    gap: 7px;
}

/* MODALS */
.type-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.5));
}

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.65); z-index: 1000; display: none; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal { background: #262626; border: 1px solid #363636; color: white; width: 100%; max-width: 500px; border-radius: 12px; overflow: hidden; }
.modal-header { border-bottom: 1px solid #363636; display: flex; justify-content: space-between; padding: 12px 16px; font-weight: 600; align-items: center; }
.modal-body { padding: 20px; display: flex; flex-direction: column; }
.close-btn { background: none; border: none; color: white; cursor: pointer; font-size: 20px; }
.upload-label { border: 1px dashed #363636; padding: 40px; text-align: center; border-radius: 8px; cursor: pointer; margin-bottom: 16px; }
.caption-input { background: #121212; border: 1px solid #363636; color: white; padding: 10px; width: 100%; border-radius: 6px; min-height: 80px; resize: vertical; margin-bottom: 16px; }
.btn-primary { background: var(--button-blue); color: white; border: none; padding: 8px 16px; border-radius: 4px; font-weight: 600; cursor: pointer; width: 100%; }

/* SETTINGS PAGE LAYOUT */
.settings-wrapper { display: flex; max-width: 935px; margin: 30px auto; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 3px; min-height: 80vh; }
.settings-sidebar { width: 25%; border-right: 1px solid var(--border-color); }
.settings-header-title { padding: 20px 0 20px 30px; font-size: 20px; font-weight: 700; margin: 0; }
.meta-promo-box { margin: 0 10px 10px; padding: 15px; background: #1f1f1f; border-radius: 8px; color: var(--button-blue); font-weight: 600; font-size: 13px; cursor: pointer; }
.meta-promo-box:hover { background: #2a2a2a; }
.meta-logo-row { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; color: white; }
.settings-menu-item { padding: 16px 30px; font-size: 16px; cursor: pointer; border-left: 2px solid transparent; color: var(--text-main); }
.settings-menu-item:hover { background: #121212; border-left: 2px solid #dbdbdb; }
.settings-menu-item.active { font-weight: 600; border-left: 2px solid var(--text-main); }
.settings-content { width: 75%; padding: 30px 40px; }
.edit-profile-header { font-size: 20px; margin-bottom: 30px; }
.settings-avatar-row { display: flex; align-items: center; background: #262626; padding: 10px 20px; border-radius: 12px; margin-bottom: 30px; justify-content: space-between; }
.settings-avatar-info { display: flex; align-items: center; gap: 15px; }
.settings-avatar-img { width: 50px !important; height: 50px !important; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
img { max-width: 100%; }
.settings-username-stack { display: flex; flex-direction: column; }
.settings-btn-change-photo { background: #0095f6; color: white; font-weight: 600; padding: 7px 16px; border-radius: 8px; font-size: 14px; border: none; cursor: pointer; }
.settings-btn-change-photo:hover { background: #1877f2; }
.settings-form-group { margin-bottom: 20px; }
.settings-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.settings-input { width: 100%; background: transparent; border: 1px solid var(--border-color); border-radius: 3px; padding: 10px; color: var(--text-main); font-size: 16px; }
.settings-input:focus { border-color: #a8a8a8; outline: none; }
.settings-textarea { width: 100%; background: transparent; border: 1px solid var(--border-color); border-radius: 3px; padding: 10px; color: var(--text-main); font-size: 14px; resize: vertical; min-height: 60px; }
.char-count { text-align: right; font-size: 12px; color: var(--text-secondary); margin-top: 5px; }

/* POST OPTIONS MODAL */
.options-modal-content {
    background: #262626;
    width: 400px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.options-btn {
    background: none;
    border: none;
    padding: 14px;
    color: white;
    font-size: 14px;
    border-bottom: 1px solid #363636;
    cursor: pointer;
    text-align: center;
    width: 100%;
}
.options-btn:last-child {
    border-bottom: none;
}
.options-btn.destructive {
    color: #ed4956;
    font-weight: 700;
}
.options-btn:active {
    background: rgba(255,255,255,0.05);
}

/* EMOJI PICKER */
.emoji-picker-panel {
    position: absolute;
    bottom: 50px;
    left: 0;
    width: 320px;
    background: #262626;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    z-index: 1001;
    display: none;
    flex-direction: column;
    padding: 16px;
}
.emoji-picker-panel.active { display: flex; }
.emoji-section-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.emoji-item {
    font-size: 24px;
    cursor: pointer;
    text-align: center;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.emoji-item:hover {
    background: rgba(255,255,255,0.1);
}
.emoji-picker-panel::-webkit-scrollbar { width: 4px; }
.emoji-picker-panel::-webkit-scrollbar-thumb { background: #363636; border-radius: 2px; }

/* SIDEBAR MORE MENU */
.more-menu-popover {
    position: absolute;
    bottom: 70px;
    left: 10px;
    width: 266px;
    background: #262626;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
    padding: 8px;
    z-index: 2000;
}
.more-menu-popover.active {
    display: flex;
}
.more-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}
.more-menu-item:hover {
    background: rgba(255,255,255,0.05);
}
.more-menu-item span {
    flex-grow: 1;
}
.more-menu-separator {
    height: 6px;
    background: #363636;
    margin: 8px -8px;
}
.more-menu-separator.thin {
    height: 1px;
    margin: 4px -8px;
}
.form-note { font-size: 12px; color: var(--text-secondary); margin-top: 10px; line-height: 1.4; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding: 15px; border: 1px solid var(--border-color); border-radius: 12px; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #363636; transition: .4s; border-radius: 34px; }
.toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .toggle-slider { background-color: var(--text-main); }
input:checked + .toggle-slider:before { transform: translateX(20px); background-color: black; }
@media (max-width: 768px) {
    .settings-wrapper { flex-direction: column; border: none; margin: 0; }
    .settings-sidebar { width: 100%; display: none; }
    .settings-content { width: 100%; padding: 20px; }
    .profile-header { flex-direction: row; padding: 20px 16px 0; max-width: 100%; margin-bottom: 0; }
    .profile-avatar-large { width: 77px; height: 77px; }
    .profile-avatar-container { margin-right: 20px; flex-grow: 0; }
    .profile-stats { padding: 12px 0; border-top: 1px solid var(--border-color); justify-content: space-around; text-align: center; margin: 24px -16px 0; width: calc(100% + 32px); }
    .profile-stats span { margin-right: 0; display: flex; flex-direction: column; font-size: 14px; }
    .profile-info { width: 100%; }
    .profile-actions { flex-direction: column; align-items: stretch; margin-bottom: 0; }
    .btn-profile { width: 100%; text-align: center; margin: 0 0 6px 0; }
    .highlights { padding: 0 16px 20px; max-width: 100%; }
    .profile-tabs { justify-content: space-around; gap: 0; max-width: 100%; }
    .tab-item span { display: none; }
    .tab-item svg { width: 24px; height: 24px; }
}

/* MESSENGER (DIRECT) */
.feed-container.messenger-view {
    max-width: 100%; 
    padding: 0;
    margin-left: 72px;
}
@media (min-width: 1264px) {
    .feed-container.messenger-view { margin-left: var(--sidebar-width); }
}

/* Hide right sidebar on messenger view */
.messenger-view ~ .sidebar-right {
    display: none !important;
}

.messenger-container {
    display: flex;
    height: 100vh;
    width: 100%;
    background: var(--bg-body);
}

.messenger-sidebar {
    width: 380px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messenger-sidebar-header {
    padding: 36px 20px 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.messenger-user-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.messenger-user-selector h2 {
    font-size: 20px;
    font-weight: 700;
}

.new-message-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
}
.new-message-btn:hover { background: var(--hover-overlay); }

.messenger-notes-row {
    display: flex;
    gap: 20px;
    padding: 15px 20px 25px;
    overflow-x: auto;
    scrollbar-width: none;
}
.messenger-notes-row::-webkit-scrollbar { display: none; }

.note-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
}

.note-avatar-wrapper {
    position: relative;
    width: 72px;
    height: 72px;
}

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

.note-bubble {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: #262626;
    color: #a8a8a8;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 11px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border: 1px solid #363636;
}

.messenger-list-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    align-items: center;
}

.messenger-list-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.requests-link {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.messenger-list {
    flex-grow: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background: var(--hover-overlay);
}

.chat-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.chat-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.chat-name {
    font-weight: 400;
    font-size: 14px;
    margin-bottom: 2px;
}

.chat-last-msg {
    color: var(--text-secondary);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.messenger-chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--bg-body);
}

.chat-placeholder .placeholder-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.chat-placeholder .placeholder-icon svg {
    border: 2px solid white;
    border-radius: 50%;
    padding: 20px;
    width: 96px;
    height: 96px;
}

.chat-placeholder h2 {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 10px;
}

.chat-placeholder p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 320px;
    line-height: 1.4;
}

/* MOBILE MESSENGER */
@media (max-width: 768px) {
    .messenger-sidebar { width: 100%; border: none; }
    .messenger-chat-area { display: none; }
    .messenger-view.feed-container { margin-left: 0; }
}


/* AUTH PAGES */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-body);
}

.auth-box {
    width: 350px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.auth-box .logo {
    font-family: 'Billabong', cursive;
    font-size: 3rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, var(--primary-blue), var(--primary-yellow));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: default;
}

.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-form input {
    background: #121212;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 9px 8px;
    font-size: 14px;
    color: var(--text-main);
    width: 100%;
    margin-bottom: 6px;
}

.auth-form input:focus {
    border-color: #a8a8a8;
    outline: none;
}

.auth-form button {
    background: var(--button-blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
    height: 32px;
    width: 100%;
    transition: background-color 0.2s;
}

.auth-form button:hover {
    background-color: #1877f2;
}

.auth-switch {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-main);
    text-align: center;
}
.auth-switch a {
    color: var(--button-blue);
    font-weight: 600;
}

@media (max-width: 450px) {
    .auth-box { border: none; background: transparent; padding: 20px; width: 100%; }
}

/* NOTIFICATIONS PANEL */
.notifications-panel {
    position: fixed;
    top: 0;
    left: 72px; /* Matches collapsed sidebar width */
    width: 397px;
    height: 100vh;
    background-color: black;
    border-right: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color); /* Separator from sidebar icons */
    z-index: 15; /* Above content, but maybe we want sidebar icons above this? Sidebar is z-10. Let's make this z-5 but then it's under sidebar text? Sidebar text is inside sidebar. */
    /* Strategy: Make this z-index 11, so it covers the expanded sidebar text if needed, OR just sit next to it.
       If sidebar is 245px, and this is at 72px, it covers the right part of sidebar. Ideally sidebar should shrink.
       For now, let's just make it slide out. */
    transform: translateX(-150%);
    transition: transform 0.3s ease-in-out;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.notifications-panel.active {
    transform: translateX(0);
}

.notifications-header {
    padding: 24px;
    padding-bottom: 12px;
}
.notifications-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.notifications-scroll-area {
    height: calc(100% - 100px);
    overflow-y: auto;
}

.notif-section-title {
    padding: 12px 24px;
    font-weight: 600;
    font-size: 16px;
}

.notif-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    cursor: pointer;
}
.notif-item:hover {
    background-color: var(--hover-overlay);
}

.notif-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 14px;
    flex-shrink: 0;
}

.notif-text {
    font-size: 14px;
    margin-right: 14px;
    flex-grow: 1;
    line-height: 1.4;
}

.notif-username {
    font-weight: 600;
}

.notif-time {
    color: var(--text-secondary);
}

.notif-media img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px; /* Instagram typically squares or slight radius */
}

/* SEARCH Panel specific */
.search-field input::placeholder {
    color: #8e8e8e;
}

#search-panel .panel-header {
    margin-bottom: 20px;
}

.search-field:focus-within {
    background: #363636 !important;
}

#search-results-list .notification-item {
    padding: 8px 16px;
    border-radius: 8px;
    margin: 0 8px;
}

.search-remove-btn:hover {
    color: white !important;
}

@media (max-width: 768px) {
    .notifications-panel {
        left: 0;
        width: 100%;
        border-left: none;
        z-index: 25; /* On top of everything on mobile */
    }
}

/* POST DETAIL MODAL */
.post-detail-close {
    position: fixed; /* Fixed relative to viewport, not container */
    top: 20px;
    right: 20px;
    color: white;
    font-size: 25px; /* Slightly smaller */
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1200;
}

.post-detail-card {
    display: flex;
    background: black;
    width: 100%;
    max-width: calc(100vh * 1.5); /* Ratio approx */
    height: 95vh;
    max-height: 900px;
    border-radius: 4px; /* Instagram web doesn't have large radius here usually, maybe tiny */
    overflow: hidden;
}

.post-detail-media {
    background: black;
    flex-grow: 1; 
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: auto;
    border-right: 1px solid var(--border-color);
}
.post-detail-media img, .post-detail-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.post-detail-sidebar {
    width: 400px; /* Fixed width */
    min-width: 400px; /* Prevent shrink */
    max-width: 500px;
    background: black;
    display: flex;
    flex-direction: column;
}

.detail-header {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 14px 16px;
    flex-shrink: 0;
}
.detail-header .user-avatar { margin-right: 14px; width: 32px; height: 32px; border-radius: 50%; }
.detail-header-info { display: flex; flex-direction: column; margin-right: auto; }
.detail-header .username { font-weight: 600; font-size: 14px; color: white; text-decoration: none; }
.detail-location { font-size: 12px; color: var(--text-secondary); margin-top: -2px; }
.detail-options-btn { background: none; border: none; color: white; cursor: pointer; padding: 8px; margin-right: -8px; }

.detail-scroll-area {
    flex-grow: 1; /* Fills remaining space */
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: thin; /* Firefox */
}
.detail-scroll-area::-webkit-scrollbar { width: 0; } /* Hide scrollbar for cleaner look */

.detail-footer {
    border-top: 1px solid var(--border-color);
    padding: 6px 16px;
    background: black;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.detail-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    margin-bottom: 8px;
}
.detail-actions-row .left-actions { display: flex; gap: 16px; }
.detail-actions-row svg { cursor: pointer; }

.detail-likes {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: white;
}
.detail-time {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.detail-input-area {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding: 12px 0;
    margin-top: 4px;
}
.detail-input-area svg { margin-right: 12px; cursor: pointer; } /* Smile icon */
.detail-input-area input {
    background: none;
    border: none;
    color: white;
    flex-grow: 1;
    font-size: 14px;
}
.detail-input-area input:focus { outline: none; }
.detail-input-area button {
    background: none;
    border: none;
    color: var(--button-blue);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}
.detail-input-area button:disabled { opacity: 0.5; cursor: default; }

/* POST OPTIONS MODAL */
.options-modal-content {
    background: #262626;
    width: 400px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: zoomIn 0.1s ease-out;
}

@keyframes zoomIn {
    from { transform: scale(1.1); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.options-btn {
    background: none;
    border: none;
    border-bottom: 1px solid #363636;
    color: white;
    padding: 14px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    font-weight: 400;
}
.options-btn:last-child {
    border-bottom: none;
}
.options-btn.destructive {
    color: #ed4956;
    font-weight: 700;
}
.options-btn:active {
    background: rgba(255,255,255,0.05);
}

@media (max-width: 450px) {
    .options-modal-content {
        width: calc(100% - 40px);
    }
}



/* COMMENTS Styling */
.comment-row {
    display: flex;
    margin-bottom: 16px;
    align-items: flex-start;
}
.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}
.comment-row-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.comment-text-block {
    font-size: 14px;
    line-height: 18px;
    color: white;
}
.comment-username {
    font-weight: 600;
    margin-right: 4px;
    color: white;
    text-decoration: none;
}
.comment-username:hover { text-decoration: underline; }
.comment-text {
    word-break: break-word;
}
.comment-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-weight: 400;
}
.comment-meta span { cursor: pointer; }

.comment-like-icon {
    width: 12px; 
    height: 12px; 
    margin-left: 10px; 
    margin-top: 8px; 
    color: var(--text-secondary); 
    cursor: pointer;
}
.comment-like-icon:hover { color: #ed4956; }

@media (max-width: 768px) {
    .post-detail-card { flex-direction: column; height: 100vh; max-height: none; width: 100%; border-radius: 0; }
    .post-detail-media { width: 100%; height: 50vh; flex-grow: 0; border-right: none; border-bottom: 1px solid var(--border-color); }
    .post-detail-sidebar { width: 100%; min-width: 0; flex-grow: 1; }
    .detail-scroll-area { height: auto; flex-grow: 1; }
    .post-detail-close { top: 10px; right: 10px; font-size: 24px; z-index: 2000; }
}

/* MOBILE RESPONSIVE NAV */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; height: 50px; background: black; border-top: 1px solid var(--border-color); display: flex; justify-content: space-around; align-items: center; z-index: 1000; padding: 0 10px; }
.bottom-nav .nav-item { display: flex; align-items: center; justify-content: center; height: 100%; flex-grow: 1; cursor: pointer; color: white; -webkit-tap-highlight-color: transparent; }
.bottom-nav .nav-item svg { width: 24px; height: 24px; }
.bottom-nav .nav-item:active { opacity: 0.5; }

.app-header { position: fixed; top: 0; left: 0; width: 100%; height: 44px; background: black; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; padding: 0 16px; z-index: 1000; }

/* CREATE MODAL REDESIGN */
#create-modal .modal {
    background: #262626;
    border-radius: 12px;
    overflow: hidden;
    width: 600px;
    max-width: 900px;
    height: 600px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

#create-modal .modal-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.upload-icon-container {
    margin-bottom: 20px;
    color: white;
}

.drag-text {
    font-size: 20px;
    color: white;
    margin-bottom: 24px;
    font-weight: 300;
}

.select-btn {
    cursor: pointer;
    font-size: 14px;
    padding: 7px 16px;
    border-radius: 8px;
}

.create-step-2 {
    display: flex;
    width: 100%;
    height: 100%;
}

.create-preview-container {
    background: black;
    height: 100%;
}

.create-sidebar {
    background: #262626;
    height: 100%;
}

.caption-input:focus {
    outline: none;
}

/* EXPLORE SEARCH BOX */
.sidebar-search-box {
    background: #262626;
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    max-width: 350px;
}
.sidebar-search-box svg {
    color: var(--text-secondary);
}
.sidebar-search-box input {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    width: 100%;
}
.sidebar-search-box input:focus {
    outline: none;
}
.sidebar-search-box input::placeholder {
    color: var(--text-secondary);
}

/* POST DETAIL MODAL */
.post-detail-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 1200;
}
.post-detail-card {
    display: flex;
    background: black;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    border-radius: 4px;
    overflow: hidden;
}
.post-detail-media {
    flex: 1.2;
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
}
.post-detail-media img, .post-detail-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.post-detail-sidebar {
    flex: 0.8;
    background: black;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}
.detail-header {
    display: flex;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
}
.detail-header-info {
    margin-left: 12px;
    flex: 1;
}
.detail-location {
    display: block;
    font-size: 12px;
}
.detail-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}
.detail-scroll-area::-webkit-scrollbar { width: 0; }

.detail-footer {
    padding: 14px;
    border-top: 1px solid var(--border-color);
}
.detail-actions-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.left-actions { display: flex; gap: 16px; }
.detail-likes { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.detail-time { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; }

.detail-input-area {
    display: flex;
    align-items: center;
    padding: 12px 0;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
}
.detail-input-area input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding-left: 12px;
    outline: none;
}
.detail-input-area button {
    background: none;
    border: none;
    color: var(--button-blue);
    font-weight: 600;
    cursor: pointer;
}

.comment-row {
    display: flex;
    margin-bottom: 16px;
}
.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
}
.comment-row-content { flex: 1; }
.comment-username { font-weight: 600; margin-right: 8px; }
.comment-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

/* MESSENGER TABS */
.messenger-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
}

.messenger-tab {
    flex: 1;
    text-align: center;
    padding: 16px 0;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.messenger-tab.active {
    color: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
}

.messenger-tab:hover:not(.active) {
    color: var(--text-main);
}

/* MESSENGER LAYOUT */
.messenger-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

@media (min-width: 768px) {
    .messenger-container { margin-left: 72px; width: calc(100% - 72px); }
}

@media (min-width: 1264px) {
    /* If sidebar is collapsed (view=direct), we might want to manually adjust margin-left to 72px for .messenger-container to be safe.
       However, if .sidebar-left is 72px due to collapse, we can just use 72px here. */
    .messenger-container { margin-left: 72px; width: calc(100% - 72px); }
    /* Overwrite the default rule which was margin-left: var(--sidebar-width) */
}

.messenger-sidebar {
    width: 397px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: black;
    height: 100%;
}

.messenger-sidebar-header {
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.messenger-user-selector {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.messenger-user-selector h2 { font-size: 20px; font-weight: 700; margin-right: 8px; }

.new-message-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.messenger-notes-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 20px;
    border-bottom: 1px solid transparent; 
    /* Instagram adds border if scrolled, let's just minimal */
}
.messenger-notes-row::-webkit-scrollbar { display: none; }

.note-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 86px;
    flex-shrink: 0;
}

.note-avatar-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 4px;
}

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

.note-bubble {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: #262626; 
    color: white; 
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    text-align: center;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.note-bubble.plus {
    top: 2px;
    right: 2px;
    left: auto;
    transform: none;
    width: 20px;
    height: 20px;
    background: #262626;
    border: 2px solid #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
    color: white;
    z-index: 5;
    box-shadow: none;
}

.note-sub {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messenger-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}
.messenger-list-header h3 { font-size: 16px; font-weight: 700; }
.requests-link { color: var(--text-secondary); font-size: 14px; cursor: pointer; }
.requests-link:hover { color: var(--text-main); }

.messenger-list {
    flex-grow: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    cursor: pointer;
}
.chat-item:hover { background: #121212; }
.chat-avatar { width: 56px; height: 56px; border-radius: 50%; margin-right: 12px; object-fit: cover; }
.chat-info { display: flex; flex-direction: column; justify-content: center; }
.chat-name { font-size: 14px; color: white; margin-bottom: 2px; }
.chat-last-msg { font-size: 14px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

.messenger-chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: black;
}
.chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}
.placeholder-icon {
    width: 96px;
    height: 96px;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.placeholder-icon svg { stroke-width: 1px; }

.chat-placeholder h2 { font-size: 20px; font-weight: 400; margin-bottom: 8px; }
.chat-placeholder p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }

@media (max-width: 768px) {
    .messenger-sidebar { width: 100%; border-right: none; }
    .messenger-chat-area { display: none; }
    /* If chat opened, special class would hide sidebar and show chat-area, handled in JS potentially or simple CSS toggle */
}
