body {
    font-family: Arial, sans-serif;
    background: linear-gradient(120deg, #050000, #140000, #2d0000, #000000);
    animation: bodyGradientMove 12s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-size: 200% 200%;
}

/* Simple CRT Scanline Effect */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 20, 20, 0.05) 0px,
        rgba(255, 20, 20, 0.05) 1px,
        transparent 2px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 999;
}

@keyframes bodyGradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes bodyGradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#chat-container {
    animation: gradientMove 6s ease infinite;
    user-select: none;
    height: 90%;
    width: 80%;
    background: linear-gradient(60deg, #240000, #420303, #520000, #880000);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(18, 84, 98, 0.377);
    backdrop-filter: blur(8px);
    background-size: 400% 400%;
    position: relative;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#chat-window {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0,0,0,0.2)), url('bg3.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #2c2c2c;
    height: 80%;
    overflow-y: auto;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid #000000;
    padding: 10px;
    box-shadow: inset 0 0 12px rgba(0, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

#output {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

#ti {
    color: #ccc;
    border: none;
    background-color: transparent;
    padding: 0;
    width: auto;
    border-radius: 0%;
    box-shadow: none;
}

em {
    font-family: 'Courier New', Courier, monospace;
    color: #ffffff;
    border: 1px solid black;
}

.message-other {
    color: rgb(193, 193, 193);
    background: #471313;
    align-self: flex-start;
    text-align: left;
    border: 1px solid rgb(239, 0, 0);
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: 0 0 5px rgb(0, 0, 0);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 70%;
    min-width: 40px;
    box-shadow: 0 0 8px rgba(0, 255, 170, 0.2);
}

.message-self {
    color: rgb(193, 193, 193);
    background: rgb(71 0 12);
    align-self: flex-end;
    text-align: right;
    border: 1px solid rgb(0, 0, 0);
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: 0 0 5px rgb(0, 0, 0);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 70%;
    min-width: 40px;
    box-shadow: 0 0 8px rgba(255, 0, 170, 0.2);
}

.message-admin {
    border-left: 3px solid gold;
}

#username {
    color: #e6e6e6;
    box-shadow: 0px 0px 10px rgb(0, 0, 0);
    background-color: #450000;
    width: calc(60% - 80px);
    padding: 10px;
    margin: 5px 0;
    border-radius: 15px;
    border: 1px solid #000;
    transition: 0.3s;
}

#message {
    background-color: #bcbcbc;
    width: calc(80% - 80px);
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    border: 1px solid #000000;
    transition: 0.3s;
}

#message::placeholder {
    color: #020202;
}

#send {
    border-radius: 5px;
    border: 1px solid #ccc;
    margin: 5px 0;
    padding: 10px;
    background: #39aaca;
    color: #000;
    cursor: pointer;
    transition: background-color 0.2s;
}

#send:hover {
    background: #61dafb;
}

@media (max-width: 768px) {
    #username {
        height: 10px;
        font-size: medium;
    }
    
    .message-other, .message-self {
        font-size: medium;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }
    
    strong {
        color: #ff5555;
    }
    
    #admin-login-btn {
        font-size: 14px;
    }
    
    #chat-container {
        max-width: 90%;
        padding: 10px;
        width: 100%;
        height: 90%;
    }
    
    a {
        font-size: xx-small;
    }
}

strong {
    color: #ff5555;
}

.delete-message {
    color: red;
    cursor: pointer;
    margin-left: 10px;
}

#admin-login-btn {
    position: relative;
    top: -3px;
    background-color: #0d0202;
    color: #ddd;
    border: 1px solid #555;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 10px;
    font-size: 10px;
    transition: 0.2s;
    border-radius: 10px;
}

#admin-login-btn:hover {
    background-color: #444;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px rgb(0, 0, 0);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #910b0b, #67872b); /* metallic silver-gray */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #718f25, #971212);
}


#updates-bell {
    position: relative;
    top: 9px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px; /* small gap after admin button */
    padding: 2px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    transition: background-color 0.3s ease;
    text-decoration: none;
}

#updates-bell:hover {
    background-color: rgba(255, 204, 0, 0.8);
}

#bell-icon {
    animation: ring 4s infinite;
}

@keyframes ring {
    0% { transform: rotate(0); }
    1% { transform: rotate(30deg); }
    3% { transform: rotate(-28deg); }
    5% { transform: rotate(34deg); }
    7% { transform: rotate(-32deg); }
    9% { transform: rotate(30deg); }
    11% { transform: rotate(-28deg); }
    13% { transform: rotate(26deg); }
    15% { transform: rotate(-24deg); }
    17% { transform: rotate(22deg); }
    19% { transform: rotate(-20deg); }
    21% { transform: rotate(18deg); }
    23% { transform: rotate(-16deg); }
    25% { transform: rotate(14deg); }
    27% { transform: rotate(-12deg); }
    29% { transform: rotate(10deg); }
    31% { transform: rotate(-8deg); }
    33% { transform: rotate(6deg); }
    35% { transform: rotate(-4deg); }
    37% { transform: rotate(2deg); }
    39% { transform: rotate(-1deg); }
    41% { transform: rotate(1deg); }
    43% { transform: rotate(0); }
    100% { transform: rotate(0); }
}

#notification-container {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: 300px;
}

.notification {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    margin: 5px;
    border-radius: 5px;
    text-align: center;
    opacity: 1;
    transition: opacity 2s ease-out;
}

/* Mention suggestions styles */
#suggestions-container {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-height: 200px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 100;
    border: 1px solid #444;
}

#suggestions-list {
    padding: 5px;
}

.suggestion-item {
    padding: 8px 12px;
    color: #eee;
    cursor: pointer;
    border-radius: 4px;
}

.suggestion-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.suggestion-item.highlighted {
    background-color: rgba(66, 139, 202, 0.7);
}

.mention-highlight {
    color: #ffcc00;
    font-weight: bold;
    background-color: rgba(255, 204, 0, 0.1);
    padding: 0 2px;
    border-radius: 3px;
}

/* Reply preview styles */
#reply-preview {
    background-color: rgba(0, 0, 0, 0.734);
    border-left: 3px solid #ff0400;
    padding: 8px;
    margin: 5px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    bottom: 0;
    margin-top: auto;
}

#reply-content {
    color: #aaa;
    font-size: 0.9em;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#reply-content strong {
    color: #fa0000;
}

#cancel-reply {
    background: none;
    border: none;
    color: #ff5555;
    cursor: pointer;
    font-size: 1.2em;
    margin-left: 10px;
    padding: 0 5px;
}

/* Reply message container */
.reply-container {
    margin-bottom: 5px;
    border-left: 2px solid #ff0000;
    padding-left: 10px;
}

/* Original message in reply */
.reply-original {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    padding: 5px;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #aaa;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reply-original strong {
    color: #ff5555;
}

/* Threaded message style */
.message-reply {
    margin-left: 20px;
    border-left: 2px solid rgba(76, 175, 80, 0.5);
    padding-left: 10px;
}

/* Reply button style */
.reply-button {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 5px;
    padding: 2px 5px;
}

.reply-button:hover {
    color: #3d8b40;
}

/* File upload styles */
#message-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
}

#file-upload-label {
    background-color: #515151;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    border: 1px solid #000;
    box-shadow: 0px 0px 10px rgb(0, 0, 0);
}

#file-upload-label:hover {
    background-color: #7c7c7c;
}

#file-upload-label svg {
    width: 20px;
    height: 20px;
}

.file-message {
    display: flex;
    flex-direction: column;
    margin-top: 5px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 5px;
    margin-top: 5px;
}

.file-icon {
    width: 24px;
    height: 24px;
}

.file-download {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
    margin-left: auto;
}

.file-download:hover {
    text-decoration: underline;
}

.file-size {
    font-size: 0.8em;
    color: #aaa;
}

.progress-container {
    width: 100%;
    background-color: #333;
    border-radius: 5px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 5px;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}

/* File type specific icons */
.file-icon.pdf {
    color: #e74c3c;
}

.file-icon.image {
    color: #3498db;
}

.file-icon.video {
    color: #9b59b6;
}

.file-icon.audio {
    color: #f39c12;
}

.file-icon.document {
    color: #2ecc71;
}

.file-icon.archive {
    color: #e67e22;
}

.file-icon.other {
    color: #95a5a6;
}

#kg {
    background: linear-gradient(90deg, #d4af37, #b8860b, #d4af37); /* golden banner gradient */
    color: #970000; /* very light ivory color for text */
    font-family:Arial, Helvetica, sans-serif; /* royal-style font */
    font-weight: bold;
    padding: 4px;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.6); /* soft golden glow */
    letter-spacing: 1.5px;
}

/* Rules Popup Styles */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.popup-content {
    background: linear-gradient(135deg, #1a2a3a, #0d1520);
    border-radius: 15px;
    padding: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-content h2 {
    color: #4CAF50;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
}

.popup-content h3 {
    color: #39aaca;
    margin: 15px 0 10px;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.popup-content ul {
    padding-left: 20px;
    margin: 10px 0;
}

.popup-content li {
    margin-bottom: 8px;
    color: #e0e0e0;
    line-height: 1.5;
}

.popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-footer label {
    color: #aaa;
    display: flex;
    align-items: center;
    cursor: pointer;
}

#dont-show-again {
    margin-right: 10px;
}

#accept-rules {
    background: linear-gradient(to right, #4CAF50, #2E7D32);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#accept-rules:hover {
    background: linear-gradient(to right, #3d8b40, #1B5E20);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scrollbar for popup */
.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: linear-gradient(#4CAF50, #2E7D32);
    border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(#3d8b40, #1B5E20);
}

#rules-popup {
    display: none;
}

#show-rules-btn{
    background: transparent;
    border-radius: 50%;
    margin-left: 5px;
    position: relative;
    top: -3px;
    border: 1px solid #555;
    cursor: pointer;
    padding: 10px;
    font-size: 10px;
    transition: 0.2s;
}

#show-rules-btn:hover{
    background-color: rgba(255, 204, 0, 0.8);
}

.scrollable-terms {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin: 10px 0;
}

.scrollable-terms ul {
    padding-left: 20px;
}

.scrollable-terms li {
    margin-bottom: 8px;
}

/* Add these styles to your existing CSS file */

/* Username modal styles */
#username-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

#username-modal .popup-content {
    background: linear-gradient(135deg, #1a2a3a, #0d1520);
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.3s ease-out;
}

#username-modal h2 {
    color: #4CAF50;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
}

#modal-username {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #444;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 16px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

#modal-username:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

#username-error {
    color: #ff5555;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

#confirm-username {
    background: linear-gradient(to right, #4CAF50, #2E7D32);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 16px;
    width: 100%;
}

#confirm-username:hover {
    background: linear-gradient(to right, #3d8b40, #1B5E20);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Make sure the modal is above everything */
.popup-container {
    z-index: 10000;
}

#username-modal {
    z-index: 10001;
}
/* Add this to your existing styles.css */

/* System message styling */
.message-system {
    text-align: center;
    color: #aaa;
    font-style: italic;
    margin: 10px 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid #840000;
    font-size: 0.9em;
}

.message-system em {
    font-family: Arial, sans-serif;
    color: #aaa;
    border: none;
}

/* Ensure system messages don't have reply buttons */
.message-system .reply-button {
    display: none !important;
}

/* Ensure system messages don't have delete buttons */
.message-system .delete-message {
    display: none !important;
}