/* Hide all scrollbars site-wide */
html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar, body::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Andale Mono', 'Courier New', Courier, monospace;
    background-color: #000000;
    color: #A9A9A9;
    margin: 0;
    padding: 0;
}

/* --- STICKY BANNER --- */
.sticky-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #000000;
    border-bottom: 1px solid #333333;
    padding: 10px 20px;
    z-index: 1000;
    font-family: 'Andale Mono', 'Courier New', Courier, monospace;
    color: #A9A9A9;
    font-size: 21px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sticky-banner a {
    color: #A9A9A9;
    text-decoration: none;
}

.sticky-banner a:hover {
    color: #FFFFFF;
}

.sticky-banner a.active {
    color: #FFFFFF;
}

/* --- PAGE CONTAINER --- */
.page-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 70px 20px 40px;
}

/* --- INDEX / ROOM LIST --- */
.room-list {
    margin-top: 20px;
}

.room-item {
    border-bottom: 1px solid #1a1a1a;
    padding: 15px 0;
}

.room-item:last-child {
    border-bottom: none;
}

.room-item a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 27px;
    font-weight: bold;
}

.room-item a:hover {
    text-decoration: underline;
}

.room-desc {
    color: #A9A9A9;
    font-size: 20px;
    margin-top: 4px;
}

.page-title {
    color: #FFFFFF;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.page-subtitle {
    color: #A9A9A9;
    font-size: 20px;
    margin-bottom: 30px;
}

/* --- ROOM / CHAT --- */
body.room-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* accounts for mobile browser chrome */
    overflow: hidden;
}

#room-container {
    display: flex;
    flex-direction: column;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
    padding-top: 45px;
    box-sizing: border-box;
}

#chat-box {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 20px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#chat-box::-webkit-scrollbar {
    display: none;
}

.message {
    margin-bottom: 14px;
    line-height: 1.5;
}

.message-handle {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: bold;
}

.message--bot .message-handle {
    color: #444444;
}

.message--bot .message-body {
    color: #555555;
    font-size: 18px;
    font-style: italic;
}

.message-body {
    color: #A9A9A9;
    font-size: 21px;
}

.message-body a {
    color: #FFFFFF;
    text-decoration: underline;
}

.message-time {
    color: #444444;
    font-size: 17px;
    margin-left: 6px;
    font-weight: normal;
}

.message--flash {
    animation: flash 0.4s ease-out;
}

@keyframes flash {
    0%   { background-color: #0d2200; }
    100% { background-color: transparent; }
}

/* --- INPUT FORM --- */
#chat-form {
    display: flex;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    gap: 8px;
    border-top: 1px solid #1a1a1a;
    flex-shrink: 0;
    background: #000000;
}

#message-input {
    flex-grow: 1;
    border: 1px solid #333333;
    border-radius: 0;
    padding: 10px 14px;
    font-size: 21px;
    background-color: #000000;
    color: #FFFFFF;
    font-family: inherit;
}

#message-input:focus {
    outline: none;
    border-color: #A9A9A9;
}

#send-btn {
    padding: 10px 18px;
    background-color: #000000;
    color: #FFFFFF;
    border: 1px solid #333333;
    border-radius: 0;
    font-size: 21px;
    cursor: pointer;
    font-family: inherit;
}

#send-btn:hover {
    border-color: #A9A9A9;
}

#send-btn:disabled {
    color: #444444;
    border-color: #1a1a1a;
    cursor: default;
}

/* --- LOGIN --- */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-title {
    color: #FFFFFF;
    font-size: 30px;
    margin-bottom: 6px;
}

.login-sub {
    color: #A9A9A9;
    font-size: 20px;
    margin-bottom: 24px;
}

#login-form {
    display: flex;
    gap: 8px;
}

#email-input {
    flex-grow: 1;
    border: 1px solid #333333;
    border-radius: 0;
    padding: 10px 14px;
    font-size: 21px;
    background-color: #000000;
    color: #FFFFFF;
    font-family: inherit;
}

#email-input:focus {
    outline: none;
    border-color: #A9A9A9;
}

#login-button {
    padding: 10px 18px;
    background-color: #000000;
    color: #FFFFFF;
    border: 1px solid #333333;
    border-radius: 0;
    font-size: 21px;
    cursor: pointer;
    font-family: inherit;
}

#login-button:hover {
    border-color: #A9A9A9;
}

#login-status {
    color: #A9A9A9;
    font-size: 20px;
    margin-top: 16px;
}

/* --- NEW CONVERSATION --- */
#question-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

#question-input {
    width: 100%;
    background: #000;
    border: 1px solid #333333;
    border-radius: 0;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 23px;
    padding: 12px 14px;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.5;
}

#question-input:focus {
    outline: none;
    border-color: #A9A9A9;
}

.question-subtext {
    color: #444444;
    font-size: 18px;
    margin: 0;
    line-height: 1.5;
}

#question-btn {
    align-self: flex-start;
    padding: 10px 20px;
    background: #000;
    color: #FFFFFF;
    border: 1px solid #A9A9A9;
    border-radius: 0;
    font-family: inherit;
    font-size: 21px;
    cursor: pointer;
}

#question-btn:hover { border-color: #FFFFFF; }
#question-btn:disabled { color: #444444; border-color: #333333; cursor: default; }

.form-error {
    color: #A9A9A9;
    font-size: 20px;
    margin-top: 8px;
    min-height: 18px;
}

.spinner {
    margin-top: 30px;
    font-size: 42px;
    color: #A9A9A9;
    font-family: inherit;
    letter-spacing: 4px;
}

.group-description {
    margin-top: 20px;
    color: #FFFFFF;
    font-size: 23px;
    line-height: 1.6;
    border-left: 2px solid #A9A9A9;
    padding-left: 16px;
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.result-actions button {
    padding: 10px 20px;
    background: #000;
    font-family: inherit;
    font-size: 21px;
    cursor: pointer;
    border-radius: 0;
}

#confirm-btn {
    color: #FFFFFF;
    border: 1px solid #A9A9A9;
}

#confirm-btn:hover { border-color: #FFFFFF; }
#confirm-btn:disabled { color: #444444; border-color: #333333; cursor: default; }

#cancel-btn {
    color: #A9A9A9;
    border: 1px solid #333333;
}

#cancel-btn:hover { color: #FFFFFF; border-color: #A9A9A9; }

/* --- CONVERSATION CARDS (index) --- */
.conv-card {
    display: block;
    border-bottom: 1px solid #1a1a1a;
    padding: 16px 0;
    text-decoration: none;
    color: inherit;
}

.conv-card:last-child {
    border-bottom: none;
}

.conv-card:hover .conv-title {
    text-decoration: underline;
}

.conv-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.conv-title {
    color: #FFFFFF;
    font-size: 21px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.conv-unread {
    background: #FFFFFF;
    color: #000000;
    font-size: 17px;
    font-weight: bold;
    padding: 1px 6px;
    flex-shrink: 0;
    margin-top: 1px;
}

.conv-preview {
    color: #555;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.conv-preview-handle {
    color: #666;
    margin-right: 4px;
}

.conv-preview-body {
    color: #555;
}

.conv-meta {
    display: flex;
    gap: 16px;
    font-size: 17px;
    color: #444;
}

/* --- NEW button on index --- */
.new-conversation-btn {
    display: inline-block;
    margin-bottom: 28px;
    padding: 9px 18px;
    background: #000;
    color: #FFFFFF;
    border: 1px solid #A9A9A9;
    font-family: 'Andale Mono', 'Courier New', Courier, monospace;
    font-size: 21px;
    cursor: pointer;
    text-decoration: none;
}

.new-conversation-btn:hover {
    border-color: #FFFFFF;
    text-decoration: none;
}

/* --- ABOUT PAGE --- */
.about-body {
    margin-top: 24px;
    max-width: 600px;
}

.about-body p {
    color: #A9A9A9;
    font-size: 21px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.about-body a {
    color: #FFFFFF;
    text-decoration: underline;
}

.about-section-label {
    color: #FFFFFF !important;
    font-size: 18px !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 32px !important;
    margin-bottom: 12px !important;
}

/* --- SUPERUSER PANEL --- */
#superuser-panel {
    margin-top: 40px;
    border-top: 1px solid #1a1a1a;
    padding-top: 20px;
}

.su-label {
    color: #444444;
    font-size: 17px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.su-person {
    border-bottom: 1px solid #1a1a1a;
    padding: 14px 0;
}

.su-person:last-child { border-bottom: none; }

.su-name {
    color: #FFFFFF;
    font-size: 21px;
    font-weight: bold;
    margin-bottom: 4px;
}

.su-id {
    color: #444444;
    font-size: 17px;
    font-weight: normal;
    margin-left: 8px;
}

.su-meta {
    color: #A9A9A9;
    font-size: 18px;
    margin-bottom: 6px;
}

.su-bio {
    color: #666666;
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.su-field {
    color: #555555;
    font-size: 17px;
    line-height: 1.4;
    margin-bottom: 2px;
}

.su-label-inline {
    color: #444444;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 15px;
    margin-right: 4px;
}

.su-test-mode {
    margin-bottom: 16px;
    font-size: 18px;
    color: #666666;
}

.su-test-mode label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.su-test-mode input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.su-test-mode-banner {
    font-size: 18px;
    color: #888888;
    border: 1px solid #333333;
    padding: 8px 12px;
    margin-bottom: 16px;
}

/* --- LINKS --- */
a {
    color: #FFFFFF;
    text-decoration: underline;
}

a:hover {
    color: #FFFFFF;
}

/* --- AVATAR --- */
.avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    background: #333;
}

.avatar--large {
    width: 52px;
    height: 52px;
}

/* --- MESSAGE HEADER (avatar + handle row) --- */
.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

/* --- LIKE BUTTON --- */
.like-row {
    margin-top: 6px;
}

.like-btn {
    background: none;
    border: none;
    color: #333;
    font-family: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.like-btn:hover {
    color: #666;
}

.like-btn.liked {
    color: #FFFFFF;
}

/* --- COLOR SWATCHES (profile) --- */
.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s;
}

.color-swatch:hover {
    border-color: #888;
}

.color-swatch.selected {
    border-color: #FFFFFF;
}

/* --- ROOM HEADER IN CHAT --- */
.room-header {
    padding: 16px 0 0;
}

.room-header-name {
    color: #FFFFFF;
    font-size: 23px;
    font-weight: bold;
}

.room-header-desc {
    color: #444444;
    font-size: 18px;
    margin-top: 2px;
}

.room-header-divider {
    border: none;
    border-top: 1px solid #1a1a1a;
    margin: 10px 0 0;
}
