/* Topic Page Styles */

/* Topic Header */
.topic-header {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.topic-header h1 {
    font-size: 1.8rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.topic-header h1 i {
    color: var(--primary-color);
}

.topic-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Posts Container */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Post Item */
.post-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: 250px 1fr;
    overflow: hidden;
}

.post-item.original-post {
    border: 2px solid var(--primary-color);
}

/* Post Sidebar */
.post-sidebar {
    background: var(--light-color);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
}

.user-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    margin-bottom: 1rem;
}

.username {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.username:hover {
    color: var(--primary-color);
}

.user-rank {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.user-rank.expert {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.user-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.user-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.user-stat i {
    color: var(--primary-color);
}

/* Post Content */
.post-content {
    padding: 1.5rem;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.post-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: #6b7280;
}

.post-number {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.post-action-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.post-action-btn:hover {
    background: var(--light-color);
}

.post-action-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Post Body */
.post-body {
    color: var(--text-color);
    line-height: 1.8;
}

.post-body h4 {
    margin: 1.5rem 0 1rem;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.post-body p {
    margin-bottom: 1rem;
}

.post-body ul,
.post-body ol {
    margin: 1rem 0 1rem 2rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.post-image {
    margin: 1.5rem 0;
}

/* Quote Box */
.quote-box {
    background: var(--light-color);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.quote-header {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quote-header i {
    color: var(--primary-color);
}

.quote-box p {
    margin: 0;
    color: #6b7280;
    font-style: italic;
}

/* Info Boxes */
.info-box,
.success-box {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.info-box {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.success-box {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.info-box i,
.success-box i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.comparison-table th,
.comparison-table td {
    padding: 0.8rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.comparison-table tr:nth-child(even) {
    background: var(--light-color);
}

/* Post Footer */
.post-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.post-reactions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.reaction {
    padding: 0.4rem 0.8rem;
    background: var(--light-color);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.reaction:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.post-signature {
    margin-top: 1rem;
}

.post-signature hr {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 1rem 0;
}

.post-signature p {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0;
}

/* Reply Form */
.reply-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.reply-form h3 {
    font-size: 1.3rem;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reply-form h3 i {
    color: var(--primary-color);
}

.login-required {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.login-required i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-required p {
    font-size: 1.1rem;
}

.login-required a {
    color: var(--primary-color);
    font-weight: 600;
}

.quick-reply-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reply-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--light-color);
    border-radius: 6px;
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.toolbar-btn:hover {
    background: var(--primary-color);
    color: white;
}

.quick-reply-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
}

/* Sidebar Widgets */
.topic-info-widget {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--light-color);
    border-radius: 6px;
}

.info-label {
    color: #6b7280;
    font-size: 0.9rem;
}

.info-value {
    font-weight: 600;
    color: var(--dark-color);
}

.similar-topics {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.similar-topic {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: var(--light-color);
    border-radius: 6px;
    color: var(--dark-color);
    transition: all 0.3s;
}

.similar-topic:hover {
    background: var(--primary-color);
    color: white;
}

.similar-topic i {
    font-size: 0.9rem;
}

.users-in-topic {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.topic-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s;
}

.topic-user:hover {
    background: var(--light-color);
}

.topic-user img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.topic-user span {
    font-weight: 500;
    color: var(--dark-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .post-item {
        grid-template-columns: 1fr;
    }
    
    .post-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .user-card {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
    }
    
    .user-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .topic-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .topic-header h1 {
        font-size: 1.3rem;
    }
    
    .topic-actions {
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .comparison-table {
        font-size: 0.85rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem;
    }
}

