body {
    background: linear-gradient(180deg, #1a1d22, #111318);
}

html {
    min-height: 100%;
}

#navigation {
    text-align: center;
}

a:link,
a:visited {
    color: #9fc5ff;
}

#marketDashboard {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(180deg, #1c1f24, #15171b);
    padding: 10px;
    font-family: monospace;
    color:white;
}

.ticker-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    background: #111;
    border-bottom: 1px solid #333;
    padding: 6px 0;
    position: sticky;
    top: 0;
    z-index: 20;
}

.ticker-scroll {
    display: inline-block;
    white-space: nowrap;
    animation: tickerMove 25s linear infinite;
}

@keyframes tickerMove {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

#navigation button {
    white-space: nowrap;
    background: #2b2f36;
    color: #f2f2f2;
    border: none;
    padding: 8px 12px;
    margin-bottom: 6px;
    width: 130px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
}

#navigation input {
    background: #2b2f36;
    color: #f2f2f2;
    border: none;
    padding: 8px 12px;
    margin-bottom: 6px;
    width: 120px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
}

#navigation button.unread {
    background-color: #ffcc66;
}

#navigation button:hover {
    background: #3a3f47;
}

#navigation button.active {
    background: #4a505a;
    font-weight: bold;
}

#user_menu {
    text-align: center;
    color: white;
    float: left;
    height: 50%;
    width: 11%;
    background-color: #1e2126;
    border-color: #071257;
    border-left: 5px solid #071257;
    border-right: 5px solid #071257;
    border-radius: 5px;
}

input[name="username"],
input[name="password"] {
    width: 99%;
    background: #1b1d21;
    color: #f2f2f2;
    border: 1px solid #3d3d3d;
}

#online-users {

text-align: center;
    color: white;
    float: right;
    height: 50%;
    width: 11%;
    background-color: #1e2126;
    border-color: #071257;
    border-left: 5px solid #071257;
    border-right: 5px solid #071257;
    border-radius: 5px;

}

#online-users div {
    margin-bottom: 10px;
}

.day-divider {
    text-align: center;
    margin: 12px 0;
    padding: 4px 0;
    font-size: 0.85rem;
    color: #666;
    /*border-bottom: 1px solid #ccc;*/
    line-height: 1px;
}

.day-divider::before {
    content: "";
    display: inline-block;
    width: 20%;
    border-top: 1px solid #ccc;
    margin-right: 10px;
}

.day-divider::after {
    content: "";
    display: inline-block;
    width: 20%;
    border-top: 1px solid #ccc;
    margin-left: 10px;
}

.msg-header-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.msg-avatar-inline {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.msg-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.msg-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.edit-btn,
.delete-btn {
    cursor: pointer;
    font-size: 12px;
    color: #888;
}

.edit-btn:hover,
.delete-btn:hover {
    color: #fff;
}

/* Inline actions for grouped messages */
.inline-actions {
    display: inline-flex;
float:right;
    gap: 6px;
    margin-left: 8px;
    vertical-align: middle;
}

#content {
    text-align: center;
    border-style: solid;
    background-color: #1e2126;
    border-color: #3f3f3f;
    border-bottom: 10px solid #ea4600;
    border-radius: 5px;
    width: 75%;
    color: #f2f2f2;
}

.chat-image {
    max-width: 30%;
    max-height: 300px;
    border-radius: 6px;
    margin: 6px 0;
    cursor: zoom-in;
    transition: all 0.25s ease;
    object-fit: contain;
}

.chat-image.expanded {
    max-width: 90vw;
    max-height: 90vh;
    cursor: zoom-out;
    z-index: 9999;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    border-radius: 8px;
}

#image-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75); /* darker dim */
    backdrop-filter: blur(4px);      /* optional, looks premium */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 9998;
}

#image-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

img.emoji {

	width: 50px;
	height: 50px;


}

.youtube-embed iframe {
    width: 100%;
    max-width: 480px;
    height: 270px;
    border-radius: 6px;
    margin-top: 6px;
}

#chatContainer {
    width: 75%;
    margin: 0 auto;
}

#chatbox {
    border-color: #071257;
    border-left: 5px solid #071257;
    border-right: 5px solid #071257;
    border-radius: 5px;
    width: 100%;
    height: 500px;
    padding: 10px;
    overflow-y: auto;
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE/Edge Legacy */
    background: linear-gradient(180deg, #1c1f24, #15171b);
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #e8e8e8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

.mention {
    background: rgba(255, 255, 0, 0.35);
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: bold;
}

#chatbox div {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    padding-bottom: 10px;
}

#chatbox::-webkit-scrollbar {
    display: none;               /* Chrome/Safari/Edge */
}


.chat-message {
    padding: 4px 0;
    border-bottom: 1px solid #2d2f33;
}

.chat-message:last-child {
    border-bottom: none;
}

.chat-message:hover {
    background: rgba(255,255,255,0.04);
}

.chat-timestamp {
    color: #9a9a9a;
    margin-right: 6px;
    font-size: 12px;
}

.chat-username {
    font-weight: bold;
    color: #7fb8ff;
}

.chat-text {
    color: #e8e8e8;
}

#chatForm {
    margin-top: 8px;
    width: 100%;
    display: flex;
}

#chatInput {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    background: #1b1d21;
    color: #f2f2f2;
}

#uploadBtn {
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
}

.emoji-picker-container {
    position: relative;
    display: inline-block;
}

.emoji-btn {
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
}

.emoji-picker {
    position: absolute;
    bottom: 50px;
    right: 6px;
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 10px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 220px;
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
    z-index: 999;
}

.emoji-picker img {
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.emoji-picker img:hover {
    transform: scale(1.2);
}

.link-preview {
    border: 1px solid #2f3136;
    background: #202225;
    padding: 10px;
    border-radius: 6px;
    display: flex;
    gap: 10px;
    margin-top: 6px;
    max-width: 420px;
}

.link-preview .lp-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.link-preview .lp-body {
    display: flex;
    flex-direction: column;
}

.link-preview .lp-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.link-preview .lp-desc {
    font-size: 0.85em;
    opacity: 0.8;
    margin-bottom: 4px;
}

.link-preview .lp-site {
    font-size: 0.75em;
    opacity: 0.6;
}

.hidden {
    display: none;
}

.mobile-only {
    display: none;
}


/* ================================
   MOBILE & TABLET RESPONSIVE FIX
   ================================ */
@media (max-width: 900px) {

    /* Stack layout instead of sidebars */
    #user_menu,
    #online-users {
        float: none;
        width: 100%;
        height: auto;
        margin-bottom: 12px;
    }

    /* Center content expands to full width */
    #content,
    #chatContainer {
        width: 100%;
        margin: 0;
        border-radius: 0;
    }

    /* Chatbox grows vertically and fits screen */
    #chatbox {
        height: 60vh;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    /* Navigation buttons wrap nicely */
    #navigation button,
    #navigation input {
        width: 100%;
        max-width: 100%;
        margin: 4px 0;
        font-size: 16px;
    }

    /* Emoji picker stays usable */
    .emoji-picker {
        right: 0;
        width: 90%;
        grid-template-columns: repeat(8, 1fr);
    }

    /* Images scale better */
    .chat-image {
        max-width: 95%;
    }

    /* Ticker stays readable */
    .ticker-container {
        font-size: 14px;
        padding: 4px 0;
    }
/* Hide original links */
    #user_menu a {
        display: none;
    }

    /* Show dropdown */
    .mobile-user-menu {
        display: block !important;
        width: 90%;
        margin: 10px auto;
        padding: 10px;
        background: #2b2f36;
        color: #fff;
        border: 1px solid #444;
        border-radius: 6px;
        font-size: 16px;
    }
.welcomeuser {
        display: none;
    }

}