* {
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #15202b;
    color: #ffffff;
    margin: 0;
    padding: 20px;
    line-height: 1.5;
}
.container {
    max-width: 700px;
    margin: 0 auto;
}
h1 {
    color: #1da1f2;
    border-bottom: 1px solid #38444d;
    padding-bottom: 15px;
}
.stats {
    background: #192734;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.stat {
    text-align: center;
}
.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #1da1f2;
}
.stat-label {
    font-size: 12px;
    color: #8899a6;
}
.search-box {
    background: #192734;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}
.search-row {
    display: flex;
    gap: 10px;
}
.search-row input {
    flex: 1;
}
.search-box input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #38444d;
    border-radius: 25px;
    background: #253341;
    color: #ffffff;
    font-size: 16px;
    outline: none;
}
.search-box input[type="text"]:focus {
    border-color: #1da1f2;
}
#search-btn {
    padding: 12px 24px;
    background: #1da1f2;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
}
#search-btn:hover {
    background: #1a91da;
}
.filters {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.filters select, .filters input[type="date"] {
    padding: 8px;
    border: 1px solid #38444d;
    border-radius: 5px;
    background: #253341;
    color: #ffffff;
    font-size: 14px;
}
.post {
    background: #192734;
    border: 1px solid #38444d;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    transition: background 0.2s;
}
.post:hover {
    background: #1e3a4f;
}
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.author {
    font-weight: bold;
}
.handle {
    color: #8899a6;
    font-size: 14px;
}
.date {
    color: #8899a6;
    font-size: 14px;
}
.post-text {
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 10px;
}
.post-text a {
    color: #1da1f2;
}
.post-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.post-images img {
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}
.post-images img:hover {
    transform: scale(1.02);
}
.post-link {
    display: inline-block;
    margin-top: 10px;
    color: #1da1f2;
    text-decoration: none;
    font-size: 14px;
}
.post-link:hover {
    text-decoration: underline;
}
.repost-badge {
    background: #38444d;
    color: #8899a6;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-bottom: 10px;
    display: inline-block;
}
.reply-badge {
    background: #1da1f233;
    color: #1da1f2;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-bottom: 10px;
    display: inline-block;
}
.quoted-post {
    background: #253341;
    border: 1px solid #38444d;
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
}
.quoted-post .quoted-author {
    color: #1da1f2;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 5px;
}
.quoted-post .quoted-text {
    color: #d9d9d9;
    font-size: 14px;
    white-space: pre-wrap;
}
.quoted-post a {
    color: #8899a6;
    font-size: 12px;
    text-decoration: none;
}
.quoted-post a:hover {
    text-decoration: underline;
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}
.pagination button {
    padding: 10px 20px;
    background: #1da1f2;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
}
.pagination button:disabled {
    background: #38444d;
    cursor: not-allowed;
}
.pagination button:not(:disabled):hover {
    background: #1a91da;
}
.page-info {
    color: #8899a6;
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-jump {
    display: flex;
    align-items: center;
    gap: 5px;
}
.page-jump input {
    width: 60px;
    padding: 8px;
    border: 1px solid #38444d;
    border-radius: 5px;
    background: #253341;
    color: #ffffff;
    font-size: 14px;
    text-align: center;
}
.page-jump button {
    padding: 8px 12px;
    background: #253341;
    color: #ffffff;
    border: 1px solid #38444d;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}
.page-jump button:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}
.loading {
    text-align: center;
    padding: 40px;
    color: #8899a6;
}
.no-results {
    text-align: center;
    padding: 40px;
    color: #8899a6;
}
.highlight {
    background: #1da1f233;
    padding: 2px 4px;
    border-radius: 3px;
}
/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.lightbox.active {
    display: flex;
}
.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}
/* Clickable posts */
.post.clickable {
    cursor: pointer;
}
.comment-count-badge {
    background: #1da1f233;
    color: #1da1f2;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 10px;
    display: inline-block;
}
/* Thread overlay */
.thread-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 900;
    overflow-y: auto;
    padding: 20px;
}
.thread-overlay.active {
    display: block;
}
.thread-container {
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: 40px;
}
.thread-close {
    text-align: right;
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    z-index: 910;
    padding: 10px 0;
}
.thread-close button {
    padding: 8px 20px;
    background: #38444d;
    color: #ffffff;
    border: 1px solid #536471;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}
.thread-close button:hover {
    background: #e0245e;
    border-color: #e0245e;
}
.thread-post {
    background: #192734;
    border: 2px solid #1da1f2;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
}
.thread-comments-header {
    color: #8899a6;
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #38444d;
}
.thread-comment {
    background: #192734;
    border: 1px solid #38444d;
    border-left: 3px solid #536471;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    margin-left: 20px;
}
.thread-comment .comment-author {
    font-weight: bold;
    font-size: 14px;
}
.thread-comment .comment-handle {
    color: #8899a6;
    font-size: 13px;
}
.thread-comment .comment-date {
    color: #8899a6;
    font-size: 12px;
    float: right;
}
.thread-comment .comment-text {
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}
.thread-comment .post-images {
    margin-top: 8px;
}
/* Search comment results */
.search-comment-badge {
    background: #7856ff33;
    color: #a78bfa;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-bottom: 10px;
    display: inline-block;
}
.search-comment-context {
    background: #253341;
    border-left: 3px solid #536471;
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #8899a6;
}
.search-comment-context .context-label {
    font-size: 11px;
    color: #536471;
    margin-bottom: 4px;
}
