/* ============================================================
   SHARED CSS — X-style UI Design System
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --x-bg: #000000;
    --x-card-bg: #16181c;
    --x-border: #2f3336;
    --x-text-main: #e7e9ea;
    --x-text-sub: #71767b;
    --x-blue: #1d9bf0;
    --x-hover: rgba(255, 255, 255, 0.03);
    --x-green: #00ba7c;
    --x-red: #f4212e;
    --x-like: #f91880;
    --x-repost: #00ba7c;
    --x-unread: #0084ff;
    --modal-bg: #001f4d;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
    background-color: var(--x-bg);
    color: var(--x-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
}

/* ── Feed Wrapper ───────────────────────────────────────────── */
.feed-wrapper {
    width: 100%;
    max-width: 600px;
    border-left: 1px solid var(--x-border);
    border-right: 1px solid var(--x-border);
    min-height: 100vh;
    background-color: var(--x-bg);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* ── Feed Header (sticky nav) ───────────────────────────────── */
.feed-header {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--x-border);
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    text-align: center;
}

.feed-header a {
    font-size: 15px;
    font-weight: 700;
    padding: 16px 0;
    color: var(--x-text-sub);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
    transition: background-color 0.2s, color 0.2s;
}

.feed-header a:hover {
    background-color: var(--x-hover);
    color: var(--x-text-main);
}

.feed-header a.active {
    color: var(--x-text-main);
    font-weight: 800;
}

.feed-header a.active span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 4px;
    width: 40px;
    background-color: var(--x-blue);
    border-radius: 9999px;
}

/* ── Feed Footer ────────────────────────────────────────────── */
.feed-footer {
    position: fixed;
    bottom: 0;
    padding: 14px;
    width: 100%;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--x-border);
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    text-align: center;
    box-sizing: border-box;
}

.feed-footer button {
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
}

/* ── Footer Popup Menu ──────────────────────────────────────── */
.footer-menu-popup {
    position: absolute;
    bottom: 70px;
    right: 16px;
    background-color: var(--x-card-bg);
    border: 1px solid var(--x-border);
    border-radius: 16px;
    width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    z-index: 101;
    overflow: hidden;
}

.footer-menu-popup a {
    padding: 14px 16px;
    color: var(--x-text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.footer-menu-popup a:not(:last-child) {
    border-bottom: 1px solid var(--x-border);
}

.footer-menu-popup a:hover {
    background-color: var(--x-hover);
}
.feed-footer a#active {
    color: var(--x-text-main);
    font-weight: 800;
}

.feed-footer a#active span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 4px;
    width: 40px;
    background-color: var(--x-blue);
    border-radius: 9999px;
}
/* ── Tweet / Post Card ──────────────────────────────────────── */
.tweet-container {
    border-bottom: 1px solid var(--x-border);
    padding: 12px 16px;
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.tweet-container:hover {
    background-color: var(--x-hover);
}

.tweet-context {
    display: flex;
    align-items: center;
    margin-left: 48px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--x-text-sub);
}

.context-icon {
    margin-right: 8px;
    font-size: 14px;
}

.tweet-main { display: flex; }
.tweet-left { margin-right: 12px; }

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #16181c;
    border: 1px solid var(--x-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.avatar-circle a {
    text-decoration: none;
    color: var(--x-text-sub);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.tweet-right { flex: 1; min-width: 0; }

.tweet-header-info {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.display-name a {
    font-weight: 700;
    font-size: 15px;
    color: var(--x-text-main);
    text-decoration: none;
    text-transform: uppercase;
}

.display-name a:hover { text-decoration: underline; }

.handle, .dot, .timestamp {
    color: var(--x-text-sub);
    font-size: 15px;
}

.tweet-body {
    font-size: 15px;
    line-height: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 12px;
    color: var(--x-text-main);
}

.media-container {
    margin-top: 12px;
    border: 1px solid var(--x-border);
    border-radius: 16px;
    overflow: hidden;
    max-width: 100%;
    background: #16181c;
}

.media-container img { width: 100%; height: auto; display: block; }

/* ── Tweet Action Buttons ───────────────────────────────────── */
.tweet-actions {
    display: flex;
    justify-content: space-between;
    max-width: 425px;
    margin-top: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    color: var(--x-text-sub);
    font-size: 13px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s;
}

.action-btn .icon-box {
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.action-btn span { padding-left: 2px; }

.action-btn.comment:hover { color: var(--x-blue); }
.action-btn.comment:hover .icon-box { background: rgba(29, 155, 240, 0.1); }

.action-btn.like:hover { color: var(--x-like); }
.action-btn.like:hover .icon-box { background: rgba(249, 24, 128, 0.1); }

.action-btn.repost:hover { color: var(--x-repost); }
.action-btn.repost:hover .icon-box { background: rgba(0, 186, 124, 0.1); }

.action-btn.share:hover { color: var(--x-blue); }
.action-btn.share:hover .icon-box { background: rgba(29, 155, 240, 0.1); }

/* ── Marketplace ────────────────────────────────────────────── */
.marketplace-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.category-container { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.category-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--x-text-main);
    letter-spacing: 0.5px;
    padding-left: 4px;
}

.sideways-scroll-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.sideways-scroll-track::-webkit-scrollbar { display: none; }

.business-scroll-card {
    flex: 0 0 240px;
    background-color: var(--x-card-bg);
    border: 1px solid var(--x-border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
}

.business-scroll-card:hover { border-color: #424649; }

.cover-image-container {
    width: 100%;
    height: 120px;
    background: #1c1e22;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--x-border);
}

.cover-image-container img { width: 100%; height: 100%; object-fit: cover; }

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--x-text-sub);
    font-size: 28px;
    background-color: #202327;
}

.biz-card-info { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.biz-name-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--x-blue);
    text-align: left;
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biz-name-btn:hover { text-decoration: underline; }

.biz-location {
    font-size: 12px;
    color: var(--x-text-sub);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biz-stats { font-size: 11px; color: var(--x-text-sub); margin-top: 2px; }

.review-section-row { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }

.small-action-chip {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--x-border);
    padding: 4px 10px;
    border-radius: 9999px;
    color: var(--x-text-main);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.small-action-chip.like:hover  { background: rgba(0, 186, 124, 0.1); color: var(--x-green); }
.small-action-chip.dislike:hover { background: rgba(244, 33, 46, 0.1); color: var(--x-red); }
.small-action-chip.msg:hover   { background: rgba(29, 155, 240, 0.1); color: var(--x-blue); }

/* ── Review Modal ───────────────────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.custom-modal {
    background-color: var(--modal-bg);
    border: 1px solid var(--x-border);
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

.modal-header-text { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.modal-close { position: absolute; top: 12px; right: 16px; color: var(--x-text-sub); cursor: pointer; font-size: 20px; }

.review-textarea {
    width: 100%;
    background: #002244;
    color: #fff;
    border: 1px solid var(--x-border);
    border-radius: 6px;
    padding: 12px;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
    margin-bottom: 14px;
}

.modal-submit {
    background-color: #fff;
    color: var(--modal-bg);
    border: none;
    padding: 10px 24px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    float: right;
}

/* ── Notifications Board ────────────────────────────────────── */
.board-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.accordion-section {
    background: #16181c;
    border: 1px solid var(--x-border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
}

.accordion-header {
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s;
}

.accordion-header:hover { background: var(--x-hover); }

.accordion-title { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 800; }

.accordion-arrow {
    font-size: 14px;
    color: var(--x-text-sub);
    transition: transform 0.3s ease;
}

.accordion-section.active .accordion-arrow { transform: rotate(180deg); color: var(--x-blue); }

.accordion-content {
    display: none;
    padding: 0 20px 20px;
    border-top: 1px solid var(--x-border);
    background-color: #000000;
}

.accordion-section.active .accordion-content { display: block; }

.notification-item { padding: 14px 0; border-bottom: 1px solid var(--x-border); }
.notification-item:last-child { border-bottom: none; }

.meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--x-text-sub);
    margin-bottom: 6px;
}

.msg-badge {
    background-color: var(--x-red);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 9999px;
    margin-left: 4px;
    font-weight: 700;
}

/* ── Messages / Chat ────────────────────────────────────────── */
.search-container { padding: 12px 16px; border-bottom: 1px solid var(--x-border); }

.search-bar {
    width: 100%;
    background-color: #16181c;
    border: 1px solid transparent;
    color: var(--x-text-main);
    border-radius: 9999px;
    padding: 10px 20px;
    box-sizing: border-box;
    font-size: 15px;
    outline: none;
}

.search-bar:focus { border-color: var(--x-blue); background-color: var(--x-bg); }

.chat-user-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--x-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.chat-user-item:hover { background-color: var(--x-hover); }

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #16181c;
    margin-right: 12px;
    border: 1px solid var(--x-border);
}

.chat-details { flex: 1; min-width: 0; }

.chat-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.chat-name { font-weight: 700; font-size: 15px; color: var(--x-text-main); }
.chat-time { font-size: 13px; color: var(--x-text-sub); }

.chat-preview-row { display: flex; justify-content: space-between; align-items: center; }

.chat-message {
    font-size: 14px;
    color: var(--x-text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.unread-badge {
    background-color: var(--x-unread);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    min-width: 14px;
    text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 500px) {
    .feed-header a { font-size: 11px; padding: 12px 0; }
    .feed-header a.active span::after { width: 24px; height: 3px; }
    .feed-wrapper { border-left: none; border-right: none; }
    .business-scroll-card { flex: 0 0 210px; }
    .tweet-context { margin-left: 52px; }
}
/* Container reset */
.feed-footer {
    text-decoration: none;
}

/* Fixed nav links styling (Replaces your inline styles safely) */
.feed-footer .footer-nav-link {
    text-decoration: none; 
    color: var(--x-text-main); /* Corrected variable name syntax */
    font-size: 15px;
}

/* Optional hover rule for cleaner visibility */
.feed-footer .footer-nav-link:hover {
    color: var(--x-text-main);
    background-color: var(--x-hover);
}
