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

body {
    /* Set the font to a common monospaced stack for the terminal feel */
    font-family: 'Andale Mono', 'Courier New', Courier, monospace;
    /* Black background */
    background-color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    /* Default text color to terminal green */
    color: #A9A9A9;
}

/* --- STICKY BANNER STYLES --- */
.sticky-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #000000;
    border-bottom: 1px solid #A9A9A9;
    padding: 10px 20px;
    z-index: 1000;
    font-family: 'Andale Mono', 'Courier New', Courier, monospace;
    color: #A9A9A9;
    font-size: 14px;
}

.sticky-banner p {
    margin: 0;
    text-align: center;
}

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

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

/* Add top padding to body when banner is present */
body.has-banner {
    padding-top: 0; /* Remove body padding - let individual containers handle spacing */
}

/* Ensure containers account for fixed banner */
body.has-banner #chat-container {
    margin-top: 0;
}

body.has-banner .homepage-form-container {
    padding-top: 80px; /* Extra space for banner on homepage */
}

#chat-container {
    width: 90%;
    max-width: 700px;
    height: 80vh;
    background-color: #000000;
    /* No rounded edges */
    border-radius: 0;
    /* Remove the shadow */
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

/* Chat page specific styles */
body.chat-page {
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

body.chat-page #chat-container {
    height: 100vh;
    max-width: 700px;
    width: 90%;
    margin: 0 auto;
}

/* Special handling for chat page with banner */
body.chat-page.has-banner {
    align-items: stretch;
    padding-top: 0;
}

body.chat-page.has-banner #chat-container {
    margin-top: 0;
    padding-top: 70px;
}

#chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 60px 15px 15px;
    font-size: 0.7em;
    /* Hide scrollbar but keep scroll behavior */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#chat-box::-webkit-scrollbar {
    display: none;
}

.message {
    margin-bottom: 15px;
    padding: 5px 0; /* Adjusted padding for a cleaner look */
    /* No rounded edges */
    border-radius: 0;
    max-width: 100%;
    line-height: 1.5;
    /* Ensure background is transparent to show the black container */
    background-color: transparent;
}

.user-message {
    /* User's text will be white for contrast */
    color: #FFFFFF;
}

.assistant-message {
    /* Assistant's text will be the main terminal green */
    color: #A9A9A9;
}

/* Row layout for threaded messages: avatar left, content right */
.message-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #1a1a1a;
    margin-top: 2px;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.message-content {
    flex: 1;
    min-width: 0;
}

/* Responses (non–news update): threaded look */
.message.assistant-message.message--threaded {
    margin-top: -15px;
    margin-left: 0;
    padding-left: 0;
}

.message-text {
    font-size: 1em;
    margin-top: 0;
    margin-bottom: 20px;
}

.message-meta {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.85;
}

.message-time {
    font-weight: normal;
    margin-left: 8px;
}

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

@keyframes message-flash {
    0% { background-color: #0d3300; color: #7FFF00; }
    100% { background-color: transparent; color: #A9A9A9; }
}

#chat-form {
    display: flex;
    padding: 15px;
    flex-shrink: 0; /* Keep form pinned at bottom */
}

#message-input {
    flex-grow: 1;
    /* Green border, no rounded edges */
    border: 1px solid #A9A9A9;
    border-radius: 0;
    padding: 10px 15px;
    font-size: 16px;
    /* Match the terminal theme */
    background-color: #000000;
    color: #FFFFFF;
    font-family: inherit; /* Inherit the monospaced font */
}

#message-input:focus {
    outline: none;
    border-color: #FFFFFF; /* Highlight with white border on focus */
}

/* --- NEW CSS RULES FOR LINKS --- */
a {
    /* Set all links to white */
    color: #FFFFFF;
    /* Ensure the link is always underlined */
    text-decoration: underline;
}

a:hover {
    /* Keep white color on hover for consistency */
    color: #FFFFFF;
}

.message a {
    /* Set the link color to white */
    color: #FFFFFF;
    /* Ensure the link is always underlined */
    text-decoration: underline;
}

.message a:hover {
    /* Keep white color on hover for consistency */
    color: #FFFFFF;
}

/* --- LOGIN FORM STYLES --- */
.login-form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    min-height: 200px;
}

#login-form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

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

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

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

#login-button:hover {
    background-color: #333333;
}

/* --- HOMEPAGE STYLES --- */
.homepage-form-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 40px 20px;
    min-height: 200px;
}

/* --- PROFILE PAGE STYLES --- */
.info-item {
    margin-bottom: 20px;
}

.user-info hr {
    border: none;
    border-top: 1px solid #333333;
    margin: 30px 0;
}

.profile-header {
    width: 100%;
    max-width: 600px;
    margin-bottom: 12px;
}

.user-info {
    width: 100%;
    max-width: 600px;
}

/* --- SETTINGS PAGE STYLES --- */
.settings-section {
    background-color: #0a0a0a;
    border: 1px solid #333333;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 600px;
}

.settings-section h3 {
    color: #FFFFFF;
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333333;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #FFFFFF;
    font-size: 14px;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background-color: #000000;
    color: #FFFFFF;
    border: 1px solid #A9A9A9;
    border-radius: 0;
    font-family: 'Andale Mono', 'Courier New', Courier, monospace;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FFFFFF;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    cursor: pointer;
}

.investor-field {
    margin-top: 15px;
}

.readonly-field {
    color: #A9A9A9;
    font-family: 'Andale Mono', 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 10px 0;
    display: block;
}

.form-group small {
    display: block;
    color: #A9A9A9;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
    margin-top: 30px;
    padding-top: 20px;
    width: 100%;
}

.save-button {
    width: 100%;
    padding: 10px 20px;
    background-color: #000000;
    color: #FFFFFF;
    border: 1px solid #A9A9A9;
    border-radius: 0;
    font-family: 'Andale Mono', 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    box-sizing: border-box;
}

.save-button:hover {
    background-color: #333333;
}

.cancel-link {
    color: #A9A9A9;
    text-decoration: underline;
    font-size: 14px;
}

.cancel-link:hover {
    color: #FFFFFF;
}

/* --- NEWSLETTER STYLES --- */
.newsletter-section {
    width: 100%;
    margin-bottom: 10px;
}

.newsletter-section h1 {
    color: #FFFFFF;
    font-size: 28px;
    margin-bottom: 5px;
    font-weight: bold;
}

.newsletter-section h4 {
    color: #FFFFFF;
    font-size: 18px;
    margin-top: -5px;
    margin-bottom: 20px;
    font-weight: normal;
}

.newsletter-overview {
    margin-bottom: 30px;
}

.newsletter-overview p {
    color: #FFFFFF;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.overview-text {
    color: #FFFFFF;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.last-updated {
    color: #A9A9A9;
    font-size: 12px;
    font-style: italic;
}

.overview-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.expand-button {
    background: none;
    border: none;
    color: #A9A9A9;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-left: 5px;
    font-family: inherit;
}

.expand-button:hover {
    color: #FFFFFF;
}

.topics-section {
    width: 100%;
}

.topic {
    margin-bottom: 40px;
    border-left: 2px solid #A9A9A9;
    padding-left: 20px;
}

.topic h3 {
    color: #FFFFFF;
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: bold;
}

.topic-summary {
    color: #FFFFFF;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.opinions {
    margin-left: 20px;
}

.opinion {
    margin-bottom: 15px;
    padding-left: 15px;
}

.opinion-text {
    color: #CCCCCC;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 5px;
}

.opinion-source {
    color: #A9A9A9;
    font-size: 12px;
    font-style: italic;
    margin: 0;
}

/* --- NEWSLETTER ARCHIVE STYLES --- */
.newsletter-item {
    width: 100%;
    margin-bottom: 20px;
    padding: 15px 0;
}

.newsletter-name {
    color: #A9A9A9;
    font-size: 12px;
    margin-bottom: 5px;
}

.newsletter-meta {
    margin-bottom: -20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.time-ago {
    color: #A9A9A9;
    font-size: 12px;
}

span.time-ago {
    margin-bottom: 4px;
}

.newsletter-content {
    border-left: 2px solid #A9A9A9;
    padding-left: 20px;
    margin-bottom: 0;
}

.newsletter-subject {
    color: #FFFFFF;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: bold;
}

.newsletter-summary {
    margin-bottom: 20px;
}

.newsletter-summary p {
    color: #CCCCCC;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
}

.newsletter-topics {
    margin-bottom: 15px;
}

.newsletter-topics h5 {
    color: #FFFFFF;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: bold;
}

.newsletter-topics p {
    color: #CCCCCC;
    font-size: 14px;
    margin: 0;
}

.newsletter-topics ul {
    color: #CCCCCC;
    font-size: 14px;
    margin: 0;
    padding-left: 20px;
}

.newsletter-topics li {
    margin-bottom: 5px;
}

.newsletter-separator {
    border: none;
    border-top: 1px solid #333333;
    margin: 15px 0;
}

.no-newsletters {
    text-align: center;
    padding: 40px 20px;
}

.no-newsletters p {
    color: #A9A9A9;
    font-size: 16px;
}

.footer-info {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333333;
}

.footer-info p {
    color: #A9A9A9;
    font-size: 14px;
    text-align: center;
}

/* --- POSTS STYLES --- */
.post-item {
    width: 100%;
    margin-bottom: 20px;
    padding: 15px 0;
}

.post-meta {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.post-title {
    color: #FFFFFF;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: bold;
}

.post-title a {
    color: #FFFFFF;
    text-decoration: none;
}

.post-title a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

.post-content {
    margin-bottom: 20px;
}

.post-separator {
    border: none;
    border-top: 1px solid #333333;
    margin: 15px 0;
}

.no-posts {
    text-align: center;
    padding: 40px 20px;
}

.no-posts p {
    color: #A9A9A9;
    font-size: 16px;
}

.post-header {
    margin-bottom: 30px;
}

.post-header h1 {
    color: #FFFFFF;
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: bold;
    line-height: 1.2;
}

.post-body {
    color: #FFFFFF;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 40px;
}

.post-body h1, .post-body h2, .post-body h3, .post-body h4, .post-body h5, .post-body h6 {
    color: #FFFFFF;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: bold;
}

.post-body h1 { font-size: 28px; }
.post-body h2 { font-size: 24px; }
.post-body h3 { font-size: 20px; }
.post-body h4 { font-size: 18px; }
.post-body h5 { font-size: 16px; }
.post-body h6 { font-size: 14px; }

.post-body p {
    margin-bottom: 15px;
    color: #FFFFFF;
}

.post-body ul, .post-body ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.post-body li {
    margin-bottom: 5px;
    color: #FFFFFF;
}

.post-body blockquote {
    border-left: 3px solid #A9A9A9;
    padding-left: 20px;
    margin: 20px 0;
    color: #CCCCCC;
    font-style: italic;
}

.post-body strong, .post-body b {
    font-weight: bold;
}

.post-body em, .post-body i {
    font-style: italic;
}

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

.post-body a:hover {
    color: #FFFFFF;
}

/* --- CHAT LIKES & COMMENTS --- */
.chat-actions {
    display: flex;
    gap: 15px;
    margin-top: 6px;
}

.chat-action-btn {
    background: none;
    border: none;
    color: #A9A9A9;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-action-btn:hover {
    color: #FFFFFF;
}

.chat-action-btn.liked {
    color: #FFFFFF;
}

.chat-action-btn .like-icon {
    font-size: 13px;
}

.chat-comments-section {
    margin-top: 10px;
    margin-left: 46px;
    padding-left: 12px;
    border-left: 1px solid #333;
}

.chat-comments-loading {
    font-size: 11px;
    color: #A9A9A9;
    padding: 6px 0;
}

.chat-comments-loading a {
    color: #FFFFFF;
}

.chat-comment-item {
    margin-bottom: 8px;
}

.chat-comment-meta {
    font-size: 10px;
    color: #A9A9A9;
    display: block;
    margin-bottom: 2px;
}

.chat-comment-meta.chat-comment-own {
    color: #888;
}

.chat-comment-body {
    font-size: 12px;
    color: #FFFFFF;
    line-height: 1.4;
}

.chat-comment-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.chat-comment-input {
    flex-grow: 1;
    background: #000;
    border: 1px solid #333;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 12px;
    padding: 5px 8px;
}

.chat-comment-input:focus {
    outline: none;
    border-color: #A9A9A9;
}

.chat-comment-submit {
    background: #000;
    border: 1px solid #333;
    color: #A9A9A9;
    font-family: inherit;
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
}

.chat-comment-submit:hover {
    color: #FFFFFF;
    border-color: #A9A9A9;
}
