/* ============================================================
   TOPIC.PHP — mövzu görünüşü + cavablar
   ============================================================ */

.topic-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; }

.topic-header { background: var(--white); border: 1px solid var(--border-light); border-radius: 24px; padding: 32px; margin-bottom: 24px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.topic-header::before { content: ''; position: absolute; left: 0; top: 0; width: 6px; height: 100%; background: var(--yellow); }
.topic-header h1 { font-size: 28px; font-weight: 900; margin-top: 0; line-height: 1.3; letter-spacing: -0.5px; }
.topic-meta-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); font-weight: 600; margin-top: 16px; }
.topic-meta-row span { display: flex; align-items: center; gap: 6px; }
.topic-tag { background: rgba(255,193,7,0.15); color: var(--yellow-hover); font-weight: 800; padding: 4px 12px; border-radius: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.topic-flags { display: flex; gap: 8px; margin-top: 12px; }
.topic-flag { font-size: 12px; font-weight: 800; text-transform: uppercase; padding: 4px 10px; border-radius: 8px; }
.flag-locked { background: rgba(255,43,43,0.1); color: var(--danger); }
.flag-solved { background: rgba(16,185,129,0.15); color: var(--success); }

.post-card { background: var(--white); border: 1px solid var(--border-light); border-radius: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 200px 1fr; transition: 0.3s; }
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card.solved { border-color: rgba(16,185,129,0.3); box-shadow: 0 4px 20px rgba(16,185,129,0.08); }
.post-card.solved::before { content: ''; position: absolute; left: 0; top: 0; width: 6px; height: 100%; background: var(--success); border-radius: 24px 0 0 24px; }
.post-author-col { padding: 24px; border-right: 1px dashed var(--border-light); text-align: center; background: var(--light-bg); border-radius: 24px 0 0 24px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.post-author-col img { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.06); object-fit: cover; }
.post-author-col h4 { font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.author-badge { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 4px 10px; border-radius: 8px; margin-bottom: 10px; letter-spacing: 0.5px; }
.badge-op { background: rgba(255,193,7,0.2); color: var(--yellow-hover); }
.badge-usta { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-admin-role { background: rgba(255,43,43,0.12); color: var(--danger); }
.author-stats { font-size: 12px; color: var(--text-muted); line-height: 1.6; font-weight: 600; width: 100%; text-align: left; background: var(--white); padding: 12px; border-radius: 12px; border: 1px solid var(--border-light); margin-top: auto; }
.author-stats div { display: flex; justify-content: space-between; margin-bottom: 4px; }
.author-stats div:last-child { margin-bottom: 0; }

.post-body-col { padding: 24px 32px; display: flex; flex-direction: column; }
.post-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px dashed var(--border-light); }
.post-time { font-size: 13px; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.post-num { font-size: 13px; color: var(--text-muted); font-weight: 800; background: var(--light-bg); padding: 4px 10px; border-radius: 8px; }
.post-content { font-size: 15px; line-height: 1.8; color: var(--text-main); white-space: pre-line; word-break: break-word; flex: 1; }
.post-content blockquote { border-left: 4px solid var(--yellow); padding-left: 16px; margin: 16px 0; background: var(--light-bg); color: var(--text-muted); font-style: italic; border-radius: 0 12px 12px 0; padding: 16px; font-size: 14px; }
.solved-banner { display: flex; align-items: center; gap: 10px; background: rgba(16,185,129,0.1); color: var(--success); font-weight: 800; font-size: 14px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid rgba(16,185,129,0.2); }
.post-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--border-light); flex-wrap: wrap; }
.btn-action { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-muted); background: var(--light-bg); border: 1px solid var(--border-light); padding: 8px 16px; border-radius: 12px; cursor: pointer; transition: 0.2s; }
.btn-action:hover { background: var(--black); color: var(--yellow); border-color: var(--black); transform: translateY(-2px); }
.btn-action.liked { color: var(--yellow-hover); background: rgba(255,193,7,0.1); border-color: rgba(255,193,7,0.2); }
.btn-action.mark-solved { color: var(--success); }
.btn-action.mark-solved:hover { background: var(--success); color: var(--white); border-color: var(--success); }

.reply-box { background: var(--white); border: 1px solid var(--border-light); border-radius: 24px; padding: 32px; box-shadow: var(--shadow-sm); margin-top: 16px; }
.reply-box h3 { font-size: 20px; font-weight: 800; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.reply-textarea { width: 100%; border: 1px solid var(--border); background: var(--light-bg); border-radius: 16px; padding: 20px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 500; min-height: 150px; resize: vertical; outline: none; margin-bottom: 20px; transition: 0.3s; }
.reply-textarea:focus { border-color: var(--yellow); background: var(--white); box-shadow: 0 4px 15px rgba(255,212,59,0.1); }
.reply-actions { display: flex; justify-content: flex-end; }
.locked-notice { text-align: center; padding: 24px; color: var(--text-muted); font-size: 15px; font-weight: 700; background: var(--light-bg); border-radius: 16px; border: 1px dashed var(--border); }
.pending-notice { background: rgba(255,193,7,0.1); color: #b38600; font-size: 14px; font-weight: 700; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

.related-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; padding: 12px; border-radius: 12px; transition: 0.2s; border: 1px solid transparent; }
.related-item:hover { background: var(--light-bg); border-color: var(--border-light); transform: translateX(4px); }
.related-item img { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; }
.related-info { min-width: 0; flex: 1; }
.related-info h5 { font-size: 14px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.related-info h5:hover { color: var(--yellow-hover); }
.related-info p { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }

@media (max-width: 1100px) {
    .topic-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .post-card { grid-template-columns: 1fr; }
    .post-author-col { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px; border-radius: 20px 20px 0 0; border-right: none; border-bottom: 1px dashed var(--border-light); }
    .post-author-col img { margin: 0; width: 48px; height: 48px; border-radius: 12px; }
    .author-info-mobile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1; padding: 0 12px; }
    .author-stats { display: none; /* Hide detailed stats on mobile row */ }
    .post-body-col { padding: 20px; }
    .reply-box { padding: 20px; }
}

/* IMAGE LIGHTBOX */
.post-content img {
    max-width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: var(--transition);
    margin: 12px 0;
}
.post-content img:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-sm);
}

.image-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}
.image-modal.active {
    opacity: 1;
    visibility: visible;
}
.image-modal img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    object-fit: contain;
}
.image-modal-close {
    position: absolute;
    top: 20px; right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
    transition: 0.2s;
}
.image-modal-close:hover {
    color: var(--yellow);
    transform: scale(1.1);
}
