/* --- CSS VARIABLES & THEME --- */
        :root {
            --primary-color: #0e87d8; /* fallback; ditimpa oleh header.php inject dari DB */
            --badge-green-bg: #00ba7c;
            --glass-blur: blur(12px);
            --scroll-w: 0px;
        }

        /* Dark mode: default (html[data-theme="dark"] ATAU belum ada data-theme) */
        :root,
        html[data-theme="dark"] {
            --bg-body: #000000;
            --text-main: #e7e9ea;
            --text-muted: #71767b;
            --border-color: #2f3336;
            --border-community: #0080ff;
            --glass-bg: rgba(0, 0, 0, 0.85);
            --card-hover: rgba(255, 255, 255, 0.1);
            --input-bg: #0b0d0e;
            --card-bg: #070808;
            --modal-bg: #000000;
        }

        /* Light mode: aktif saat html[data-theme="light"] — diset PHP SEBELUM body dirender */
        html[data-theme="light"] {
            --bg-body: #ffffff;
            --text-main: #0f1419;
            --text-muted: #536471;
            --border-color: #eff3f4;
            --border-community: #0080ff;
            --glass-bg: rgba(255, 255, 255, 0.85);
            --card-hover: rgba(0, 0, 0, 0.05);
            --input-bg: #eff3f4;
            --card-bg: #f7f9f9;
            --modal-bg: #ffffff;
        }

        /* Tetap support class-based untuk toggle JS */
        body.light-mode {
            --bg-body: #ffffff;
            --text-main: #0f1419;
            --text-muted: #536471;
            --border-color: #eff3f4;
            --border-community: #0080ff;
            --glass-bg: rgba(255, 255, 255, 0.85);
            --card-hover: rgba(0, 0, 0, 0.05);
            --input-bg: #eff3f4;
            --card-bg: #f7f9f9;
            --modal-bg: #ffffff;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

        body {
            background-color: var(--bg-body);
            color: var(--text-main);
            overflow-x: hidden;
            overflow-y: auto;
            transition: background-color 0.3s ease, color 0.3s ease;
            font-size: 15px;
        }

        /* Nonaktifkan semua transition saat halaman pertama kali dimuat, cegah flash tema */
        body.no-transition,
        body.no-transition * {
            transition: none !important;
        }

        ::-webkit-scrollbar { width: var(--scroll-w); }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
        ::-webkit-scrollbar-thumb:hover { background-color: var(--text-muted); background-clip: content-box; }

        a { text-decoration: none; color: inherit; cursor: pointer; }
        ul { list-style: none; }
        button { border: none; background: none; cursor: pointer; color: inherit; font-family: inherit; }

        .layout-container {
            max-width: 1300px;
            margin: 0 auto;
            position: relative;
            display: block;
            min-height: 100vh;
        }

        .sidebar-left, .sidebar-right {
            height: 100vh;
            position: fixed;
            top: 0;
            padding: 0 12px;
            display: flex; flex-direction: column;
            z-index: 100;
            background-color: var(--glass-bg);
            backdrop-filter: var(--glass-blur);
            -webkit-backdrop-filter: var(--glass-blur);
            border-right: 1px solid transparent;
            border-left: 1px solid transparent;
            padding-bottom: 20px;
        }

        .sidebar-left {
            width: 275px;
            left: max(0px, calc((100vw - 1300px) / 2));
            border-right: 1px solid var(--border-color);
            overflow-y: hidden;
        }

        .sidebar-right {
            width: 350px;
            right: max(0px, calc((100vw - 1300px) / 2));
            border-left: 1px solid var(--border-color);
            border-right: none;
            overflow-y: auto;
        }

        .sidebar-right::-webkit-scrollbar { width: 0px; background: transparent; }

        .logo-area {
            width: 100%;
            padding: 12px 0;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            border-bottom: 1px solid var(--border-color);
            border-radius: 0;
            margin-bottom: 10px;
            margin-top: 0;
            background-color: transparent;
        }

        .logo-area:hover { background-color: var(--bg-bodyr); }

        .logo-img {
            width: 30px;
            height: 30px;
            margin-left: 16px;
        }

        .nav-menu { margin-top: 10px; flex-grow: 1; }

        .nav-item {
            display: flex; align-items: center; padding: 12px 16px;
            border-radius: 9999px;
            margin-bottom: 4px; font-size: 20px; font-weight: 400;
            transition: background-color 0.2s; cursor: pointer;
            width: fit-content;
        }

        .nav-item:hover { background-color: var(--card-hover); }
        .nav-item i { font-size: 26px; margin-right: 20px; display: flex; align-items: center; }
        .nav-item.active { font-weight: 700; }

        .post-btn-sidebar {
            background-color: var(--primary-color); color: white;
            width: 90%; max-width: 100%; padding: 15px 0; border-radius: 9999px; font-weight: 700; font-size: 17px;
            margin-top: 15px; box-shadow: none; transition: opacity 0.2s;
            box-sizing: border-box; display: block; text-align: center;
        }

        .post-btn-sidebar:hover { opacity: 0.9; }

        .user-profile-mini {
            display: flex; align-items: center; padding: 10px;
            border-radius: 9999px;
            margin-top: auto; margin-bottom: 10px; cursor: pointer;
        }

        .user-profile-mini:hover { background-color: var(--card-hover); }

        .user-avatar-mini { width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; object-fit: cover; }
        .user-info-mini { flex-grow: 1; line-height: 1.2; overflow: hidden; }
        .user-name-mini { font-weight: 700; font-size: 15px; display: block; white-space: nowrap; text-overflow: ellipsis; }
        .user-handle-mini { color: var(--text-muted); font-size: 15px; }
        .user-dots { color: var(--text-main); font-size: 20px; margin-left: 10px; }

        .more-dropdown { position: absolute; bottom: 80px; left: 20px; width: 250px; background-color: var(--bg-body); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: 0 0 15px rgba(255,255,255,0.1); padding: 8px 0; display: none; z-index: 200; overflow: hidden; }
        .more-dropdown.show { display: block; }
        .more-item { padding: 12px 20px; display: flex; align-items: center; font-size: 15px; cursor: pointer; }
        .more-item:hover { background-color: var(--card-hover); }
        .more-item i { margin-right: 15px; font-size: 20px; }

        .language-dropdown { position: absolute; bottom: 80px; left: 20px; width: 200px; background-color: var(--bg-body); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: 0 0 15px rgba(255,255,255,0.1); padding: 8px 0; display: none; z-index: 200; overflow: hidden; }
        .language-dropdown.show { display: block; }
        .lang-item { padding: 12px 20px; display: flex; align-items: center; font-size: 15px; cursor: pointer; }
        .lang-item:hover { background-color: var(--card-hover); }
        .lang-item i { margin-right: 12px; font-size: 16px; }

        .timeline {
            margin-left: 275px;
            margin-right: 350px;
            min-height: 100vh;
            border-right: 1px solid var(--border-color);
            border-left: 1px solid var(--border-color);
            position: relative;
        }

        .timeline-header {
            position: sticky;
            top: 0;
            z-index: 90;
            background-color: var(--glass-bg);
            backdrop-filter: var(--glass-blur);
            -webkit-backdrop-filter: var(--glass-blur);
            border-bottom: 1px solid var(--border-color);
            width: 100%;
            transition: background-color 0.3s ease;
        }

        .tab-control { height: 53px; display: flex; align-items: center; justify-content: center; }
        .tab-item { flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: 500; cursor: pointer; color: var(--text-muted); position: relative; transition: background-color 0.2s; }
        .tab-item:hover { background-color: var(--card-hover); }
        .tab-item.active { color: var(--text-main); font-weight: 700; }
        .tab-indicator { position: absolute; bottom: 0; width: 56px; height: 4px; background-color: var(--primary-color); border-radius: 2px; display: none; left: 50%; transform: translateX(-50%); }
        .tab-item.active .tab-indicator { display: block; }

        .composer { padding: 16px; display: flex; border-bottom: 1px solid var(--border-color); position: relative; z-index: 1; }
        .composer-avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; object-fit: cover; }
        .composer-content { flex: 1; position: relative; }
        .composer-input { width: 100%; background: transparent; border: none; color: var(--text-main); font-size: 20px; resize: none; outline: none; padding-top: 10px; min-height: 24px; margin-bottom: 2px; }
        .composer-input::placeholder { color: var(--text-muted); }

        .reply-settings-trigger { display: none; align-items: center; color: var(--primary-color); font-size: 14px; margin-bottom: 12px; cursor: pointer; border: 1px solid var(--primary-color); border-radius: 20px; padding: 4px 12px; font-weight: 500; position: relative; }
        .reply-settings-trigger:hover { background-color: rgba(14, 135, 216, 0.1); }
        .reply-settings-trigger i { margin-right: 4px; }

        .composer-tools { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-color); padding-top: 12px; }
        .tool-icons { display: flex; gap: 4px; }
        .tool-btn { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-size: 18px; transition: background-color 0.2s; }
        .tool-btn:hover { background-color: rgba(14, 135, 216, 0.1); }
        .post-btn-small { background-color: var(--primary-color); color: white; padding: 8px 16px; border-radius: 20px; font-weight: 700; font-size: 15px; opacity: 0.5; pointer-events: none; }
        .post-btn-small.active { opacity: 1; pointer-events: auto; }

        .reply-dropdown {
            position: fixed;
            width: 300px;
            background-color: var(--modal-bg);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 16px;
            display: none;
            z-index: 200;
            box-shadow: 0 0 15px rgba(0,0,0,0.5);
            top: 0;
            left: 0;
        }
        .reply-dropdown.show { display: block; animation: fadeIn 0.2s ease; }
        .rd-header { font-weight: 800; font-size: 20px; margin-bottom: 12px; }
        .rd-item { display: flex; align-items: center; padding: 12px 0; cursor: pointer; border-radius: 10px; }
        .rd-item:hover { background-color: var(--card-hover); }
        .rd-icon { width: 30px; color: var(--primary-color); font-size: 20px; margin-right: 12px; }
        .rd-text div:first-child { font-weight: 700; font-size: 15px; }
        .rd-text div:last-child { color: var(--text-muted); font-size: 14px; }
        .rd-check { margin-left: auto; color: var(--primary-color); display: none; }
        .rd-item.selected .rd-check { display: block; }
        .rd-desc { font-size: 14px; color: var(--text-muted); margin: 16px 0; line-height: 1.4; }

        .post { padding: 12px 16px; display: flex; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background-color 0.2s; }
        .post:hover { background-color: rgba(255,255,255,0.02); }
        .post-avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; object-fit: cover; flex-shrink: 0; cursor: pointer; }
        .post-body { flex: 1; min-width: 0; }
        .post-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
        .post-meta { display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; }
        .post-name { font-weight: 700; color: var(--text-main); cursor: pointer; }

        .badge { display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; vertical-align: middle; cursor: pointer; width: auto; height: auto; }

        .post-handle { color: var(--text-muted); cursor: pointer; }
        .post-handle:hover { text-decoration: underline; }
        .post-time { color: var(--text-muted); }
        .post-content { margin-bottom: 8px; line-height: 1.5; color: var(--text-main); white-space: pre-wrap; }
        .post-location-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--primary-color); font-size: 13px; margin-bottom: 6px; }
        .post-location-tag i { font-size: 12px; flex-shrink: 0; }
        .post-image { width: 100%; border-radius: 16px; border: 1px solid var(--border-color); margin-top: 10px; overflow: hidden; }
        .post-image img { width: 100%; height: auto; display: block; }

        .post-actions { display: flex; justify-content: space-between; margin-top: 12px; }
        .action-item { display: flex; align-items: center; color: var(--text-muted); font-size: 13px; transition: color 0.2s; background: transparent; }

        .action-item i {
            margin-right: 0;
            font-size: 18px;
            width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background-color 0.2s;
        }
        /* ------------------------------------------------ */

        .action-item:hover.blue { color: var(--primary-color); }
        .action-item:hover.blue i { background-color: rgba(29, 155, 240, 0.1); }
        .action-item:hover.green { color: var(--badge-green-bg); }
        .action-item:hover.green i { background-color: rgba(0, 186, 124, 0.1); }
        .action-item:hover.pink { color: #f91880; }
        .action-item:hover.pink i { background-color: rgba(249, 24, 128, 0.1); }

        .action-item.bookmark:hover { color: var(--primary-color); }
        .action-item.bookmark:hover i { background-color: rgba(29, 155, 240, 0.1); }

        .action-item.share:hover { color: var(--primary-color); }
        .action-item.share:hover i { background-color: rgba(29, 155, 240, 0.1); }

        .user-list-container { padding: 12px 16px; }
        .user-list-item {
            display: flex; align-items: flex-start; padding: 12px 0;
            border-bottom: 1px solid var(--border-color); cursor: pointer;
        }
        .user-list-item:hover { background-color: rgba(255,255,255,0.02); }
        .user-list-avatar { width: 48px; height: 48px; border-radius: 50%; margin-right: 12px; cursor: pointer; }
        .user-list-content { flex: 1; }
        .user-list-header { display: flex; justify-content: space-between; align-items: center; }
        .user-list-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; cursor: pointer; }
        .user-list-handle { color: var(--text-muted); font-size: 14px; }
        .user-list-bio { font-size: 14px; color: var(--text-main); margin-top: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .user-list-stats { display: flex; font-size: 13px; color: var(--text-muted); margin-top: 4px; }
        .user-list-stats span { margin-right: 12px; }
        .user-list-stats b { color: var(--text-main); }
        .btn-follow-list {
            background-color: var(--text-main); color: var(--bg-body);
            padding: 6px 16px; border-radius: 20px; font-weight: 700; font-size: 14px;
            transition: opacity 0.2s; margin-top: 4px; height: fit-content;
        }
        .btn-follow-list.following {
            background-color: transparent; border: 1px solid var(--border-color); color: var(--text-main);
        }
        .btn-follow-list:hover { opacity: 0.9; }

        .badge-popover {
            position: fixed; width: 300px; background-color: var(--bg-body);
            border: 1px solid var(--border-color); border-radius: 16px;
            box-shadow: 0 0 20px rgba(0,0,0,0.5); padding: 16px; z-index: 999999;
            display: none; pointer-events: none;
            visibility: hidden;
        }
        .badge-popover.show {
            display: block;
            visibility: visible;
            pointer-events: auto;
            animation: fadeIn 0.2s ease;
        }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        .bp-info { display: flex; gap: 12px; margin-bottom: 12px; }
        .bp-avatar { width: 60px; height: 60px; border-radius: 50%; }
        .bp-details { flex: 1; padding-top: 4px; }
        .bp-name { font-weight: 800; font-size: 18px; display: flex; align-items: center; }
        .bp-handle { color: var(--text-muted); font-size: 14px; margin-bottom: 4px; }
        .bp-bio { font-size: 14px; line-height: 1.4; color: var(--text-main); margin-bottom: 12px; }
        .bp-stats { display: flex; gap: 16px; font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
        .bp-stats b { color: var(--text-main); }
        .bp-actions { border-top: 1px solid var(--border-color); padding-top: 12px; }

        .btn-popover-follow {
            width: 100%;
            background-color: var(--primary-color);
            color: #ffffff;
            padding: 8px 0; border-radius: 20px; font-weight: 700; font-size: 15px;
            transition: opacity 0.2s;
        }
        .btn-popover-follow:hover { opacity: 0.9; }

        .btn-popover-follow.following {
            background-color: transparent; border: 1px solid var(--border-color); color: var(--text-main);
        }

        .welcome-container {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            min-height: 50px; padding: 60px 20px; text-align: center;
        }
        .welcome-title {
            font-size: 28px; font-weight: 800; margin-bottom: 16px; color: var(--text-main);
        }
        .welcome-desc {
            font-size: 15px; line-height: 1.5; margin-bottom: 32px; color: var(--text-muted); max-width: 600px;
        }
        .btn-welcome-cta {
            background-color: var(--primary-color); color: #ffffff; border: none;
            padding: 14px 32px; border-radius: 30px; font-weight: 700; font-size: 17px;
            cursor: pointer; width: fit-content; box-shadow: 0 4px 10px rgba(14, 135, 216, 0.3);
            transition: opacity 0.2s;
        }
        .btn-welcome-cta:hover { opacity: 0.9; }

        .search-container {
            position: sticky;
            top: 0;
            z-index: 50;
            background-color: var(--bg-body);
            backdrop-filter: var(--glass-blur);
            -webkit-backdrop-filter: var(--glass-blur);
            border-bottom: 1px solid var(--border-color);
            border-radius: 0;
            padding: 18px 0;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            width: 100%;
            border-left: none;
            border-right: none;
            border-top: none;
        }

        .search-container:focus-within {
            background-color: var(--bg-body);
            border-bottom: 1px solid var(--border-color);
        }
        .search-container i { color: var(--text-muted); margin-right: 12px; margin-left: 20px; }
        .search-input { background: transparent; border: none; outline: none; color: var(--text-main); width: 100%; font-size: 15px; }

        .widget-box { background-color: transparent; border-radius: 16px; border: 1px solid var(--border-color); margin-bottom: 20px; padding: 12px 16px; position: relative; }
        .widget-header { font-size: 20px; font-weight: 800; margin-bottom: 12px; }

        .premium-content h3 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
        .premium-content p { font-size: 15px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.4; }
        .btn-subscribe { background-color: var(--primary-color); color: white; padding: 12px 0; width: 100%; border-radius: 20px; font-weight: 700; }

        .trend-item { padding: 12px 0; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05); position: relative; }
        body.light-mode .trend-item { border-bottom: 1px solid rgba(0,0,0,0.05); }
        .trend-meta { font-size: 13px; color: var(--text-muted); display: flex; justify-content: space-between; }
        .trend-meta i { cursor: pointer; border-radius: 50%; padding: 4px; transition: background-color 0.2s; }
        .trend-meta i:hover { background-color: var(--card-hover); }
        .trend-title { font-weight: 700; font-size: 15px; margin: 2px 0; }
        .trend-count { font-size: 13px; color: var(--text-muted); }

        /* --- TREND DROPDOWN STYLES --- */
        .trend-dropdown {
            position: fixed;
            width: 300px;
            background-color: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            z-index: 1000;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            padding: 8px 0;
            display: none;
        }
        .trend-dropdown.show {
            display: block;
            animation: fadeIn 0.2s ease;
        }
        .trend-header {
            padding: 4px 16px 8px 16px;
            font-weight: 800;
            font-size: 16px;
            border-bottom: 1px solid transparent;
        }
        .trend-opt {
            padding: 10px 16px;
            cursor: pointer;
            font-size: 15px;
            color: var(--text-main);
            transition: background-color 0.2s;
            display: flex;
            align-items: center;
        }
        .trend-opt:hover {
            background-color: var(--card-hover);
        }
        /* Icon styling */
        .trend-opt i {
            margin-right: 12px;
            color: var(--text-muted);
            font-size: 18px;
        }
        /* Show more link di bawah popup trend report */
        .trend-show-more {
            display: block;
            padding: 10px 16px;
            color: var(--primary-color);
            font-size: 15px;
            text-decoration: none;
            border-top: 1px solid var(--border-color);
            margin-top: 4px;
            transition: background-color 0.2s;
        }
        .trend-show-more:hover {
            background-color: var(--card-hover);
            text-decoration: none;
        }
        /* ---------------------------------- */

        .follow-item { display: flex; align-items: center; padding: 12px 0; justify-content: space-between; }
        .follow-left { display: flex; align-items: center; }
        .follow-avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; cursor: pointer; }
        .follow-info { line-height: 1.2; }
        .follow-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; cursor: pointer; }
        .follow-handle { color: var(--text-muted); font-size: 14px; }
        .btn-follow { background-color: var(--text-main); color: var(--bg-body); padding: 6px 16px; border-radius: 20px; font-weight: 700; font-size: 14px; transition: opacity 0.2s; }
        .btn-follow:hover { opacity: 0.9; }

        .widget-footer-link {
            display: block;
            margin-top: 16px;
            margin-bottom: 4px;
            font-size: 15px;
            color: var(--primary-color);
            cursor: pointer;
            transition: opacity 0.2s;
        }
        .widget-footer-link:hover {
            text-decoration: none;
            opacity: 0.8;
        }

        .footer-links { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
        .footer-link:hover { text-decoration: underline; }
        .copyright { font-size: 13px; color: var(--text-muted); }

        .mobile-header { display: none; position: fixed; top: 0; left: 0; right: 0; background: var(--bg-body); z-index: 150; padding: 10px 16px; border-bottom: 1px solid var(--border-color); align-items: center; justify-content: space-between; }
        .hamburger { font-size: 24px; padding: 8px; }

        .mobile-nav-dock { display: none; }

        /* --- POST MENU DROPDOWN STYLES (NEW) --- */
        .post-menu-dropdown {
            position: fixed;
            width: 280px;
            background-color: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            z-index: 1000;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            padding: 8px 0;
            display: none;
        }
        .post-menu-dropdown.show {
            display: block;
            animation: fadeIn 0.2s ease;
        }
        .post-menu-opt {
            padding: 10px 16px;
            cursor: pointer;
            font-size: 15px;
            color: var(--text-main);
            transition: background-color 0.2s;
            display: flex;
            align-items: center;
        }
        .post-menu-opt:hover {
            background-color: var(--card-hover);
        }
        .post-menu-opt i {
            margin-right: 12px;
            color: var(--text-main);
            font-size: 18px;
        }
        /* ------------------------------------ */

        /* Tombol close (X) di dalam sidebar mobile */
        .sidebar-close-btn {
            display: none;
            position: absolute;
            top: 12px;
            right: 12px;
            background: none;
            border: none;
            color: var(--text-main);
            font-size: 22px;
            cursor: pointer;
            padding: 6px 8px;
            border-radius: 50%;
            line-height: 1;
            z-index: 5;
        }
        .sidebar-close-btn:hover { background-color: var(--card-hover); }

        @media (max-width: 1265px) {
            .layout-container { padding-top: 50px; }
            body { padding-bottom: 70px; }

            /* Tampilkan tombol close di mobile */
            .sidebar-close-btn { display: flex; align-items: center; justify-content: center; }

            /* Composer tools tidak overflow di mobile */
            .composer-tools {
                flex-wrap: wrap;
                gap: 4px;
                overflow: hidden;
            }
            .tool-icons {
                flex: 1;
                flex-wrap: nowrap;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
            }
            .tool-icons::-webkit-scrollbar { display: none; }
            .post-btn-small {
                flex-shrink: 0;
                white-space: nowrap;
            }

            .sidebar-left {
                position: fixed;
                left: 0;
                transform: translateX(-100%);
                transition: transform 0.3s;
                width: 280px;
                max-width: 85vw;
                background: var(--bg-body);
                z-index: 160;
                overflow-x: hidden;
                box-sizing: border-box;
            }
            .sidebar-left.active { transform: translateX(0); box-shadow: 2px 0 10px rgba(0,0,0,0.5); }

            /* Overlay gelap saat sidebar terbuka */
            .sidebar-overlay {
                display: none;
                position: fixed;
                inset: 0;
                background: rgba(0,0,0,0.5);
                z-index: 155;
            }
            .sidebar-overlay.active { display: block; }

            .sidebar-right { display: none; }

            .timeline {
                margin-left: 0;
                margin-right: 0;
                width: 100%;
                border: none;
            }

            .mobile-header { display: flex; }

            .reply-dropdown { left: 16px !important; right: 16px !important; width: auto !important; bottom: 20px; top: auto !important; border-radius: 16px; transform: none !important; }

            .badge-popover {
                width: 90%;
                left: 5% !important;
            }

            /* --- MOBILE NAV DOCK FIX --- */
            .mobile-nav-dock {
                display: flex;
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                width: 100%;
                height: 60px;
                background-color: var(--bg-body);
                border-top: 1px solid var(--border-color);
                z-index: 1000;
                justify-content: space-evenly;
                align-items: center;
                padding: 0 4px;
                padding-bottom: env(safe-area-inset-bottom);
                box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
                box-sizing: border-box;
                overflow: visible;
            }

            .dock-item {
                display: flex;
                align-items: center;
                justify-content: center;
                color: var(--text-muted);
                font-size: 24px;
                flex: 1 1 0;
                min-width: 0;
                height: 60px;
                border-radius: 0;
                transition: color 0.2s ease;
                cursor: pointer;
                position: relative;
            }

            #mobile-notif-badge {
                position: absolute !important;
                top: 8px !important;
                right: calc(50% - 20px) !important;
                pointer-events: none;
            }

            .dock-item:hover {
                color: var(--text-main);
            }

            .dock-item.active {
                color: var(--text-main);
            }

            .dock-btn-post {
                background-color: var(--primary-color);
                color: #ffffff;
                width: 52px;
                height: 52px;
                flex: 0 0 52px;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 26px;
                position: relative;
                top: -14px;
                border: 3px solid var(--bg-body);
                box-shadow: 0 4px 12px rgba(0,0,0,0.35);
                transition: transform 0.2s;
            }

            .dock-btn-post:hover {
                transform: scale(1.08);
            }
            .dock-btn-post:active {
                transform: scale(0.95);
            }
        }
        
        
        /* --- SHARE DROPDOWN STYLES (NEW) --- */
        .share-dropdown {
            position: fixed;
            width: 280px;
            background-color: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            z-index: 1000;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            padding: 8px 0;
            display: none;
        }
        .share-dropdown.show {
            display: block;
            animation: fadeIn 0.2s ease;
        }
        .share-opt {
            padding: 10px 16px;
            cursor: pointer;
            font-size: 15px;
            color: var(--text-main);
            transition: background-color 0.2s;
            display: flex;
            align-items: center;
        }
        .share-opt:hover {
            background-color: var(--card-hover);
        }
        .share-opt i {
            margin-right: 12px;
            color: var(--text-main);
            font-size: 18px;
        }
        /* ------------------------------------ */

        .hidden { display: none !important; }
        .spinner {
            width: 20px;
            height: 20px;
            border: 2px solid var(--border-color);
            border-top-color: var(--primary-color);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        /* --- SIDEBAR SKELETON (PHASE 1) --- */

        .sk-widget { margin-bottom: 20px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--border-color); }
        
        /* Search Skeleton */
        .sk-search { 
            height: 44px; 
            border-radius: 9999px; 
            border: 1px solid var(--border-color); 
            margin-bottom: 10px; 
            margin-top: 10px; 
            display: flex; 
            align-items: center; 
            padding: 0 20px; 
        }
        .sk-search-icon { width: 20px; height: 20px; background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%); background-size: 200% 100%; animation: loading 1.5s infinite; border-radius: 4px; margin-right: 12px; }
        .sk-search-input { flex: 1; height: 16px; background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%); background-size: 200% 100%; animation: loading 1.5s infinite; border-radius: 4px; }
        @keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

        /* Premium Skeleton */
        .sk-widget.premium-sk { margin-top: 0 !important; }
        
        /* Sk Title Premium */
        .sk-title { 
            height: 20px; 
            width: 45%;
            margin-bottom: 12px; 
            background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%); 
            background-size: 200% 100%; 
            animation: loading 1.5s infinite; 
            border-radius: 4px; 
        }
        
        .sk-premium-btn { width: 100%; height: 36px; margin-top: 16px; border-radius: 20px; background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%); background-size: 200% 100%; animation: loading 1.5s infinite; }

        .sk-widget.trends-sk {
            height: 425px;
            display: flex;
            flex-direction: column;
            padding-bottom: 12px;
        }

        .sk-widget.trends-sk .sk-title {
            flex-shrink: 0;
            margin-bottom: 16px;
            width: 55%;
            display: block;
        }

        .sk-trend-item {
            padding: 12px 0;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .sk-trend-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 4px;
        }

        .sk-trend-cat {
            width: 30%;
            height: 13px;
            background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            border-radius: 4px;
        }
        
        .sk-trend-dots {
            width: 16px;
            height: 16px;
            background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            border-radius: 50%;
        }
        
        .sk-trend-title {
            height: 15px;
            width: 70%;
            margin-bottom: 2px;
            background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            border-radius: 4px;
        }

        .sk-trend-count {
            height: 13px;
            width: 40%;
            background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            border-radius: 4px;
        }

        /* Who to Follow Skeleton (Height 400px) */
        .sk-widget.follow-sk {
            height: 400px;
            display: flex;
            flex-direction: column;
            padding-bottom: 12px;
        }

        .sk-widget.follow-sk .sk-title {
            flex-shrink: 0;
            margin-bottom: 16px;
            width: 50%;
            display: block;
        }

        .sk-follow-item {
            padding: 12px 0;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            display: flex;
            align-items: center;
            justify-content: space-between;
            min-height: 64px;
        }

        .sk-follow-left {
            display: flex;
            align-items: center;
            flex: 1;
            margin-right: 12px;
            min-width: 0;
        }

        .sk-follow-avatar {
            width: 40px; height: 40px;
            border-radius: 50%;
            margin-right: 12px;
            background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            flex-shrink: 0;
        }

        .sk-follow-info {
            display: flex;
            flex-direction: column;
            justify-content: center;
            width: 100%;
            min-width: 0;
        }

        .sk-follow-name {
            display: flex;
            align-items: center;
            width: 100%;
            margin-bottom: 4px;
            height: 16px;
            gap: 4px;
        }

        .sk-follow-name .skeleton {
            height: 100%;
            background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            border-radius: 4px;
            flex-shrink: 0;
        }

        .sk-follow-badge {
            width: 14px; height: 14px;
            background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            border-radius: 4px;
            flex-shrink: 0;
        }

        .sk-follow-handle {
            height: 13px;
            width: 60px;
            background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            border-radius: 4px;
        }

        .sk-follow-btn {
            width: 80px; height: 32px;
            border-radius: 20px;
            background: linear-gradient(90deg, var(--input-bg) 25%, var(--border-color) 50%, var(--input-bg) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            flex-shrink: 0;
        }
        
        /* Timeline Spinner Items */
        .post-spinner-item {
            margin: 16px 16px 0 16px;
            height: 240px;
            border: 1px solid var(--border-color);
            border-radius: 16px;
            display: flex;
            justify-content: center;
            align-items: center;
            background: rgba(255,255,255,0.01);
            position: relative;
        }
        body.light-mode .post-spinner-item {
            background: rgba(0, 0, 0, 0.02);
        }

        /* Sidebar Spinner Items */
        .sidebar-spinner-item {
            border: 1px solid var(--border-color);
            border-radius: 16px;
            margin-bottom: 16px;
            display: flex;
            justify-content: center;
            align-items: center;
            background: rgba(255,255,255,0.01);
            position: relative;
        }
        body.light-mode .sidebar-spinner-item {
            background: rgba(0, 0, 0, 0.02);
        }
        .sidebar-spinner-item.search-bar-sim {
            height: 44px;
            border-radius: 20px;
            margin-top: 10px;
            margin-bottom: 10px;
            min-height: unset;
        }
        .sidebar-spinner-item.premium-sim {
            min-height: 140px;
        }
        .sidebar-spinner-item.trend-sim {
            height: 400px;
        }
        .sidebar-spinner-item.follow-sim {
            height: 300px;
        }
        /* -------------------------------------- */
        
        /* --- THREAD PAGE STYLES (NEW) --- */

/* Navigasi Halaman Thread (Back Button & Title) */
.thread-nav-bar {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    height: 53px;
    z-index: 90;
}

.back-btn {
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-main);
    transition: background-color 0.2s;
}

.back-btn:hover {
    background-color: var(--card-hover);
}

.thread-nav-title {
    margin-left: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

/* Garis Pembatas & Statistik Balasan */
.thread-divider {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.thread-stats {
    margin: 0 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.thread-stats i { font-size: 16px; }

.divider-line {
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.reply-composer-container {
    padding: 12px 16px 16px 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-body);
}

.replying-to-info {
    margin-bottom: 4px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
}

.current-user-avatar-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.skeleton-loader {

}

@media (max-width: 1265px) {
    .thread-nav-bar {
        z-index: 95; 
    }
}

/* --- ACCOUNT DROPDOWN (LOGOUT) STYLES --- */
.account-dropdown {
    position: absolute;
    bottom: 80px;
    left: 20px;
    width: 250px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
    padding: 8px 0;
    display: none;
    z-index: 200;
    overflow: hidden;
}

.account-dropdown.show {
    display: block;
}

@media (max-width: 1265px) {
    .sidebar-left { z-index: 1001; }
}

/* ============ COMPOSER ENHANCEMENTS ============ */
.composer-image-preview, .composer-gif-preview {
    position: relative;
    margin: 8px 0;
    border-radius: 12px;
    overflow: hidden;
    max-height: 260px;
}

.composer-image-preview img, .composer-gif-preview img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

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

.composer-preview-remove:hover { background: rgba(0,0,0,0.9); }

/* Poll Builder */
.composer-poll-builder {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    margin: 12px 0;
    background: var(--bg-body);
}

.poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.poll-option-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.poll-image-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
}

.poll-image-btn:hover {
    background: var(--card-hover);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.poll-option-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.poll-option-input:focus { 
    border-color: var(--primary-color);
}

.poll-add-option {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin: 0;
    padding: 0;
}

.poll-add-option:hover { 
    background: rgba(29, 155, 240, 0.1);
    border-color: var(--primary-color);
}

.poll-duration-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.poll-duration-section > label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

.poll-duration-inputs {
    display: flex;
    gap: 12px;
}

.poll-duration-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.poll-duration-input-group label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.poll-duration-input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 15px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.poll-duration-input-group select:hover {
    border-color: var(--primary-color);
}

.poll-duration-input-group select:focus {
    border-color: var(--primary-color);
}

.poll-duration-error {
    color: #f4212e;
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 0;
}

.poll-reply-options {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.poll-reply-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.poll-reply-link:hover {
    background: rgba(29, 155, 240, 0.1);
}

.poll-reply-link i {
    font-size: 16px;
}

.poll-remove-btn {
    width: 100%;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.poll-remove-btn:hover { 
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Emoji Picker */
.composer-emoji-picker {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    margin: 8px 0;
    max-height: 180px;
    overflow-y: auto;
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.emoji-item {
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s;
    line-height: 1;
}

.emoji-item:hover { background: var(--card-hover); }

/* GIF Search */
.composer-gif-search {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    margin: 8px 0;
}

.composer-gif-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    margin-bottom: 8px;
    outline: none;
    box-sizing: border-box;
}

.composer-gif-search input:focus { border-color: var(--primary-color); }

.gif-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.gif-result-item {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.gif-result-item:hover { opacity: 0.8; }

/* Schedule Picker */
.composer-schedule-picker {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    margin: 8px 0;
}

.composer-schedule-picker label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.schedule-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    box-sizing: border-box;
}

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

.schedule-confirm-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 20px;
    background: var(--primary-color);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.schedule-cancel-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
}

/* Location Input */
.composer-location-input {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    margin: 8px 0;
}

.composer-location-input i {
    color: var(--primary-color);
    font-size: 18px;
}

.composer-location-input input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
}

.location-confirm-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 16px;
    background: var(--primary-color);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.location-cancel-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

/* Action Active States */
.action-item.active.pink i { color: #e0245e; }
.action-item.active.green i { color: #17bf63; }
.action-item.active.bookmark i { color: var(--primary-color); }

/* ============ RETWEET MODAL ============ */
.retweet-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(91, 112, 131, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.retweet-modal-content {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    padding: 4px 0;
    min-width: 200px;
    z-index: 10001;
    animation: fadeIn 0.15s ease;
}

.retweet-modal-opt {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s;
}

.retweet-modal-opt:hover {
    background-color: var(--card-hover);
}

.retweet-modal-opt i {
    font-size: 18px;
    color: var(--text-main);
}

/* ============ COMMENT MODAL ============ */
.comment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(91, 112, 131, 0.4);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5vh;
}

.comment-modal-container {
    background-color: var(--bg-body);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: fadeIn 0.2s ease;
}

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

.comment-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    background: none;
    border: none;
}

.comment-modal-close:hover {
    background-color: var(--card-hover);
}

/* =====================================================
   DRAFT PANEL
   ===================================================== */
.drafts-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-body);
    border-radius: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease;
    overflow: hidden;
}
.drafts-panel--visible {
    opacity: 1;
    transform: translateY(0);
}
.drafts-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.drafts-panel-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
}
.drafts-panel-close {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.drafts-panel-close:hover { background: var(--hover-bg); }
.drafts-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.drafts-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 14px;
}
.draft-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background .15s;
}
.draft-item:last-child { border-bottom: none; }
.draft-item:hover { background: var(--hover-bg); }
.draft-item-body {
    flex: 1;
    min-width: 0;
}
.draft-item-type {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}
.draft-item-owner {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.draft-item-content {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.45;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.draft-item-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}
.draft-item-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    font-size: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s;
}
.draft-item-delete:hover {
    color: #e0245e;
    background: rgba(224,36,94,.08);
}

.comment-modal-container {
    position: relative;
}

.comment-modal-draft {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}

.comment-modal-body {
    padding: 16px;
}

.comment-modal-original {
    display: flex;
    position: relative;
    padding-bottom: 16px;
}

.comment-modal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 12px;
    z-index: 1;
}

.comment-modal-thread-line {
    position: absolute;
    left: 19px;
    top: 48px;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.comment-modal-post-info {
    flex: 1;
    min-width: 0;
}

.comment-modal-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.comment-modal-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 15px;
}

.comment-modal-handle {
    color: var(--text-muted);
    font-size: 15px;
}

.comment-modal-content {
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-modal-replying {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

.comment-modal-reply {
    display: flex;
    padding-top: 8px;
}

.comment-modal-reply-content {
    flex: 1;
    min-width: 0;
}

.comment-modal-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    resize: none;
    outline: none;
    min-height: 80px;
    padding: 8px 0;
    font-family: inherit;
}

.comment-modal-textarea::placeholder {
    color: var(--text-muted);
}

.comment-modal-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 8px;
}

.comment-modal-icons {
    display: flex;
    gap: 4px;
}

.comment-modal-submit {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.comment-modal-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-modal-submit:not(:disabled):hover {
    opacity: 0.9;
}

@media (max-width: 1265px) {
    .comment-modal-container {
        max-width: 95%;
        margin: 0 auto;
    }
    .retweet-modal-content {
        position: fixed !important;
        top: auto !important;
        bottom: 80px !important;
        left: 50% !important;
        transform: translateX(-50%);
    }
}

/* ============ PROFILE PAGE STYLES ============ */
#profile-container {
    width: 100%;
}

.profile-nav-bar {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    height: 53px;
    z-index: 90;
}

@media (max-width: 1265px) {
    .profile-nav-bar {
        height: auto;
        min-height: 64px;
        align-items: flex-start;
        padding-top: 18px;
        padding-bottom: 8px;
    }
}

.profile-nav-title {
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-title-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.nav-title-count {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.3;
}

.profile-header {
    width: 100%;
}

.profile-cover {
    width: 100%;
    height: 200px;
    background-color: var(--input-bg);
    background-size: cover;
    background-position: center;
}

.profile-info-container {
    position: relative;
    padding: 0 16px;
    margin-bottom: 16px;
}

.profile-avatar-large {
    width: 134px;
    height: 134px;
    border-radius: 50%;
    border: 4px solid var(--bg-body);
    margin-top: -67px;
    object-fit: cover;
}

.profile-action-btn {
    position: absolute;
    right: 16px;
    top: 12px;
}

.btn-edit-profile, .btn-profile-follow {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 15px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-edit-profile:hover, .btn-profile-follow:hover {
    background-color: var(--card-hover);
}

  .btn-profile-follow {
  background-color: var(--text-main);
  color: var(--bg-body);
  border: none;
  }

  /* Hover biru khusus untuk tombol follow tamu (belum login) */
  .btn-profile-follow.guest-follow:hover {
  background-color: var(--primary-color) !important;
  color: #fff !important;
  opacity: 1;
  }

  .profile-details {
  padding: 16px 16px 16px;
  }
  
  .profile-name-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  margin-top: 0;
  }

.profile-name-badge h2 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}

.profile-name-badge i {
    font-size: 20px;
}

.profile-handle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.profile-bio {
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 12px;
    white-space: pre-wrap;
    line-height: 1.5;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--text-muted);
}

.profile-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-meta i {
    font-size: 16px;
}

.profile-meta a {
    color: var(--primary-color);
    text-decoration: none;
}

.profile-meta a:hover {
    text-decoration: underline;
}

.profile-stats {
    display: flex;
    gap: 20px;
}

.profile-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.profile-stat-item:hover {
    text-decoration: underline;
}

.profile-stat-item strong {
    color: var(--text-main);
    font-weight: 700;
}

        .profile-tabs {
            display: flex;
            justify-content: center;
            border-bottom: 1px solid var(--border-color);
        }

        .profile-tab {
            flex: 1;
            max-width: 150px;
            height: 53px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 500;
            cursor: pointer;
            color: var(--text-muted);
            position: relative;
            transition: background-color 0.2s;
        }

        .profile-tab:hover {
            background-color: var(--card-hover);
        }

        .profile-tab.active {
            color: var(--text-main);
            font-weight: 700;
        }

        .profile-tab.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 56px;
            height: 4px;
            background-color: var(--primary-color);
            border-radius: 2px;
        }

.profile-tab {
    flex: 1;
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    transition: background-color 0.2s;
}

.profile-tab:hover {
    background-color: var(--card-hover);
}

.profile-tab.active {
    color: var(--text-main);
    font-weight: 700;
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 56px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

#profile-posts-container {
    min-height: 400px;
}

/* ============ SEARCH PAGE STYLES ============ */
#search-container {
    width: 100%;
}

.search-nav-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    background-color: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
    height: 53px;
    z-index: 90;
}

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

.search-input-container i {
    color: var(--text-muted);
    font-size: 18px;
}

.search-input-header {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
}

.search-input-header::placeholder {
    color: var(--text-muted);
}

.search-settings-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 18px;
    transition: background-color 0.2s;
}

.search-settings-btn:hover {
    background-color: var(--card-hover);
}

        .search-tabs {
            display: flex;
            justify-content: center;
            border-bottom: 1px solid var(--border-color);
            overflow-x: auto;
        }

        .search-tabs::-webkit-scrollbar {
            display: none;
        }

        .search-tab {
            flex: 1;
            max-width: 150px;
            padding: 0 16px;
            height: 53px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 500;
            cursor: pointer;
            color: var(--text-muted);
            position: relative;
            transition: background-color 0.2s;
        }

        .search-tab:hover {
            background-color: var(--card-hover);
        }

        .search-tab.active {
            color: var(--text-main);
            font-weight: 700;
        }

        .search-tab.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 56px;
            height: 4px;
            background-color: var(--primary-color);
            border-radius: 2px;
        }

.search-tabs::-webkit-scrollbar {
    display: none;
}

.search-tab {
    flex-shrink: 0;
    padding: 0 16px;
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    transition: background-color 0.2s;
}

.search-tab:hover {
    background-color: var(--card-hover);
}

.search-tab.active {
    color: var(--text-main);
    font-weight: 700;
}

.search-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 56px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

#search-results-container {
    min-height: 400px;
}

/* Search Filter Widget */
.search-filter-widget {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.search-filter-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
}

.search-filter-section {
    margin-bottom: 16px;
}

.search-filter-section:last-child {
    margin-bottom: 0;
}

.search-filter-label {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.search-filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-filter-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
}

.search-filter-option span {
    font-size: 15px;
    color: var(--text-main);
}

.search-filter-option i {
    font-size: 20px;
    color: var(--primary-color);
}

.search-filter-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}





/* --- CUSTOM TOAST NOTIFICATION --- */
.notif-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--primary-color); /* Warna Biru Utama */
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 999px; /* Bentuk Kapsul/Pill */
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 20000; /* Di atas modal lain */
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); /* Efek memantul halus */
    pointer-events: none;
}

.notif-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.notif-toast i {
    font-size: 18px;
}

/* Agar tidak tertutup navigasi mobile */
@media (max-width: 1265px) {
    .notif-toast {
        bottom: 80px; 
    }
}


/* --- CUSTOM CONFIRM MODAL --- */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(91, 112, 131, 0.4);
    z-index: 20000; /* Paling atas */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.confirm-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirm-modal-content {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 320px;
    padding: 16px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.confirm-modal-overlay.show .confirm-modal-content {
    transform: scale(1);
}

.confirm-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    gap: 8px;
}

.btn-confirm-cancel {
    flex: 1;
    padding: 8px 0;
    border-radius: 20px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    transition: background-color 0.2s;
}

.btn-confirm-cancel:hover {
    background-color: var(--card-hover);
}

.btn-confirm-yes {
    flex: 1;
    padding: 8px 0;
    border-radius: 20px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    background-color: #f4212e; /* Merah Twitter untuk Hapus */
    color: white;
    border: none;
    transition: opacity 0.2s;
}

.btn-confirm-yes:hover {
    opacity: 0.9;
}

@media (max-width: 1265px) {
    .confirm-modal-content {
        max-width: 90%;
    }

    .search-nav-bar {
        padding: 38px 16px;
    }
}

/* ---- Private Account Wall ---- */
.private-account-wall {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.private-account-icon {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.private-account-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}
.private-account-desc {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 320px;
    line-height: 1.5;
}