/* =========================================================
   SOCIALWIKI - CSS (Full Design)
========================================================= */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    margin: 0;
    color: #050505;
}

/* =========================================================
   NAVBAR (أزرق)
========================================================= */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1877f2;
    padding: 0 16px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}


.logo {
    color: white;
    font-size: 26px;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
}

.logo-img {
    width: 40px ;
    height: 40px ;
    max-width: 40px ;
    max-height: 40px !;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    background: white;
    padding: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.logo span {
    font-size: 22px;
    font-weight: 800;
    color: white;
    white-space: nowrap;
}

.search-container {
    position: relative;
}

.search-container input {
    background: rgba(255,255,255,0.2);
    width: 240px;
    height: 40px;
    border-radius: 50px;
    border: none;
    padding: 0 15px;
    color: white;
    outline: none;
}

.search-container input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-results {
    position: absolute;
    top: 45px;
    left: 0;
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 9999;
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
}

.search-result-item:hover {
    background: #f0f2f5;
}

.search-result-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.search-result-name {
    font-weight: 600;
    font-size: 14px;
}

.search-result-username {
    font-size: 12px;
    color: #65676b;
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: #65676b;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-icons a {
    color: white;
    font-size: 20px;
    text-decoration: none;
    padding: 8px;
    border-radius: 50%;
}

.nav-icons a:hover {
    background: rgba(255,255,255,0.2);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 50px;
    transition: 0.2s;
}

.nav-profile:hover {
    background: rgba(255,255,255,0.1);
}

.nav-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-profile span {
    font-size: 14px;
    font-weight: 600;
}

.logout-button {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
}

.logout-button:hover {
    background: rgba(255,255,255,0.3);
}

/* =========================================================
   HAMBURGER BUTTON (يظهر فقط على الجوال)
========================================================= */

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    line-height: 1;
    margin-right: 5px;
}

.hamburger-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* =========================================================
   LANGUAGE SELECTOR
========================================================= */

.language-selector {
    position: relative;
}

.language-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 18px;
    color: white;
    transition: 0.2s;
}

.language-btn:hover {
    background: rgba(255,255,255,0.3);
}

.language-menu {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 9999;
    min-width: 150px;
    max-height: 400px;
    overflow-y: auto;
}

.language-menu.show {
    display: block;
}

.language-menu button {
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: white;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: 0.2s;
}

.language-menu button:hover {
    background: #f0f2f5;
}

/* =========================================================
   MAIN LAYOUT (3 columns)
========================================================= */

.main-container {
    display: grid;
    grid-template-columns: 20% minmax(0, 1fr) 20%;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.left-sidebar {
    grid-column: 1;
    padding: 10px;
}

.content {
    grid-column: 2;
}

.right-sidebar {
    grid-column: 3;
    padding: 10px;
}

/* =========================================================
   LEFT SIDEBAR
========================================================= */

.left-sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #050505;
    font-size: 15px;
    font-weight: 500;
    transition: 0.2s;
}

.left-sidebar a:hover {
    background: #e4e6eb;
}

.left-sidebar .emoji-icon {
    font-size: 28px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* =========================================================
   RIGHT SIDEBAR
========================================================= */

.right-profile-box {
    background: white;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.right-profile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #050505;
    font-size: 15px;
    font-weight: 500;
    transition: 0.2s;
}

.right-profile-link:hover {
    background: #e4e6eb;
}

.right-profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.right-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.right-profile-name {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
}

.right-profile-username {
    color: #65676b;
    font-size: 12px;
    line-height: 1.2;
}

.right-box {
    background: white;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.right-box h3 {
    margin: 0 0 6px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #65676b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.right-box a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #050505;
    font-size: 15px;
    font-weight: 500;
    transition: 0.2s;
}

.right-box a:hover {
    background: #e4e6eb;
}

.right-box .emoji-icon {
    font-size: 28px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* =========================================================
   ADS
========================================================= */

.ad-box {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    text-align: center;
}

.ad-box h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #65676b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-box img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

.ad-box p {
    font-size: 13px;
    color: #65676b;
    margin: 0 0 5px;
}

.ad-box > div,
.ad-box > ins,
.ad-box > iframe {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 250px;
    overflow: hidden;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

/* =========================================================
   CREATE POST
========================================================= */

.create-post {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.post-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.post-top img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.post-top input {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 20px;
    padding: 0 15px;
    background: #f0f2f5;
    outline: none;
    font-size: 14px;
    cursor: pointer;
}

.posting {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #e4e6eb;
    padding-top: 10px;
}

.posting button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    color: #65676b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.posting button:hover {
    background: #f0f2f5;
}

/* =========================================================
   STORIES
========================================================= */

.stories {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.story-header {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}

.story-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.story-item {
    min-width: 100px;
    height: 150px;
    border-radius: 10px;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.story-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.story-name {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* =========================================================
   FEED POSTS
========================================================= */

.feed-post {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.feed-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.feed-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.feed-name {
    font-weight: 600;
    font-size: 14px;
}

.feed-time {
    color: #65676b;
    font-size: 12px;
}

.feed-content {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.feed-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

.feed-actions {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #e4e6eb;
    padding-top: 10px;
}

.feed-action {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 13px;
    color: #65676b;
    padding: 5px 10px;
    border-radius: 8px;
    transition: 0.2s;
    background: none;
    border: none;
}

.feed-action:hover {
    background: #f0f2f5;
}

.feed-comments {
    margin-top: 10px;
}

/* =========================================================
   NOTIFICATION BADGE
========================================================= */

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fa3e3e;
    color: white;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid white;
}

/* =========================================================
   MODALS
========================================================= */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: #f0f2f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

.modal-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.modal-profile span {
    font-weight: 600;
}

.modal-textarea {
    width: 100%;
    height: 150px;
    border: none;
    outline: none;
    font-size: 18px;
    resize: none;
    margin-bottom: 15px;
}

.modal-tools {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-tools > span {
    font-size: 14px;
    color: #65676b;
}

.modal-tools-buttons {
    display: flex;
    gap: 5px;
}

.modal-tools-buttons button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
}

.modal-submit {
    width: 100%;
    background: #1877f2;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.modal-submit:hover {
    background: #166fe5;
}

/* =========================================================
   FEELING MODAL
========================================================= */

.feeling-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.feeling-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 40px;
    padding: 10px;
    border-radius: 8px;
}

.feeling-btn:hover {
    background: #f0f2f5;
}

/* =========================================================
   REFERRAL PAGE
========================================================= */

.referral-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.referral-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.referral-header h2 {
    font-size: 24px;
}

.points-display {
    background: linear-gradient(135deg, #f7b928, #ffd700);
    padding: 10px 20px;
    border-radius: 20px;
    color: #333;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(247, 185, 40, 0.4);
}

.referral-code-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.code-display {
    background: #f0f2f5;
    padding: 15px;
    border-radius: 8px;
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 4px;
    color: #1877f2;
    margin: 15px 0;
    font-family: monospace;
}

.btn-primary {
    background: #1877f2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #166fe5;
}

.share-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: white;
    transition: 0.2s;
}

.share-btn.whatsapp { background: #25D366; }
.share-btn.whatsapp:hover { background: #1da851; }
.share-btn.facebook { background: #1877f2; }
.share-btn.facebook:hover { background: #166fe5; }
.share-btn.twitter { background: #000000; }
.share-btn.twitter:hover { background: #1a1a1a; }
.share-btn.copy { background: #65676b; }
.share-btn.copy:hover { background: #4a4a4e; }

/* =========================================================
   STATS GRID
========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h4 {
    margin: 0 0 10px;
    color: #65676b;
    font-size: 14px;
}

.stat-card .number {
    font-size: 28px;
    font-weight: bold;
    color: #1877f2;
}

.stat-card .number.gold { color: #f7b928; }
.stat-card .number.green { color: #42b72a; }

/* =========================================================
   EARNINGS
========================================================= */

.earnings-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 10px 0;
    border: 1px solid #e4e6eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.earnings-box .label {
    color: #65676b;
    font-size: 13px;
    font-weight: 600;
}

.earnings-box .value {
    color: #1877f2;
    font-size: 16px;
    font-weight: 700;
}

.earnings-box .value.gold { color: #f7b928; }

/* =========================================================
   REFERRAL LIST
========================================================= */

.referral-list {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.referral-list table {
    width: 100%;
    border-collapse: collapse;
}

.referral-list th {
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid #e4e6eb;
    color: #65676b;
    font-size: 13px;
}

.referral-list td {
    padding: 10px;
    border-bottom: 1px solid #e4e6eb;
    font-size: 14px;
}

.referral-list tr:hover {
    background: #f0f2f5;
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: #65676b;
}

/* =========================================================
   NAV BUTTONS
========================================================= */

.nav-buttons {
    padding: 10px 20px;
    background: #f0f2f5;
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-buttons a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

.home-btn {
    color: white;
    background: #1877f2;
}

/* =========================================================
   MESSENGER UNREAD BADGE
========================================================= */

.messenger-unread-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e53935;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    border: 2px solid #ffffff;
    box-sizing: border-box;
    z-index: 100;
}

a[href*="messenger"] {
    position: relative;
}

/* =========================================================
   MESSAGES PAGE
========================================================= */

.messages-layout {
    display: grid;
    grid-template-columns: 240px 340px 1fr;
    gap: 16px;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 16px;
    height: calc(100vh - 100px);
}

.messages-sidebar {
    background: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    overflow: hidden;
}

.messages-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e4e6eb;
}

.messages-sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.new-msg-btn {
    background: #1877f2;
    color: #fff;
    border: none;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

.messages-tabs {
    display: flex;
    padding: 8px 10px;
    gap: 5px;
    border-bottom: 1px solid #e4e6eb;
}

.msg-tab {
    flex: 1;
    padding: 7px 8px;
    background: #f0f2f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.msg-tab.active {
    background: #1877f2;
    color: #fff;
}

.messages-search {
    padding: 10px 14px;
}

.messages-search input {
    width: 100%;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid #e4e6eb;
    background: #f0f2f5;
    outline: none;
    font-size: 13px;
}

.conversations-list {
    flex: 1;
    list-style: none;
    overflow-y: auto;
    padding: 4px 6px;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.conv-item:hover { background: #f0f2f5; }
.conv-item.active { background: #e7f3ff; }

.conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
    flex-shrink: 0;
}

.conv-info { flex: 1; min-width: 0; }

.conv-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.conv-last {
    font-size: 12px;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.conv-time {
    font-size: 11px;
    color: #999;
}

.conv-unread {
    background: #1877f2;
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: 600;
}

.chat-area {
    background: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    overflow: hidden;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #65676b;
    gap: 12px;
    font-size: 15px;
}

.chat-empty-icon { font-size: 60px; }

.chat-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid #e4e6eb;
}

.chat-user { display: flex; align-items: center; gap: 10px; }

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
}

.chat-user h3 {
    font-size: 15px;
    font-weight: 600;
}

.chat-user-status {
    font-size: 12px;
    color: #65676b;
}

.chat-user-status.online { color: #31a24c; font-weight: 600; }

.chat-actions { display: flex; gap: 6px; }

.chat-icon-btn {
    background: #f0f2f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: #f8f9fb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    max-width: 65%;
    padding: 9px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-msg.them {
    background: #e4e6eb;
    color: #050505;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.me {
    background: #1877f2;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg-time {
    font-size: 10px;
    opacity: 0.75;
    margin-top: 4px;
    display: block;
    text-align: end;
}

.chat-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #e4e6eb;
}

.chat-footer input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid #e4e6eb;
    background: #f0f2f5;
    outline: none;
    font-size: 14px;
}

.send-btn {
    background: #1877f2;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

/* =========================================================
   EMOJI PICKER
========================================================= */

.emoji-picker {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    padding: 10px;
    width: 300px;
    z-index: 9999;
}

.emoji-header {
    font-size: 13px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #e4e6eb;
    margin-bottom: 8px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    font-size: 20px;
}

.emoji-grid span {
    cursor: pointer;
    padding: 4px;
    text-align: center;
    border-radius: 6px;
}

.emoji-grid span:hover { background: #f0f2f5; }

/* =========================================================
   RTL SUPPORT
========================================================= */

html[dir="rtl"] .chat-msg.them {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

html[dir="rtl"] .chat-msg.me {
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 4px;
}

/* =========================================================
   DELETE STORY BUTTON
========================================================= */
.story-item {
    position: relative; /* ✅ ضروري */
    overflow: hidden;
}

.delete-story-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 100;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    padding: 0;
}

.delete-story-btn:hover {
    background: #f44336;
    transform: scale(1.1);
}

.delete-story-btn:active {
    transform: scale(0.95);
}

/* =========================================================
   RESPONSIVE - Tablet
========================================================= */

@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 200px minmax(0, 1fr) 260px;
        gap: 12px;
        padding: 12px;
    }
}

@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 140px minmax(0, 1fr) 200px;
        gap: 8px;
        padding: 8px;
    }
    .left-sidebar a { font-size: 13px; padding: 6px 8px; gap: 8px; }
    .left-sidebar .emoji-icon { font-size: 22px; width: 28px; height: 28px; }
    .right-box a { font-size: 13px; padding: 6px 8px; gap: 8px; }
    .right-box .emoji-icon { font-size: 22px; width: 28px; height: 28px; }
    .right-box h3 { font-size: 12px; }
    .search-container input { width: 180px; }
}

@media (max-width: 700px) {
    .main-container {
        display: grid;
        grid-template-columns: 120px minmax(0, 1fr) 140px;
        gap: 6px;
        padding: 6px;
    }

    .left-sidebar {
        grid-column: 1;
        padding: 4px;
    }

    .left-sidebar a {
        font-size: 11px;
        padding: 5px 4px;
        gap: 6px;
    }

    .left-sidebar .emoji-icon {
        font-size: 18px;
        width: 22px;
        height: 22px;
    }

    .content {
        grid-column: 2;
        width: 100%;
    }

    .right-sidebar {
        grid-column: 3;
        width: 140px;
        padding: 4px;
        position: static;
        max-height: none;
        overflow: visible;
    }

    .right-box,
    .right-profile-box,
    .ad-box {
        padding: 6px;
        margin-bottom: 6px;
    }

    .right-box h3 {
        font-size: 10px;
        margin-bottom: 4px;
        padding: 0 4px;
    }

    .right-box a {
        font-size: 10px;
        padding: 4px;
        gap: 4px;
    }

    .right-box .emoji-icon {
        font-size: 14px;
        width: 18px;
        height: 18px;
    }

    .right-profile-name { font-size: 11px; }
    .right-profile-username { font-size: 9px; }

    .nav-icons a {
        width: 40px;
        font-size: 18px;
    }

    .search-container input { width: 100px; }
    .stats-grid { grid-template-columns: 1fr; }
    .share-buttons { flex-direction: column; }
    .share-btn { width: 100%; }
}

/* =========================================================
   MOBILE SIDEBAR (HAMBURGER MENU)
========================================================= */

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    line-height: 1;
    margin-right: 5px;
}

.hamburger-btn:hover {
    background: rgba(255,255,255,0.15);
}

.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.mobile-sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #65676b;
    font-size: 22px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    margin-left: auto;
}

.mobile-sidebar-close:hover {
    background: #f0f2f5;
}

/* =========================================================
   MOBILE FIX (< 768px) - Content only + Drawer
========================================================= */

@media (max-width: 768px) {

    .hamburger-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .main-container {
        display: block;
        padding: 8px;
        grid-template-columns: none;
        gap: 0;
    }

    .content {
        grid-column: auto;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .right-sidebar {
        display: none;
    }

    .left-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        max-width: 80vw;
        background: white;
        z-index: 9999;
        overflow-y: auto;
        padding: 15px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 15px rgba(0,0,0,0.15);
        display: flex;
        flex-direction: column;
        max-height: none;
        grid-column: auto;
    }

    .left-sidebar.show {
        transform: translateX(0);
    }

    .mobile-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .navbar {
        padding: 0 8px;
    }

    .nav-icons a {
        width: 55px;
        font-size: 18px;
    }

    .search-container input {
        width: 140px;
        font-size: 13px;
    }
}

/* ═══════════════════════════════════════════════════════════ */
/* 🎟️ WAITLIST BANNER */
/* ═══════════════════════════════════════════════════════════ */
.waitlist-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px 25px;
    margin: 15px auto;
    max-width: 1200px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
    position: relative;
    overflow: hidden;
}

.waitlist-banner-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.waitlist-icon {
    font-size: 50px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.waitlist-info { flex: 1; min-width: 200px; }

.waitlist-title {
    margin: 0 0 5px;
    font-size: 20px;
    font-weight: 700;
}

.waitlist-position {
    color: #FFD700;
    font-size: 28px;
    font-weight: 900;
    padding: 0 8px;
}

.waitlist-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
}

.waitlist-stats {
    display: flex;
    gap: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
}

.waitlist-stat { text-align: center; min-width: 60px; }

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #FFD700;
}

.stat-label {
    display: block;
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
}

.waitlist-actions {
    display: flex;
    gap: 10px;
}

.waitlist-btn-invite,
.waitlist-btn-join {
    padding: 12px 22px;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.waitlist-btn-invite {
    background: linear-gradient(135deg, #FFD700, #FF9800);
    color: #333;
}

.waitlist-btn-join {
    background: white;
    color: #667eea;
}

.waitlist-btn-invite:hover,
.waitlist-btn-join:hover {
    transform: translateY(-2px);
}

.waitlist-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
}

.waitlist-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FF9800);
    transition: width 0.8s ease-out;
}

.waitlist-founder-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FFD700, #FF9800);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 13px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 768px) {
    .waitlist-banner { padding: 15px; margin: 10px; }
    .waitlist-banner-content { flex-direction: column; text-align: center; }
    .waitlist-title { font-size: 16px; }
    .waitlist-position { font-size: 22px; }
    .waitlist-stats,
    .waitlist-actions { width: 100%; justify-content: center; }
    .waitlist-btn-invite,
    .waitlist-btn-join { flex: 1; justify-content: center; }
    .waitlist-founder-badge { position: static; margin-top: 10px; }
}

/* =========================================================
   🌙 SOCIALWIKI DARK MODE
   ========================================================= */

html.dark-mode {
    --bg-primary: #18191a;
    --bg-secondary: #242526;
    --bg-tertiary: #3a3b3c;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --border-color: #3e4042;
    --accent: #1877f2;
}

html.dark-mode body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Navbar يفضل أزرق */
html.dark-mode .navbar {
    background: #1877f2 !important;
}

/* Cards */
html.dark-mode .feed-post,
html.dark-mode .create-post,
html.dark-mode .stories,
html.dark-mode .right-profile-box,
html.dark-mode .right-box,
html.dark-mode .profile-info,
html.dark-mode .profile-cover,
html.dark-mode .profile-posts,
html.dark-mode .tasks-section,
html.dark-mode .balance-card,
html.dark-mode .tier-card,
html.dark-mode .reward-card,
html.dark-mode .network-card,
html.dark-mode .ad-container,
html.dark-mode .ad-box,
html.dark-mode .notification-item,
html.dark-mode .messenger-sidebar,
html.dark-mode .messenger-chat,
html.dark-mode .chat-header,
html.dark-mode .modal-box,
html.dark-mode .modal-content,
html.dark-mode .post-card,
html.dark-mode .settings-card,
html.dark-mode .friend-card,
html.dark-mode .event-card,
html.dark-mode .product-card {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* النصوص */
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode h5,
html.dark-mode p,
html.dark-mode span,
html.dark-mode div,
html.dark-mode label,
html.dark-mode a {
    color: var(--text-primary);
}

html.dark-mode .feed-time,
html.dark-mode .feed-content,
html.dark-mode .profile-username,
html.dark-mode .profile-bio,
html.dark-mode .notification-time,
html.dark-mode .stat-label,
html.dark-mode .task-progress-text,
html.dark-mode .messenger-friend-username,
html.dark-mode .chat-user span {
    color: var(--text-secondary) !important;
}

/* Sidebar */
html.dark-mode .left-sidebar,
html.dark-mode .right-sidebar {
    background: transparent !important;
}

html.dark-mode .left-sidebar a,
html.dark-mode .right-box a {
    color: var(--text-primary);
}

html.dark-mode .left-sidebar a:hover {
    background: var(--bg-tertiary) !important;
}

/* Inputs */
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode select {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
    color: var(--text-secondary) !important;
}

/* Messenger */
html.dark-mode .message-row.received .message-bubble {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

html.dark-mode .messenger-friend:hover {
    background: var(--bg-tertiary) !important;
}

html.dark-mode .messenger-friend.active {
    background: var(--bg-tertiary) !important;
}

html.dark-mode .messenger-search input {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* Modals */
html.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.85) !important;
}

/* Stories */
html.dark-mode .story-item {
    border-color: var(--border-color) !important;
}

/* Tabs */
html.dark-mode .tab,
html.dark-mode .profile-tab {
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

html.dark-mode .tab.active,
html.dark-mode .profile-tab.active {
    color: var(--accent) !important;
}

/* Buttons */
html.dark-mode .home-btn,
html.dark-mode .edit-btn {
    background: var(--accent) !important;
    color: white !important;
}

html.dark-mode .message-btn,
html.dark-mode .mark-all-read {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* Scrollbar */
html.dark-mode ::-webkit-scrollbar {
    background: var(--bg-primary);
}

html.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

/* Profile */
html.dark-mode .profile-cover {
    background: linear-gradient(135deg, #1877f2, #8b5cf6) !important;
}

html.dark-mode .profile-stats {
    border-color: var(--border-color) !important;
}

/* Footer */
html.dark-mode footer {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Notification item unread */
html.dark-mode .notification-item.unread {
    background: #1e3a5f !important;
}

/* Ad containers */
html.dark-mode .ad-container > div:first-child,
html.dark-mode .ad-box > h3 {
    color: var(--text-secondary) !important;
}

/* شارة البائع الموثوق - كبيرة وذهبية */
.badge-gold-seller {
    background: linear-gradient(135deg, #FFD700, #FFA500, #FF8C00); /* تدرج ذهبي */
    color: #333;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 900;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.6); /* ظل ذهبي */
    border: 2px solid #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: goldPulse 2s infinite; /* تأثير نبض */
}

@keyframes goldPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}