.register-link { display:block; text-align:center; margin:8px 0; color:var(--accent); font-weight:600; }
.register-link:hover { text-decoration:underline; }
.login-success { display:none; padding:10px 12px; border-radius:10px; border:1px solid rgba(40,167,69,0.4); background:rgba(40,167,69,0.08); color:#3ddc84; font-size:13px; }
.login-panel .login-header, .login-panel .login-form { width:100%; max-width:460px; margin-left:auto; margin-right:auto; }
.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper .input-field { flex: 1; padding-right: 40px; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 50%; color: var(--text-secondary); cursor: pointer; }
.password-toggle:hover { color: var(--accent); background: transparent; }
.icon-eye { width: 18px; height: 18px; }
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --accent: #ff0080;
    --accent-hover: #ff3399;
    --border: #333333;
    --nav-height: 50px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* Preloader overlay */
.preloader { position: fixed; inset:0; display:flex; align-items:center; justify-content:center; background:#000; z-index: 120000; flex-direction:column; gap:10px; }
.preloader .spinner { width: 42px; height: 42px; border: 4px solid rgba(255,255,255,0.15); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.preloader .preloader-text { color: var(--text-primary); opacity: 0.8; font-weight: 600; font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideDown {
    from { 
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to { 
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

body.light {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #000000;
    --text-secondary: #666666;
    --accent: #ff0080;
    --accent-hover: #ff3399;
    --border: #e0e0e0;
}

body.sunset {
    --bg-primary: #1a0a2e;
    --bg-secondary: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #ff6b6b;
    --accent-hover: #ff8888;
    --border: #2d1b4e;
}

body.ocean {
    --bg-primary: #0a1929;
    --bg-secondary: #132f4c;
    --text-primary: #ffffff;
    --text-secondary: #8ab4f8;
    --accent: #00d4ff;
    --accent-hover: #33ddff;
    --border: #1e3a5f;
}

body.neon {
    --bg-primary: #040714;
    --bg-secondary: #0b0f1a;
    --text-primary: #eafff9;
    --text-secondary: #88ffd1;
    --accent: #00ffa3;
    --accent-hover: #00b3ff;
    --border: #06202b;
}

body.forest {
    --bg-primary: #07130a;
    --bg-secondary: #0b2a17;
    --text-primary: #e6ffef;
    --text-secondary: #99d7a6;
    --accent: #28a745;
    --accent-hover: #3ddc84;
    --border: #083016;
}

body.dawn {
    --bg-primary: #0f0b1a;
    --bg-secondary: #1a1226;
    --text-primary: #fff7e6;
    --text-secondary: #ffd6a5;
    --accent: #ffb86b;
    --accent-hover: #ffd89b;
    --border: #2b1b2f;
}

body.sakura {
    --bg-primary: #1a0a14;
    --bg-secondary: #2d1421;
    --text-primary: #ffe6f0;
    --text-secondary: #ffb3d9;
    --accent: #ff1493;
    --accent-hover: #ff69b4;
    --border: #4a1f3a;
}

body.midnight {
    --bg-primary: #0f0c29;
    --bg-secondary: #1a1642;
    --text-primary: #e6e6ff;
    --text-secondary: #b3b3e6;
    --accent: #7b68ee;
    --accent-hover: #9370db;
    --border: #24243e;
}

body.lavender {
    --bg-primary: #1a1329;
    --bg-secondary: #2a1f3d;
    --text-primary: #f5f0ff;
    --text-secondary: #d4c5f9;
    --accent: #a78bfa;
    --accent-hover: #c4b5fd;
    --border: #3d2f5a;
}

body.autumn {
    --bg-primary: #1a0f00;
    --bg-secondary: #2d1a00;
    --text-primary: #ffe6cc;
    --text-secondary: #ffb366;
    --accent: #ff8c00;
    --accent-hover: #ffa500;
    --border: #4d2600;
}

body.cyberpunk {
    --bg-primary: #0a0014;
    --bg-secondary: #1a0a2e;
    --text-primary: #f0f0ff;
    --text-secondary: #b380ff;
    --accent: #ff006e;
    --accent-hover: #ff1a8c;
    --border: #2d1b4e;
}

body.desert {
    --bg-primary: #1a1410;
    --bg-secondary: #2d2318;
    --text-primary: #ffefd5;
    --text-secondary: #d4a574;
    --accent: #ff8c42;
    --accent-hover: #ffa55c;
    --border: #3d3020;
}

body.aurora {
    --bg-primary: #0b1021;
    --bg-secondary: #162544;
    --text-primary: #e0f7fa;
    --text-secondary: #7cf3a0;
    --accent: #1ba1f2;
    --accent-hover: #3db5ff;
    --border: #1e3a5f;
}

body.mono {
    --bg-primary: #111111;
    --bg-secondary: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #888888;
    --accent: #666666;
    --accent-hover: #777777;
    --border: #333333;
}

/* Settings modal */
.settings-modal { position: fixed; inset:0; display:none; z-index:2200; }
.settings-modal.active { display:block; }
.settings-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.6); }
.settings-panel { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:92%; max-width:480px; background:var(--bg-primary); padding:16px; border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,0.6); }
.settings-panel h3 { margin-bottom:8px; }
.settings-panel label { display:block; margin:8px 0; color:var(--text-primary); }
.settings-panel input[type=text] { width:100%; padding:8px; border-radius:6px; border:1px solid var(--border); background:var(--bg-secondary); color:var(--text-primary); }
.settings-panel button { background:var(--accent); color:white; border:none; padding:8px 12px; border-radius:8px; cursor:pointer; }

.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    padding-bottom: var(--nav-height);
}

/* Headers */
.header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    height: 60px;
}

.header.hidden {
    display: none;
}

.logo {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover), #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
    font-style: italic;
    text-transform: lowercase;
    position: relative;
}

.logo::after {
    content: '●';
    position: absolute;
    right: -8px;
    top: -5px;
    font-size: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.header-icons {
    display: flex;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
}

.icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.theme-switcher.active {
    display: flex;
}

.theme-option {
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.theme-option:hover {
    background: var(--accent);
    color: white;
}

.theme-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Stories */
.stories {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.stories::-webkit-scrollbar {
    display: none;
}

/* Important Alerts Banner */
.important-alerts-banner {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    padding: 15px 50px 15px 20px;
    margin: 15px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
    position: relative;
}

.alert-content {
    text-align: left;
    line-height: 1.5;
}

.alert-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.alert-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Good Afternoon Message Post */
.good-afternoon-post {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    margin: 16px auto;
    max-width: 600px;
    padding: 24px;
    border-radius: 12px;
    animation: fadeIn 0.5s ease;
    text-align: center;
    position: relative;
}

.greeting-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.6;
}

.greeting-close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    opacity: 1;
    transform: scale(1.1);
}

.greeting-emoji {
    font-size: 36px;
    margin-bottom: 12px;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.good-afternoon-post .greeting-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.good-afternoon-post .greeting-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
    max-width: 450px;
    margin: 0 auto;
}

.story {
    flex-shrink: 0;
    text-align: center;
    cursor: pointer;
}

.story-avatar {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    padding: 3px;
    margin-bottom: 6px;
    transition: transform 0.2s;
    position: relative;
}

.story-avatar.seen {
    background: var(--border);
}

.story-avatar .story-seen-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: #4caf50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    font-size: 11px;
    z-index: 1;
}

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

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

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

.story-name {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Story Viewer */
.story-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.story-viewer.active {
    display: flex;
}

.story-progress {
    display: flex;
    gap: 3px;
    padding: 15px;
    background: rgba(0,0,0,0.5);
}

.story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress-fill {
    width: 0%;
    height: 100%;
    background: white;
    transition: width 0.1s linear;
}

.story-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    max-width: 600px;
    aspect-ratio: 9 / 16;
    margin: 0 auto;
    overflow: hidden; /* prevent any child from causing horizontal shift */
}

.story-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.45);
    background: #000;
    display: block;
}

.story-nav {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    cursor: pointer;
    border: none;
    background: transparent;
    opacity: 0;
}

.story-prev {
    left: 0;
}

.story-next {
    right: 0;
}

.story-nav:hover {
    opacity: 0.1;
}

.story-actions {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.story-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-action-btn {
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.story-action-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.05);
}

.story-reply-input {
    position: absolute;
    bottom: max(14px, env(safe-area-inset-bottom, 14px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 8;
    width: calc(100% - 24px);
    max-width: 420px;
    padding: 8px 10px;
    border-radius: 16px;
    background: rgba(0,0,0,0.28);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}

.story-reply-input.active {
    opacity: 1;
    pointer-events: auto;
}

.story-reply-input input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 18px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 13px;
    outline: none;
    backdrop-filter: blur(4px);
    min-height: 42px;
}

.story-reply-input input::placeholder {
    color: rgba(255,255,255,0.5);
}

.story-reply-input input:focus {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}

.story-reply-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    font-weight: 600;
    flex-shrink: 0;
}

.story-reply-input button:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* Centered story caption display - full width, vertically centered */
.story-caption-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 7;
    width: 100%;
    max-width: 100%;
    text-align: center;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    padding: 14px 24px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    backdrop-filter: blur(6px);
    box-sizing: border-box;
}

.story-reply-input button .icon {
    width: 20px;
    height: 20px;
}

.story-viewer-info {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

/* Duration badge for video stories */
.story-duration-badge {
    display: none !important;
}

/* Owner-only delete near close button */
.story-delete {
    position: absolute;
    top: 12px;
    right: 56px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-delete:hover { background: rgba(0,0,0,0.7); }
    justify-content: center;
}
.story-delete:hover { background: rgba(0,0,0,0.7); }

.story-viewer-profile { display:flex; align-items:center; gap:10px; background:transparent; border:none; padding:0; color:white; cursor:pointer; }
.story-viewer-avatar { width:36px; height:36px; border-radius:50%; border:none; object-fit:cover; }
.story-viewer-info-text { display:flex; flex-direction:column; gap:2px; }
.story-viewer-username { color:white; font-weight:600; font-size:14px; }
.story-viewer-time { color:rgba(255,255,255,0.6); font-size:12px; }

/* Feed și Postări */
.feed {
    padding: 0 0 20px 0;
}

.post {
    background: var(--bg-primary);
    margin-bottom: 20px;
    border-radius: 0;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
    border-bottom: 1px solid var(--border);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-info {
    flex: 1;
}

.post-username {
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.post-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.post-content {
    width: 100%;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.post-content.has-media { aspect-ratio: 1; }
.post-content.no-media { padding: 8px 16px; }

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Carousel for multi-image posts - consolidated with main carousel rules below */


.post-actions {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    align-items: center;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    padding: 4px;
}

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

.action-btn.liked {
    color: var(--accent);
}

.action-btn.liked .icon {
    fill: var(--accent);
    stroke: var(--accent);
}

.post-likes {
    padding: 0 16px 8px;
    font-weight: 600;
    font-size: 14px;
}

.post-caption {
    padding: 0 16px 12px;
    font-size: 14px;
    line-height: 1.5;
}

.last-comment {
    padding: 0 16px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.last-comment:hover {
    color: var(--text-primary);
}

.comments-section {
    padding: 0 16px 0px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.comments-section.active {
    max-height: 500px;
}

.comment {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
}

.comment.is-reply {
    margin-left: 28px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
    background: rgba(var(--accent), 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.reply-to-badge {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.reply-to-badge strong {
    color: var(--accent);
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-username {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    cursor: pointer;
}

.comment-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.comment-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.comment-action {
    cursor: pointer;
}

.comment-action:hover {
    color: var(--accent);
}

.comment-input-wrapper {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    align-items: center;
}

.comment-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 14px;
}

.comment-input:focus {
    outline: none;
    border-color: var(--accent);
}

.reactions-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 8px 12px;
    display: none;
    gap: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    margin-bottom: 8px;
}

.reactions-panel.active {
    display: flex;
}

.reaction {
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction:hover {
    transform: scale(1.3);
}

/* Reels Headers */
.reels-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    z-index: 101;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.reels-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.messages-header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.messages-title {
    font-size: 20px;
    font-weight: 700;
}

.new-chat-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

/* Reels Container */
.reels-container {
    height: calc(100vh - var(--nav-height));
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.reels-container::-webkit-scrollbar {
    display: none;
}

.reel {
    height: calc(100vh - var(--nav-height));
    scroll-snap-align: start;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.reel-info {
    position: absolute;
    bottom: 70px;
    left: 16px;
    right: 16px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.reel-username {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reel-username svg {
    width: 14px;
    height: 14px;
    fill: var(--accent);
    stroke: var(--accent);
}

/* Call modal (design-only) */
.call-modal { position: fixed; inset: 0; display: none; z-index: 2200; }
.call-modal .call-backdrop { position: absolute; inset:0; background: rgba(0,0,0,0.6); }
.call-modal .call-panel { position: absolute; left:50%; top:50%; transform: translate(-50%,-50%); width:90%; max-width:420px; background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.3)); border-radius: 12px; padding: 16px; display:flex; flex-direction:column; gap:12px; align-items:center; box-shadow: 0 20px 50px rgba(0,0,0,0.7); }
.call-modal .call-panel .call-info { display:flex; gap:12px; align-items:center; width:100%; }
.call-avatar, .chat-info-avatar { width:56px; height:56px; border-radius:50%; overflow:hidden; background:var(--bg-secondary); }
.call-avatar img, .chat-info-avatar img { width:100%; height:100%; object-fit:cover; }
.call-username { font-weight:700; }
.call-controls { display:flex; gap:10px; }
.call-control { background:var(--bg-secondary); border:none; padding:12px 14px; border-radius:10px; cursor:pointer; }
.call-control.end { background: #ff4d4f; color:white; font-weight:700; }
.call-modal.active { display:block; }

/* Chat info panel */
.chat-info-panel { position: fixed; inset:0; display:none; z-index:2150; }
.chat-info-panel .chat-info-backdrop { position:absolute; inset:0; background: rgba(0,0,0,0.4); }
.chat-info-panel .chat-info-content { position: absolute; right: 12px; top: 80px; width: 340px; max-width: calc(100% - 40px); background: var(--bg-primary); border:1px solid var(--border); border-radius:12px; padding:12px; box-shadow: 0 20px 50px rgba(0,0,0,0.6); }
.chat-info-panel.active { display:block; }

@media (max-width: 768px) {
    .chat-info-panel .chat-info-content { 
        right: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        border-radius: 0;
        padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 8px) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 8px);
        padding-top: calc(env(safe-area-inset-top, 0) + 12px);
        overflow-y: auto;
    }
}
.chat-info-close { position:absolute; right:8px; top:8px; background:transparent; border:none; color:var(--text-secondary); font-size:16px; }
.chat-info-header { display:flex; align-items:center; gap:12px; padding:6px 0 12px 0; }
.chat-info-name { font-weight:700; }
.chat-info-handle { color:var(--text-secondary); font-size:13px; }
.chat-info-badge { margin-left:auto; font-size:12px; padding:6px 8px; border-radius:12px; background:linear-gradient(90deg,var(--accent),var(--accent-hover)); color:#fff; font-weight:700; }
.chat-info-actions { display:flex; gap:8px; margin-bottom:10px; }
.chat-info-actions button { flex:1; padding:8px; border-radius:8px; border:none; background:var(--bg-secondary); color:var(--text-primary); cursor:pointer; }
.chat-info-themes h4, .chat-info-media h4 { margin:8px 0; font-size:14px; }
.chat-theme-options { display:flex; gap:8px; flex-wrap:wrap; }
.chat-theme-options .theme-thumb { 
    width:50px;
    height:50px;
    display:flex; 
    flex-direction: column;
    align-items:center; 
    justify-content:center;
    border-radius:50%; 
    cursor:pointer; 
    border:2px solid var(--border); 
    padding: 0;
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
}

.chat-theme-options .theme-thumb:hover { 
    transform: scale(1.1); 
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(255, 0, 128, 0.25); 
}

.chat-theme-options .theme-thumb .theme-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: absolute;
    inset: 0;
}

.chat-theme-options .theme-thumb span {
    display: none;
}

.chat-info-full {
    padding: 16px;
    overflow-y: auto;
    height: 100%;
}

.chat-info-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 16px;
    margin-bottom: 16px;
}

.chat-info-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.info-btn {
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.info-btn:hover {
    background: var(--bg-primary);
}

.info-btn.primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.info-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.chat-media-gallery { 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 8px 0;
}

@media (max-width: 768px) {
    .chat-media-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}
.chat-media-gallery img, .chat-media-gallery video { 
    width: 100%;
    height: 100px;
    object-fit: cover; 
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-media-gallery img:hover, .chat-media-gallery video:hover {
    transform: scale(1.05);
}

/* Badges */
.user-badge { display:inline-block; padding:4px 8px; border-radius:12px; font-size:11px; font-weight:700; color:white; background:#666; margin-left:6px; }
.user-badge.admin { background: #ff4d4f; }
.user-badge.vip { background: #ffb86b; }
.user-badge.pro { background: #6c7cff; }

/* Chat themes (applied to .chat-container) */
.chat-theme-1 .chat-messages { background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0)); }
.chat-theme-2 .chat-messages { background: linear-gradient(180deg, #021b2b, #013144); }
.chat-theme-3 .chat-messages { background: linear-gradient(180deg, #07130a, #0b2a17); }
.chat-theme-4 .chat-messages { background: linear-gradient(180deg, #1a0a2e, #3b1148); }
.chat-theme-5 .chat-messages { background: radial-gradient(circle at 20% 10%, #00ffa3, transparent 20%), linear-gradient(180deg,#040714,#0b0f1a); }

.message-bubble { max-width: 78%; padding:10px 12px; border-radius:12px; margin:8px; position:relative; display:inline-block; transition: box-shadow 0.2s ease; }
.message-bubble.sent { background: var(--chat-outgoing-bg, var(--accent)); color: var(--chat-outgoing-text, #fff); margin-left: auto; }
.message-bubble.received { background: var(--chat-incoming-bg, var(--bg-secondary)); color: var(--chat-incoming-text, var(--text-primary)); margin-right: auto; }
.message-bubble .message-seen { font-size:11px; color:var(--text-secondary); margin-top:6px; text-align:right; }

/* Custom Audio Player */
.audio-player-wrapper { width: 100%; }
.audio-player {
    width: 100%;
    max-width: 280px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    accent-color: currentColor;
    cursor: pointer;
}
.audio-player::-webkit-media-controls-panel { background-color: transparent; }
.audio-player::-webkit-media-controls-enclosure { border-radius: 8px; }
.audio-player::-moz-media-controls { background-color: transparent; }
.message-bubble.sent .audio-player { accent-color: var(--chat-outgoing-text, #fff); }
.message-bubble.received .audio-player { accent-color: var(--chat-incoming-text, var(--text-primary)); }
/* Call page full-screen design */
#callPage { display:none; position:fixed; inset:0; z-index:3000; background:linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.8)); color:var(--text-primary); }
#callPage.active { display:flex; flex-direction:column; }
/* Chat header color via variable */
.chat-container .chat-header { background: var(--chat-header-bg, var(--bg-primary)); }

/* Allow wallpaper override via inline style variable (JS may set background directly on #chatMessages) */
.chat-container .chat-messages { background: var(--chat-wallpaper, initial); }
.call-page-content { margin-top: 60px; flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:18px; padding:20px; z-index: 99999; }
.call-bg-blur { position:absolute; inset:0; background: url('') center/cover no-repeat; filter: blur(12px) brightness(0.5); z-index:0; }
.call-avatar-large { position:relative; width:160px; height:160px; border-radius:50%; overflow:hidden; display:flex; align-items:center; justify-content:center; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.call-avatar-large img { width:100%; height:100%; object-fit:cover; }
.call-avatar-ring { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:190px; height:190px; border-radius:50%; pointer-events:none; }
.call-avatar-ring::before { content:''; position:absolute; inset:0; border-radius:50%; box-shadow: 0 0 40px rgba(0,0,0,0.6), 0 0 0 6px rgba(255,255,255,0.02) inset; }
.call-avatar-ring .ring-pulse { position:absolute; inset:-6px; border-radius:50%; border:2px solid rgba(255,255,255,0.06); animation: ringPulse 2s infinite; }
@keyframes ringPulse { 0% { transform: scale(0.9); opacity: 0.6;} 50% { transform: scale(1.08); opacity: 0.35;} 100% { transform: scale(0.9); opacity: 0.6;} }

.call-username { font-size:20px; font-weight:800; }
.call-status { color:var(--text-secondary); }

.call-controls { display:flex; gap:16px; align-items:center; z-index:2; }
.call-control { width:56px; height:56px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--bg-secondary); border:1px solid rgba(255,255,255,0.04); cursor:pointer; font-size:20px; }
.call-control.end { background: linear-gradient(90deg,#ff4d4f,#ff6b6b); color:white; box-shadow: 0 10px 30px rgba(255,77,79,0.18); }
.call-control:hover { transform: translateY(-3px); }

/* Hide bottom nav when call page active */
.page#callPage.active ~ .bottom-nav, .bottom-nav.call-hidden { display:none; }

/* Small responsive adjustments */
@media (max-width:520px) {
    .login-panel { width:100%; max-width:none; height:100vh; border-radius:0; border:none; box-shadow:none; margin:0; padding:24px; gap:16px; display:flex; flex-direction:column; justify-content:center; }
    .login-panel input { padding:14px; }
    .login-panel button { padding:14px 18px; }
    .login-panel .logo img { height:72px; }
    .login-panel .logo { font-size:36px; }
}
/* Ensure profile handle is centered regardless of back/settings buttons */
#profileHeader { position: relative; }
#profileHeader .profile-handle { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size:16px; }


.reel-caption {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.reel-music {
    font-size: 12px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reel-music svg {
    width: 12px;
    height: 12px;
}

.reel-actions {
    position: absolute;
    right: 16px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reel-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: white;
    cursor: pointer;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.reel-action-count {
    font-size: 11px;
    font-weight: 600;
}

.reel-reactions {
    position: absolute;
    right: 16px;
    bottom: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0,0,0,0.7);
    padding: 12px;
    border-radius: 20px;
    display: none;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.reel-reactions.active {
    display: flex;
}

.reel-reaction {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reel-reaction:hover {
    transform: scale(1.3);
}

/* Mesagerie */
.messages-list {
    padding: 16px;
}

.message-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.message-item.has-unread {
    background: rgba(255, 0, 128, 0.08);
}

.message-item.has-unread:hover {
    background: rgba(255, 0, 128, 0.15);
}

.message-item:hover {
    background: var(--bg-secondary);
}

.message-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.avatar-unread-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
}

/* Online/offline presence indicator */
.presence-indicator {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #22c55e; /* green */
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    z-index: 99;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
    pointer-events: none;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

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

.message-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.message-preview {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-preview.unread {
    color: var(--text-primary);
    font-weight: 500;
}

.message-unread {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-left: auto;
    align-self: center;
}

.message-unread-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

/* Chat */
.chat-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 1000;
    flex-direction: column;
}

.chat-container.active {
    display: flex;
}

.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-primary);
}

.chat-back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 24px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.chat-back-btn:hover {
    background: var(--bg-secondary);
}

.chat-user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

.chat-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-user-details {
    flex: 1;
}

.chat-username {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.2;
}

.chat-user-handle {
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-header-actions {
    display: flex;
    gap: 12px;
}

.chat-action-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-action-btn:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-secondary);
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
}

.message-content-wrapper > div:first-child {
    word-wrap: break-word;
    word-break: break-word;
}

.message-bubble.sent {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    align-self: flex-start;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-reaction {
    position: absolute;
    bottom: -14px;
    right: 12px;
    font-size: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-reaction:hover {
    transform: scale(1.08);
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.message-actions {
    position: absolute;
    top: -30px;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    display: none;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 100;
    pointer-events: auto;
}

.message-bubble:hover .message-actions {
    display: flex;
}

.message-action {
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.message-action:hover {
    background: var(--bg-primary);
}

.chat-input-container {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--bg-primary);
}

.chat-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-media-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px;
    border-radius: 50%;
    transition: all 0.2s;
}

.chat-media-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.chat-input {
    flex: 1;
    padding: 11px 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    min-height: 42px;
}
.chat-picker-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--nav-height) + 60px);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
    margin: 0 10px;
    z-index: 1200;
    max-height: 55vh;
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.chat-picker-panel.active { display: flex; }
.chat-picker-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.chat-picker-tab {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}
.chat-picker-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(255,0,128,0.25);
}
.chat-picker-search {
    display: flex;
    gap: 8px;
    align-items: center;
}
.chat-picker-search input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}
.chat-picker-search button {
    display: none;
}
.chat-picker-body {
    flex: 1;
    min-height: 120px;
    max-height: 999px;
    overflow-y: auto;
}
.chat-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 10px;
}
.chat-picker-emoji,
.chat-picker-sticker,
.chat-picker-gif {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    min-height: 50px;
}
.chat-picker-emoji:hover,
.chat-picker-sticker:hover,
.chat-picker-gif:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.chat-picker-emoji { font-size: 24px; }
.chat-picker-sticker img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}
.chat-picker-gif img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.chat-picker-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 18px 10px;
    font-size: 14px;
}
.chat-picker-loading {
    text-align: center;
    color: var(--accent);
    padding: 12px;
    font-weight: 700;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent);
}

.chat-send-btn {
    background: var(--accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

/* Profil */
.profile-header {
    padding: 20px 16px 0;
    position: relative;
}

.profile-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.profile-handle {
    font-size: 20px;
    font-weight: 700;
}

.profile-settings-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-settings-btn:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
}

.profile-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}

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

.profile-avatar .presence-indicator {
    width: 20px;
    height: 20px;
    border: 4px solid var(--bg-primary);
    bottom: -2px;
    right: -2px;
}

.profile-stats {
    flex: 1;
    display: flex;
    justify-content: space-around;
}

.stat {
    text-align: center;
    cursor: pointer;
}

.stat:hover .stat-number {
    color: var(--accent);
}

.stat-number {
    font-size: 18px;
    font-weight: 700;
    display: block;
    transition: color 0.2s;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-details {
    margin-bottom: 20px;
}

.profile-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-bio {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.profile-website {
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
}

.profile-website:hover {
    text-decoration: underline;
}

.profile-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.profile-action-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.profile-action-btn.primary {
    background: var(--accent);
    color: white;
}

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

.profile-action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.profile-tabs {
    display: flex;
    border-top: 1px solid var(--border);
    margin-bottom: 2px;
}

.profile-tab {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s;
    position: relative;
}

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

.profile-tab.active::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.profile-grid-item {
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: transparent;
    border-radius: 6px;
}

.profile-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

/* Login & Create Post modals */
.login-modal, .create-post-modal {
    position: fixed; inset:0; display:flex; align-items:center; justify-content:center; z-index:99999; pointer-events:auto;
}
.login-backdrop { position:absolute; inset:0; background: rgba(0,0,0,0.6); }
.create-backdrop { position:absolute; inset:0; background: var(--bg-primary); }
.login-panel, .create-panel { position:relative; background:var(--bg); padding:16px; border-radius:12px; width:360px; max-width:95%; z-index:100001; box-shadow:0 20px 60px rgba(0,0,0,0.6); }
/* Templated login styling */
.login-panel { width:420px; padding:24px; display:flex; flex-direction:column; gap:12px; align-items:stretch; border:1px solid var(--border); }
.login-panel input { padding:10px; border-radius:8px; border:1px solid rgba(255,255,255,0.06); background:var(--bg-secondary); color:var(--text-primary); }
.login-panel button { padding:10px 14px; border-radius:10px; border:none; background:var(--accent, #4d8cff); color:white; cursor:pointer; }
.login-panel .logo img { height:56px; }
.login-panel .logo { font-size:32px; font-weight:800; text-align:center; margin-bottom:6px; }
.login-panel .login-title { text-align:center; font-size:18px; margin-bottom:6px; }

/* New mobile-first login form */
.login-header { display:flex; flex-direction:column; align-items:center; gap:6px; }
.login-form { display:flex; flex-direction:column; gap:12px; }
.input-group { display:flex; flex-direction:column; gap:6px; }
.input-label { font-size:13px; color:var(--text-secondary); }
.input-field { width:100%; padding:12px 14px; border-radius:10px; border:1px solid var(--border); background:var(--bg-secondary); color:var(--text-primary); }
.input-field:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(var(--accent-rgb),0.15); }
.input-field.error { border-color:#ff4d4f; box-shadow:0 0 0 3px rgba(255,77,79,0.15); }
.login-actions { display:flex; align-items:center; justify-content:space-between; }
.login-actions .remember { font-size:13px; opacity:0.85; }
.login-actions .forgot { font-size:13px; color:var(--accent); text-decoration:none; }
.login-actions .forgot:hover { text-decoration:underline; }
.btn { display:block; width:100%; padding:12px 16px; border-radius:12px; border:none; font-weight:700; cursor:pointer; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color:white; }
.btn-secondary { background: var(--bg-secondary); color: var(--text-primary); }
.login-error { display:none; padding:10px 12px; border-radius:10px; border:1px solid rgba(255,77,79,0.4); background:rgba(255,77,79,0.08); color:#ff4d4f; font-size:13px; }

/* Create modal improved layout */
.create-panel { 
    width: 540px; 
    max-width: 95%;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
}
.message-bubble.media-only {
    background: transparent;
    border: none;
    padding: 4px;
    box-shadow: none;
}
.message-bubble.sticker-only {
    background: transparent !important;
    padding: 6px;
    border: none !important;
    box-shadow: none !important;
}
.message-bubble.sticker-only .message-time {
    text-align: right;
    opacity: 0.7;
    font-size: 11px;
}
.sticker-img {
    max-width: 180px;
    width: 140px;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}
.gif-thumb {
    max-width: 220px;
    border-radius: 12px;
    display: block;
}
    background: var(--bg-primary);
    margin-top: 20px;
}

.create-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.create-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.create-close-btn {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.create-close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.create-textarea-wrapper {
    position: relative;
    padding: 20px;
}

.create-textarea-wrapper textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
    resize: vertical;
    font-family: inherit;
}

.create-textarea-wrapper textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Mention suggestions */
.mention-suggestions {
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 20;
    display: none;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mention-item:hover {
    background: var(--bg-secondary);
}

.mention-item:last-child {
    border-bottom: none;
}

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

.mention-info {
    flex: 1;
}

.mention-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.mention-handle {
    font-size: 12px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .mention-suggestions {
        left: 0;
        right: 0;
        bottom: auto;
        top: auto;
        position: fixed;
        max-height: 200px;
    }

    .story-reply-input {
        width: calc(100% - 20px);
        max-width: none;
        bottom: max(10px, env(safe-area-inset-bottom, 10px));
    }

    .story-reply-input input {
        font-size: 14px;
    }

    .chat-input-container {
        padding: 12px 12px;
        gap: 10px;
    }

    .chat-input {
        padding: 11px 13px;
        border-radius: 16px;
        min-height: 40px;
    }

    .chat-send-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
    }

    .emoji-picker {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        right: auto;
        bottom: auto;
    }
}

/* Comment mention suggestions */
.comment-mention-suggestions {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-bottom: 4px;
}

.emoji-picker-btn {
    position: absolute;
    bottom: 26px;
    right: 26px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s;
}

.emoji-picker-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.emoji-picker {
    position: absolute;
    bottom: 70px;
    right: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10;
    width: min(360px, 92vw);
    max-height: 65vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
}

.emoji-item {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.emoji-item:hover {
    background: var(--bg-secondary);
    transform: scale(1.2);
}

.media-preview {
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.media-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

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

.media-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Story full-screen preview */
.media-preview-page { position: fixed; inset:0; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); z-index: 6000; display: flex; flex-direction: column; }
.media-preview-header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px; color:white; font-weight:700; }
.media-preview-header .btn-icon { background: rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.15); color:white; border-radius:50%; padding:0; cursor:pointer; width:36px; height:36px; display:flex; align-items:center; justify-content:center; font-size:18px; line-height:1; }
.media-preview-content { flex:1; display:flex; align-items:center; justify-content:center; padding:20px; }
.media-preview-content img, .media-preview-content video { max-width: min(520px, 96vw); max-height: 75vh; border-radius:14px; box-shadow:0 20px 60px rgba(0,0,0,0.45); }
.media-preview-footer { display:flex; align-items:center; gap:10px; padding:14px; background: rgba(0,0,0,0.65); backdrop-filter: blur(6px); flex-wrap: wrap; position: sticky; bottom: 0; width: 100%; padding-bottom: max(14px, env(safe-area-inset-bottom, 14px)); }
.media-preview-footer .caption-section { flex:1; min-width:200px; display:flex; align-items:center; }
.media-preview-footer .chat-input { background: rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.15); color:white; width:100%; }
.media-preview-footer .story-caption-input { height:44px; line-height:1.4; padding:10px 14px; border-radius:18px; resize:none; font-family:inherit; font-size:14px; overflow-y:auto; color:white; }
.media-preview-footer .btn-send { background: var(--accent); color: white; border:none; padding:10px 14px; border-radius:14px; cursor:pointer; display:flex; align-items:center; justify-content:center; min-width:48px; height:42px; }

/* Compact/collapsed post text styles */
.post-text { color: var(--text-primary); line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.post-text.compact { font-size: 16px; padding: 0; border-radius: 0; background: transparent; display: block; max-width: 100%; }
.post-text.collapsed { position: relative; max-height: 96px; overflow: hidden; }
.post-text.collapsed::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 28px; background: linear-gradient(180deg, rgba(0,0,0,0), var(--bg)); }
.read-more { display:inline-block; margin-top:6px; color: var(--accent); cursor:pointer; font-weight:600; }

/* Smaller media inside message bubbles */
.message-bubble img, .message-bubble video { max-width: 220px; max-height: 180px; border-radius: 8px; display:block; }

.youtube-preview {
    padding: 0 20px;
    margin-top: 10px;
}

.youtube-preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.youtube-preview-thumb {
    width: 120px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
}

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

.youtube-preview-info {
    flex: 1;
}

.youtube-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.youtube-preview-url {
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}

.youtube-preview-remove {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}

.create-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-buttons {
    width: 100%;
    display: flex;
    justify-content: center;
}

.media-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.media-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    width: 40px;
    height: 40px;
}

.media-btn span {
    display: none;
}

.media-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.media-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-cancel, .btn-publish {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-cancel:hover {
    background: rgba(0, 0, 0, 0.2);
}

.btn-publish {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    flex: 1;
}

.btn-publish:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb, 77, 140, 255), 0.4);
}

.create-preview img, .create-preview video, .create-preview iframe { border-radius:8px; }

/* Emoji settings */
.emoji-settings-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    min-height: 50px;
}

.emoji-setting-item {
    position: relative;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.emoji-setting-item:hover {
    background: var(--bg-primary);
    transform: scale(1.2);
}

.emoji-setting-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.emoji-setting-item:hover .emoji-setting-remove {
    opacity: 1;
}

.add-emoji-btn {
    margin-top: 8px;
    padding: 8px 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.add-emoji-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb, 77, 140, 255), 0.4);
}

/* Make login modal full-page feel */
.login-modal { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; z-index:99999; }
.login-backdrop { position:absolute; inset:0; background:rgba(0,0,0,1); z-index:99999; }
.login-panel { box-shadow: 0 30px 80px rgba(0,0,0,0.6); z-index:100001; }
.login-modal { align-items: stretch; }
.login-modal.cancelled .login-panel { display:none; }

/* Mobile-first full-height layout for login */
@media (max-width:600px) {
    .login-panel { width:94%; max-width:480px; padding:20px; gap:14px; }
    .login-panel input { padding:12px; }
    .login-panel button { padding:12px 16px; }
    .login-panel .logo img { height:64px; }
    .login-panel .logo { font-size:34px; }
}

/* Broader mobile/tablet support: make login truly full-viewport */
@media (max-width:820px) {
    .login-panel { width:100vw; max-width:none; height:100dvh; border-radius:0; border:none; box-shadow:none; margin:0; padding:clamp(16px,4vw,24px); gap:16px; display:flex; flex-direction:column; justify-content:center; }
    /* Safe-area aware horizontal padding to keep content visually centered */
    .login-panel { 
        padding-left: calc(clamp(16px, 6vw, 24px) + env(safe-area-inset-left, 0px));
        padding-right: calc(clamp(16px, 6vw, 24px) + env(safe-area-inset-right, 0px));
    }
}

/* Carousel controls */
.post-carousel { position:relative; display:block; width: 100%; height: 100%; }
.post-carousel .carousel-prev, .post-carousel .carousel-next { position:absolute; top:50%; transform:translateY(-50%); background:rgba(0,0,0,0.35); border:none; color:white; width:36px; height:56px; border-radius:8px; cursor:pointer; }
.post-carousel .carousel-prev, .post-carousel .carousel-next { display:none; }
.post-carousel .carousel-track { width:100%; height:100%; display:block; position:relative; overflow:hidden; }
.post-carousel .carousel-track [data-index] { position:absolute; top:0; left:0; display:none; width:100%; height:100%; }
.post-carousel .carousel-track img { width:100%; height:100%; object-fit:cover; border-radius:0; display:block; }
.post-carousel .carousel-track video { width:100%; height:100%; object-fit:cover; border-radius:0; background:black; display:block; }
.post-carousel .carousel-track .responsive-embed, .post-carousel .carousel-track .post-youtube-wrapper { width:100%; height:100%; display:block; }
.post-carousel .carousel-track iframe { width:100%; height:100%; border-radius:0; }

/* small video tweaks */
.post-video { position:relative; background:black; width:100%; height:100%; object-fit:cover; }
.post-video::before { content:'\25B6'; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:44px; height:44px; border-radius:50%; background:rgba(0,0,0,0.45); color:#fff; display:flex; align-items:center; justify-content:center; font-size:18px; pointer-events:none; }

/* Dots indicators */
.carousel-dots { display:flex; gap:6px; justify-content:center; margin-top:8px; }
.carousel-dot { width:12px; height:12px; border-radius:50%; background:rgba(255,255,255,0.9); border:1px solid rgba(0,0,0,0.12); cursor:pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.carousel-dot.active { background:var(--accent, #fff); box-shadow:0 0 0 6px rgba(0,0,0,0.06) inset; }

/* position dots overlayed on carousel so they're visible on small screens */
.post-carousel { position:relative; }
.post-carousel .carousel-dots { position:absolute; left:50%; transform:translateX(-50%); bottom:12px; z-index:20; }

/* responsive increase for touch targets */
@media (max-width:600px) {
    .carousel-dot { width:14px; height:14px; }
    .post-carousel .carousel-track { height:100%; }
    .login-panel { width:94%; max-width:420px; padding:20px; gap:12px; }
    .login-panel input { padding:12px; }
    .login-panel button { padding:12px 16px; }
    .login-panel .logo img { height:64px; }
    .login-panel .logo { font-size:34px; }
}

/* Login modal background effect */
.login-bg-effect { position:absolute; inset:0; z-index:100000; pointer-events:none; opacity:0.12; filter:blur(28px); background: linear-gradient(120deg, rgba(255,92,92,0.9), rgba(79,70,229,0.9), rgba(0,212,255,0.9)); mix-blend-mode:screen; animation: bgShift 8s linear infinite; }
@keyframes bgShift { 0%{transform:translateX(-10%)}50%{transform:translateX(10%)}100%{transform:translateX(-10%)} }

/* Lock body when modal open (applied via .modal-open class) */
.modal-open { overflow: hidden; height: 100%; }

/* responsive embed helper for iframes (YouTube) */
.responsive-embed { position:relative; width:100%; padding-top:56.25%; }
.responsive-embed iframe, .responsive-embed video { position:absolute; top:0; left:0; width:100%; height:100%; border-radius:8px; }

/* make iframes responsive in detail view */
.post-detail-media iframe { width:100%; aspect-ratio:16/9; border-radius:8px; }

/* Square-cover YouTube in feed to match image sizing */
.post-youtube-wrapper { position:relative; width:100%; height:100%; overflow:hidden; border-radius:8px; }
.post-youtube { position:absolute; top:0; left:50%; transform:translateX(-50%); height:100%; width:177.78%; }

/* Post detail modal styles */
.post-detail-modal { position:fixed; inset:0; display:flex; align-items:flex-start; justify-content:center; padding-top:60px; z-index:4000; }
.post-detail-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.6); }
#reportModal .post-detail-backdrop { background:var(--bg-primary); }
#reactionsModal .post-detail-backdrop { background:var(--bg-primary); }
#editPostModal .post-detail-backdrop { background:var(--bg-primary); }
.post-detail-panel { position:relative; z-index:2; width:880px; max-width:96%; background:var(--bg-primary); border-radius:12px; padding:12px; box-shadow:0 30px 80px rgba(0,0,0,0.6); }
.post-detail-back { position:absolute; left:12px; top:12px; background:transparent; border:none; font-size:20px; cursor:pointer; }
.post-detail-top { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 4px 12px; border-bottom:1px solid var(--border); margin-bottom:12px; }
.post-page-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border-bottom:1px solid var(--border); margin-bottom:12px; }
.detail-back-btn, .detail-menu-btn { background:var(--bg-secondary); border:1px solid var(--border); width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text-primary); }
.detail-title { flex:1; text-align:center; font-weight:600; color:var(--text-primary); }
.detail-menu-wrapper { position:relative; }
.detail-menu { position:absolute; top:46px; right:0; background:var(--bg-primary); border:1px solid var(--border); border-radius:10px; box-shadow:0 12px 30px rgba(0,0,0,0.25); min-width:160px; display:none; overflow:hidden; }
.detail-menu.active { display:block; }
.detail-menu-item { padding:10px 12px; cursor:pointer; color:var(--text-primary); }
.detail-menu-item:hover { background:var(--bg-secondary); }
.detail-menu-item.danger { color:#ff6b6b; }
.post-detail-header { display:flex; gap:10px; align-items:center; margin-bottom:12px; }
.post-detail-header .post-avatar img { width:48px; height:48px; border-radius:50%; }
.post-detail-media { margin-bottom:12px; }
.post-detail-caption { margin-bottom:12px; }
.post-detail-comments { max-height:220px; overflow:auto; border-top:1px solid rgba(255,255,255,0.03); padding-top:8px; }
.pd-comment { padding:8px 0; border-bottom:1px solid rgba(255,255,255,0.02); }
.pd-no-comments { opacity:0.7; padding:8px 0; }

.grid-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.grid-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    animation: fadeIn 0.3s ease;
}

.settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.settings-panel {
    position: relative;
    z-index: 2;
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.settings-back {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 24px;
    padding: 4px;
}

.settings-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 15px 0;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.setting-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-label span {
    flex: 1;
}

.setting-input {
    width: 100%;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    margin-top: 8px;
}

.setting-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Profile Modal */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.profile-modal.active {
    display: flex;
}

.profile-modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-primary);
}

.profile-modal-back {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 24px;
    padding: 4px;
}

.profile-modal-title {
    font-size: 18px;
    font-weight: 600;
}

.followers-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.follower-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background-color 0.2s;
}

.follower-item:hover {
    background: var(--bg-secondary);
}

.follower-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
}

.follower-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.follower-info {
    flex: 1;
}

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

.follower-username {
    font-size: 12px;
    color: var(--text-secondary);
}

.follow-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

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

.follow-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    width: 100%;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
    height: var(--nav-height);
    backdrop-filter: blur(10px);
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s;
    position: relative;
    width: 56px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn.active {
    color: var(--accent);
}

.nav-btn .icon {
    stroke: currentColor;
    width: 22px;
    height: 22px;
}

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

.create-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 0, 128, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.create-btn:hover {
    transform: scale(1.1) rotate(90deg);
}

@media (max-width: 500px) {
    .create-btn {
        width: 48px;
        height: 48px;
    }
}

/* create button inside bottom nav */
.bottom-nav .create-btn {
    margin-top: -18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

/* Post media types */
.post-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-text {
    padding: 16px;
    font-size: 16px;
    line-height: 1.4;
    color: var(--text-primary);
    background: var(--bg-primary);
}

/* Post Modal */
.post-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 2000;
}
.post-modal.active { display: block; }
.post-modal-backdrop { position:absolute; inset:0; background: rgba(0,0,0,0.6); }
.post-modal-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    width: 92%;
    max-width: 900px;
    max-height: 90%;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    gap: 12px;
}
.post-modal-close { position:absolute; right:8px; top:8px; background:none; border:none; color:var(--text-primary); font-size:18px; }
.post-modal-media { flex: 1; background:#000; display:flex; align-items:center; justify-content:center; }
.post-modal-media img, .post-modal-media video { width:100%; height:100%; object-fit:contain; }
.post-modal-info { width: 360px; padding: 12px; display:flex; flex-direction:column; gap:8px; overflow:auto; }
.post-modal-header { display:flex; gap:8px; align-items:center; }
.post-modal-avatar { width:44px; height:44px; border-radius:50%; overflow:hidden; }
.post-modal-avatar img { width:100%; height:100%; object-fit:cover; }
.post-modal-username { font-weight:700; }
.post-modal-caption { color:var(--text-primary); }
.post-modal-stats { font-weight:600; color:var(--text-secondary); }
.post-modal-comments { display:flex; flex-direction:column; gap:8px; }
.post-modal-addcomment { display:flex; gap:8px; margin-top:8px; }
.post-modal-addcomment input { flex:1; padding:8px; border-radius:8px; border:1px solid var(--border); background:var(--bg-secondary); color:var(--text-primary); }
.post-modal-addcomment button { background:var(--accent); color:white; border:none; padding:8px 12px; border-radius:8px; }

.comment-send-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-send-btn:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
}

.comment-send-btn .icon {
    width: 18px;
    height: 18px;
    stroke: var(--accent);
}

.comment-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.comment-send-btn:disabled:hover {
    background: none;
    transform: none;
}

/* Stiluri pentru profil (comune pentru toți userii) */
.profile-back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-right: auto;
}

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

.profile-top-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.profile-handle {
    font-size: 16px;
    font-weight: 700;
    margin: 0 auto;
}

.profile-options-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

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

.profile-settings-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-left: auto;
}

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

.profile-content {
    padding: 20px 16px 0;
}

/* Badge pentru numărul de comentarii */
.comment-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Ascunde ultimul comentariu vizibil */
.last-comment {
    display: none !important;
}

/* Panel pentru reacții (like reactions) */
.reactions-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 8px 12px;
    display: none;
    gap: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 100;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.reactions-panel.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.reaction {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
}

.reaction:hover {
    transform: scale(1.3);
    background: rgba(255,255,255,0.1);
}

/* Pentru butonul de like să afișeze emoji-ul reacției */
.action-btn.liked .icon {
    opacity: 0;
}

.action-btn.liked::after {
    content: attr(data-reaction);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
}

/* Stil pentru butonul de like cu reacție */
.action-btn[data-reaction] .icon {
    display: none;
}

.action-btn[data-reaction]::before {
    content: attr(data-reaction);
    font-size: 18px;
}

/* Header pentru notificări */
.notifications-header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    height: 60px;
}

.notifications-title {
    font-size: 20px;
    font-weight: 700;
}

/* Badge pentru notificări necitite */
.icon-btn .notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    pointer-events: none;
}

/* Badge for unread messages */
.unread-messages-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 10;
}

/* Container pentru notificări */
.notifications-container {
    padding: 16px;
}

/* Item de notificare */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.unread {
    border-left-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.notification-item.unread:hover {
    background: rgba(var(--accent-rgb), 0.1);
}

.notification-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-content {
    flex: 1;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.notification-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
    flex: 1;
}

.notification-text strong {
    font-weight: 600;
    cursor: pointer;
}

.notification-time {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 10px;
    flex-shrink: 0;
}

.notification-details {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.3;
}

.notification-details.mention {
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 10px;
    margin-top: 8px;
    border-left: 3px solid var(--accent);
}

.notification-reaction {
    font-size: 18px;
    margin-left: 4px;
    display: inline-block;
}

.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.notification-action-btn {
    padding: 6px 12px;
    border-radius: 15px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-action-btn.primary {
    background: var(--accent);
    color: white;
}

.notification-action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.notification-action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Indicator vizual pentru notificări necitite */
.unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 6px;
    margin-left: 8px;
}

/* Când nu sunt notificări */
.notifications-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.notifications-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.notifications-empty-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.notifications-empty-subtext {
    font-size: 14px;
}

/* Filtre pentru notificări */
.notification-filters {
    display: flex;
    gap: 8px;
    padding: 16px;
    padding-bottom: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.notification-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.filter-btn:hover {
    background: var(--bg-secondary);
}

/* Pentru variabile de culoare RGB */
:root {
    --accent-rgb: 255, 0, 128;
}

body.light {
    --accent-rgb: 255, 0, 128;
}

body.sunset {
    --accent-rgb: 255, 107, 107;
}

body.ocean {
    --accent-rgb: 0, 212, 255;
}

/* Responsive */
@media (max-width: 500px) {
    .notification-item {
        padding: 12px;
    }
    
    .notification-avatar {
        width: 36px;
        height: 36px;
    }
    
    .notification-text {
        font-size: 13px;
    }
}

/* Stiluri pentru iconița de notificări */
.icon-btn[onclick*="notificationsPage"] .icon {
    stroke-width: 2;
}

/* Badge pentru notificări necitite */
.icon-btn .notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Stiluri pentru header-ul notificărilor */
.notifications-header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    height: 60px;
}

.notifications-title {
    font-size: 20px;
    font-weight: 700;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.notifications-header .icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive design for create post modal */
@media (max-width: 768px) {
    .create-panel {
        width: 95% !important;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
        overflow-y: auto;
    }
    
    .create-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .create-textarea-wrapper {
        padding: 16px;
    }
    
    .create-textarea-wrapper textarea {
        min-height: 100px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .emoji-picker {
        position: fixed;
        bottom: auto;
        right: auto;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        max-height: 70vh;
        width: 90%;
        max-width: 400px;
        z-index: 100;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
        max-height: 400px;
    }
    
    .media-preview {
        padding: 0 16px;
        max-height: 180px;
    }
    
    .media-preview-item {
        width: 80px;
        height: 80px;
    }
    
    .create-actions {
        flex-wrap: wrap;
        padding: 12px 16px;
    }
    
    .media-buttons {
        width: 100%;
        order: 2;
    }
    
    .action-buttons {
        width: 100%;
        order: 1;
    }
    
    .media-btn {
        flex: 1;
        justify-content: center;
    }
    
    .btn-cancel, .btn-publish {
        flex: 1;
    }
    
    .post-detail-panel {
        width: 95% !important;
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 12px;
    }
    
    .post-page-header {
        padding: 10px 12px;
        flex-wrap: nowrap;
    }
    
    .detail-back-btn, .detail-menu-btn {
        min-width: 40px;
        flex-shrink: 0;
    }
    
    .detail-title {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 480px) {
    .create-panel {
        width: 100% !important;
        border-radius: 16px 16px 0 0;
    }
    
    .create-textarea-wrapper textarea {
        min-height: 80px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .media-preview-item {
        width: 70px;
        height: 70px;
    }

    .chat-input-container {
        padding: 10px 10px;
        gap: 8px;
    }

    .chat-input {
        padding: 11px;
        min-height: 38px;
        font-size: 13px;
    }

    .chat-send-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
    }

    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Loading indicator for infinite scroll */
.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-indicator .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#posts-sentinel {
    height: 1px;
    visibility: hidden;
}

/* Share post modal */
.share-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    padding-top: 10vh;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.share-modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.share-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.share-modal-search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.share-modal-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.share-modal-search input::placeholder {
    color: var(--text-secondary);
}

.share-users-list {
    overflow-y: auto;
    flex: 1;
}

.share-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.share-user-item:hover {
    background: var(--bg-secondary);
}

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

.share-user-info {
    flex: 1;
    min-width: 0;
}

.share-user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.share-user-handle {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Share toast notification */
.share-toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 3000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.message-story-preview { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-secondary); }
.message-story-preview img, .message-story-preview video { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.message-story-preview video { background: #000; }
.message-story-preview.expired { display:flex; align-items:center; justify-content:center; min-height:120px; color:var(--text-secondary); font-style:italic; }
.message-story-label { font-size: 12px; color: var(--text-secondary); padding: 6px 10px 0; text-transform: uppercase; letter-spacing: 0.5px; }

.message-shared-post {
    margin: 8px 0;
    border: 2px solid var(--accent);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    padding: 8px;
    max-width: 280px;
    box-sizing: border-box;
    transition: transform 0.2s ease;
}

.shared-post-header {
    font-size: 11px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-shared-post img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin: 6px 0;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.shared-post-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
    padding: 6px 0;
    word-wrap: break-word;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Emoji Picker */
.emoji-picker-modal { display: none; position: fixed; inset: 0; z-index: 100003; }
.emoji-picker-modal.active { display: flex; }
.emoji-picker-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.emoji-picker-container {
    position: absolute;
    bottom: 80px;
    left: 10px;
    width: 360px;
    max-width: calc(100vw - 20px);
    height: 380px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
}
.emoji-picker-body { display:flex; height:100%; }
.emoji-picker-tabs { width:110px; background: var(--bg-primary); border-right:1px solid var(--border); display:flex; flex-direction:column; gap:6px; padding:10px; }
.emoji-picker-main { flex:1; display:flex; flex-direction:column; }
.emoji-tab { padding:8px 10px; border:none; background:transparent; color:var(--text-primary); font-size:13px; cursor:pointer; border-radius:8px; text-align:left; transition: background 0.2s; }
.emoji-tab.active { background: var(--accent); color: white; }
.emoji-search-row { padding:8px; border-bottom:1px solid var(--border); display:flex; gap:6px; }
.emoji-search { flex:1; padding:6px 8px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 12px; }
.emoji-picker-content { overflow-y: auto; overflow-x: hidden; padding: 10px; flex: 1; }
.emoji-picker-content::-webkit-scrollbar { width: 4px; }
.emoji-picker-content::-webkit-scrollbar-track { background: var(--bg-primary); border-radius: 2px; }
.emoji-picker-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.emoji-picker-content::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1px;
}
.sticker-grid, .gif-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.emoji-item {
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
    user-select: none;
}
.emoji-item:hover {
    background: var(--bg-primary);
    transform: scale(1.15);
}
.emoji-item:active {
    transform: scale(0.95);
}
.sticker-item, .gif-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s;
    background: var(--bg-primary);
    position: relative;
}
.sticker-item:hover, .gif-item:hover {
    transform: scale(1.05);
}
.sticker-item img, .gif-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Message media + ephemeral labels */
.message-media { margin: 8px 0; }
.message-ephemeral {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
}

#serverOfflineError {
    animation: slideDown 0.3s ease;
}