/* Main Container */
body {
    background-color: black;
}

.thread-detail-container {
    max-width: 80%;
    margin: 40px auto;
    padding: 0 20px;
    background-color: black;
}

/* Thread Header */
.thread-header {
    background-color: #1a1a1a;
    padding: 24px;
    padding-bottom: 5px;
    border-radius: 12px 12px 0 0;
    border: 1px solid #2a2a2a;
}

.thread-title {
    font-family: 'Space Mono', monospace;
    font-size: 1.9rem;
    color: white !important;
    margin: 0 0 5px 0;
    line-height: 1.3;
    font-weight: 600;
}

.thread-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.thread-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
}

.thread-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
}

.thread-author {
    color: #fff;
    font-weight: 600;
}

.thread-date {
    color: #666;
}

.thread-date::before {
    content: "•";
    margin-right: 8px;
}

/* Thread Content */
.thread-content-wrapper {
    background-color: #1a1a1a;
    padding: 20px 24px;
    padding-top: 20px;
    border-left: 1px solid #2a2a2a;
    border-right: 1px solid #2a2a2a;
    border-bottom: 1px solid #2a2a2a;
    border-radius: 0 0 12px 12px;
    margin-bottom: 16px;
}

.thread-content {
    max-height: none;
    overflow: hidden;
}

.thread-content.collapsed {
    max-height: 200px;
    position: relative;
}

.thread-content.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #1a1a1a);
}

.thread-content p {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    line-height: 1.7;
    color: white !important;
    margin: 0;
    white-space: pre-wrap;
}

.show-more-btn {
    background: none;
    border: none;
    color: #2a7fff;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 8px;
    font-weight: 600;
}

.show-more-btn:hover {
    color: #1a6fe8;
}

/* Thread Actions */
.thread-actions {
    padding: 12px 0;
    margin-bottom: 8px;
}

.reply-count-badge {
    font-family: 'Space Mono', monospace;
    color: #888;
    font-size: 0.85rem;
    font-weight: 600;
}

.reply-count-badge i {
    margin-right: 6px;
}

.replies-divider {
    height: 24px;
}

/* Main Reply Section */
.main-reply-section {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.main-reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #888;
}

.reply-avatar-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2a7fff, #1a6fe8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.main-reply-form {
    width: 100%;
}

.main-reply-form textarea {
    width: 100% !important;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    padding: 16px;
    background-color: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    color: white;
    resize: none;
    overflow: hidden;
    min-height: 50px;
    max-height: 300px;
    line-height: 1.6;
    box-sizing: border-box;
}

.main-reply-form textarea:focus {
    outline: none;
    border-color: #2a7fff;
}

.main-form-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.submit-main-btn {
    font-family: 'Space Mono', monospace;
    background-color: #2a7fff;
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 0.95rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.submit-main-btn:hover {
    background-color: #1a6fe8;
}

/* Comments Section */
.comments-section {
    margin-top: 0;
}

/* Reply Wrapper */
.reply-wrapper {
    margin-bottom: 4px;
    transition: margin-left 0.2s ease;
}

.reply-wrapper.nested {
    margin-left: 20px;
    border-left: 2px solid #2a2a2a;
}

/* Reply Header */
.reply-header {
    padding: 8px 0;
}

.reply-meta-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reply-avatar-tiny {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.reply-author-name {
    font-family: 'Space Mono', monospace;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

.reply-timestamp {
    font-family: 'Space Mono', monospace;
    color: #666;
    font-size: 0.75rem;
}

.collapse-thread-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0 8px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-left: auto;
    transition: color 0.2s ease;
}

.collapse-thread-btn:hover {
    color: #888;
}

/* Reply Thread */
.reply-thread {
    display: block;
}

.reply-content-area {
    display: flex;
    gap: 12px;
    padding: 8px 0;
}

.reply-indent-line {
    width: 2px;
    background-color: transparent;
    flex-shrink: 0;
    margin-left: 11px;
}

.reply-wrapper.nested .reply-indent-line {
    background-color: #2a2a2a;
}

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

/* Reply Text */
.reply-text {
    max-height: none;
    overflow: hidden;
}

.reply-text.collapsed {
    max-height: 150px;
    position: relative;
}

.reply-text.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, black);
}

.reply-text p {
    font-family: 'Space Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: white !important;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.show-more-btn-small {
    background: none;
    border: none;
    color: #2a7fff;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 6px 0;
    margin-top: 6px;
    font-weight: 600;
}

.show-more-btn-small:hover {
    color: #1a6fe8;
}

/* Reply Actions */
.reply-actions {
    margin-top: 8px;
    display: flex;
    gap: 12px;
}

.reply-action-btn {
    background: none;
    border: none;
    color: #666;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.reply-action-btn:hover {
    color: #2a7fff;
}

/* Inline Reply Form */
.inline-reply-form {
    margin-top: 12px;
    padding: 16px;
    background-color: #0a0a0a;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
}

.inline-form-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #666;
}

.replying-to {
    font-style: italic;
}

.nested-reply-form-inner {
    width: 100%;
}

.nested-reply-form-inner textarea {
    width: 100% !important;
    font-family: 'Space Mono', monospace;
    font-size: 0.95rem;
    padding: 12px 16px;
    background-color: #000;
    border: 1px solid #333;
    border-radius: 6px;
    color: white;
    resize: none;
    overflow: hidden;
    min-height: 45px;
    max-height: 250px;
    line-height: 1.5;
    box-sizing: border-box;
}

.nested-reply-form-inner textarea:focus {
    outline: none;
    border-color: #2a7fff;
}

.inline-form-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cancel-inline-btn {
    font-family: 'Space Mono', monospace;
    background-color: transparent;
    color: #888;
    border: 1px solid #333;
    padding: 7px 16px;
    font-size: 0.85rem;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cancel-inline-btn:hover {
    background-color: #1a1a1a;
    color: white;
}

.submit-inline-btn {
    font-family: 'Space Mono', monospace;
    background-color: #2a7fff;
    color: white;
    border: none;
    padding: 7px 18px;
    font-size: 0.85rem;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.submit-inline-btn:hover {
    background-color: #1a6fe8;
}

/* Child Replies */
.child-replies {
    margin-top: 12px;
}

/* No Comments */
.no-comments {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-comments i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-comments p {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    margin: 0;
}

/* Login Prompt */
.login-prompt {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 24px;
    text-align: center;
}

.login-prompt p {
    font-family: 'Space Mono', monospace;
    color: #888;
    font-size: 0.95rem;
    margin: 0;
}

.login-prompt a {
    color: #2a7fff;
    text-decoration: none;
    font-weight: 600;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* Back Link */
.back-link {
    margin-top: 40px;
    display: flex;
    justify-content: flex-end;
}

.back-btn {
    font-family: 'Space Mono', monospace;
    background-color: #28a745;
    color: white !important;
    text-decoration: none !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background-color: #218838;
    text-decoration: none !important;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .thread-detail-container {
        max-width: 95%;
        padding: 0 10px;
    }

    .reply-wrapper.nested {
        margin-left: 12px;
    }
    
    .thread-title {
        font-size: 1.5rem;
    }
}