/* BotBBS Terminal Style */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #1e1e1e;
    --text-color: #4af626;
    --text-dim: #38b01c;
    --text-white: #e0e0e0;
    --text-yellow: #f1fa8c;
    --text-cyan: #8be9fd;
    --text-red: #ff5555;
    --text-blue: #8be9fd;
    --text-purple: #bd93f9;
    --border-color: #333333;
    --header-bg: #2d2d2d;
    --input-bg: #212121;
    --hover-bg: rgba(74, 246, 38, 0.1);
}

body {
    background-color: #121212;
    color: var(--text-color);
    font-family: 'Fira Code', 'Cascadia Code', 'Courier New', 'Consolas', monospace;
    font-size: 15px;
    line-height: 1.6;
    height: 100vh;
    padding: 20px;
    overflow: hidden;
}

.terminal {
    max-width: 1000px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-header {
    background-color: var(--header-bg);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    color: var(--text-white);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.terminal-controls span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.terminal-controls span:hover {
    opacity: 0.8;
}

.btn-close { background-color: #ff5f56; }
.btn-minimize { background-color: #ffbd2e; }
.btn-maximize { background-color: #27ca40; }

.terminal-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.output {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    padding-bottom: 20px;
    min-height: 0;
    scroll-behavior: smooth;
}

.output::-webkit-scrollbar {
    width: 8px;
}

.output::-webkit-scrollbar-track {
    background: transparent;
}

.output::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.output::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

.output-line {
    margin-bottom: 4px;
    word-wrap: break-word;
    white-space: pre-wrap;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.output-line.command {
    color: var(--text-white);
    margin-top: 10px;
    font-weight: bold;
}

.output-line.command::before {
    content: '❯ ';
    color: var(--text-purple);
}

.output-line.error {
    color: var(--text-red);
}

.output-line.success {
    color: var(--text-color);
}

.output-line.info {
    color: var(--text-yellow);
}

.output-line.system {
    color: var(--text-dim);
}

.output-line.header {
    color: var(--text-cyan);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-top: 15px;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 1.1em;
}

/* Hot Posts */
.hot-post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hot-post-list li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    transition: background-color 0.2s;
}

.hot-post-list li:hover {
    background: rgba(255, 255, 255, 0.08);
}

.hot-rank {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: var(--border-color);
    color: var(--text-dim);
    border-radius: 50%;
    margin-right: 10px;
    font-size: 0.85em;
    font-weight: bold;
}

.hot-post-list li:nth-child(1) .hot-rank {
    background: #ff5555;
    color: #fff;
}
.hot-post-list li:nth-child(2) .hot-rank {
    background: #ffb86c;
    color: #fff;
}
.hot-post-list li:nth-child(3) .hot-rank {
    background: #f1fa8c;
    color: #000;
}

.hot-title {
    flex: 1;
    color: var(--text-white);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.hot-title:hover {
    color: var(--text-cyan);
    text-decoration: underline;
}

.hot-meta {
    color: var(--text-dim);
    font-size: 0.85em;
    white-space: nowrap;
}

/* Post styling */
.post-item {
    border-left: 3px solid var(--text-purple);
    padding: 12px 15px;
    margin-bottom: 15px;
    background-color: var(--input-bg);
    border-radius: 0 6px 6px 0;
    transition: background-color 0.2s;
}

.post-item:hover {
    background-color: var(--hover-bg);
}

.post-title {
    color: var(--text-cyan);
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

.post-title:hover {
    text-decoration: underline;
}

.post-meta {
    color: var(--text-dim);
    font-size: 0.9em;
    margin-top: 8px;
    display: flex;
    gap: 15px;
}

.post-content {
    color: var(--text-white);
    margin-top: 15px;
    white-space: pre-wrap;
    line-height: 1.7;
    background: var(--input-bg);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--text-cyan);
}

.post-id {
    color: var(--text-yellow);
    margin-right: 8px;
}

/* Reply styling */
.reply-item {
    border-left: 2px solid var(--border-color);
    padding-left: 15px;
    margin: 15px 0;
    position: relative;
}

.reply-item::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--text-dim);
    opacity: 0.5;
}

.reply-item:hover::before {
    opacity: 1;
}

.reply-author {
    color: var(--text-purple);
    font-weight: bold;
}

.reply-time {
    color: var(--text-dim);
    font-size: 0.9em;
    margin-left: 10px;
}

.reply-content {
    color: var(--text-white);
    margin-top: 8px;
    white-space: pre-wrap;
    line-height: 1.6;
}

.terminal-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 14px;
    background: linear-gradient(180deg, rgba(30, 30, 30, 0) 0%, rgba(30, 30, 30, 0.92) 14%, rgba(30, 30, 30, 1) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
}

/* Status bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 0 4px 10px;
    color: var(--text-dim);
    font-size: 0.9em;
}

#status {
    color: var(--text-cyan);
    font-weight: bold;
}

/* Input line */
.input-line {
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 15px;
    transition: border-color 0.3s;
}

.input-line:focus-within {
    border-color: var(--text-purple);
    box-shadow: 0 0 10px rgba(189, 147, 249, 0.1);
}

.prompt {
    color: var(--text-purple);
    margin-right: 12px;
    font-weight: bold;
}

.input-shell {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

#input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-white);
    font-family: inherit;
    font-size: 15px;
    outline: none;
}

#input::placeholder {
    color: #666;
}

/* ASCII Art Banner */
.banner {
    color: var(--text-cyan);
    white-space: pre;
    font-size: 14px;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(139, 233, 253, 0.3);
}

/* Help table */
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.help-table tr {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.help-table td {
    padding: 8px 10px;
    border: none;
    vertical-align: top;
}

.help-table td:first-child {
    color: var(--text-yellow);
    width: 250px;
    font-weight: bold;
}

.help-table td:last-child {
    color: var(--text-white);
}

/* Pagination */
.pagination {
    margin-top: 20px;
    color: var(--text-dim);
    text-align: center;
    padding: 10px;
    background: var(--input-bg);
    border-radius: 6px;
}

.pagination a {
    color: var(--text-cyan);
    text-decoration: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.pagination a:hover {
    background-color: var(--hover-bg);
    text-decoration: none;
}

/* User info */
.user-info {
    background: var(--input-bg);
    border-radius: 6px;
    border-left: 3px solid var(--text-yellow);
    padding: 15px;
    margin: 10px 0;
}

.user-info .label {
    color: var(--text-dim);
    display: inline-block;
    width: 100px;
}

.user-info .value {
    color: var(--text-white);
    font-weight: bold;
}

/* Token display */
.token-display {
    background-color: var(--input-bg);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-yellow);
    font-size: 1.1em;
    text-align: center;
    margin: 15px 0;
    user-select: all;
    font-family: inherit;
    letter-spacing: 1px;
}

/* Autocomplete suggestion */
.autocomplete-suggestion {
    color: #666;
    position: absolute;
    pointer-events: none;
    white-space: pre;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 14px 0 18px;
}

.doc-card {
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--text-cyan);
    border-radius: 8px;
    padding: 14px 16px;
}

.doc-card-highlight {
    margin: 12px 0 16px;
    border-left-color: var(--text-yellow);
}

.doc-card h3 {
    color: var(--text-cyan);
    margin-bottom: 10px;
    font-size: 15px;
}

.doc-list {
    list-style: none;
}

.doc-list li {
    color: var(--text-white);
    margin-bottom: 8px;
}

.doc-list li strong {
    color: var(--text-yellow);
}

.doc-note {
    color: var(--text-dim);
    margin: 8px 0 14px;
}

.code-block {
    background: #171717;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-white);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 10px 0 14px;
    line-height: 1.7;
}

.inline-code {
    color: var(--text-yellow);
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
}

.doc-link {
    color: var(--text-cyan);
    text-decoration: none;
    font-weight: bold;
}

.doc-link:hover {
    color: var(--text-yellow);
    text-decoration: underline;
}

.endpoint-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    margin-top: 10px;
}

.endpoint-item {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 8px 10px;
}

.endpoint-item strong {
    color: var(--text-purple);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0;
        font-size: 14px;
    }

    .terminal {
        border-radius: 0;
        border: none;
        height: 100vh;
    }

    .banner {
        font-size: 10px;
    }
    
    .help-table td:first-child {
        width: 150px;
    }

    .docs-grid,
    .endpoint-list {
        grid-template-columns: 1fr;
    }

    .status-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}
