/* Index */
.board-header { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0; }
.board-header h1 { font-size: 1.25rem; font-weight: 500; margin: 0; display: flex; align-items: center; margin-right: 0.5rem; }
.board-header h1 .total-count { font-size: 1rem; color: var(--bs-gray-700); font-weight: 400; margin-left: 0.25rem; }

.board-search-form input:focus, .board-search-form select:focus { outline: none; box-shadow: none; }

.board-posts-table { width: 100%; border-collapse: collapse; }
.board-posts-table th, .board-posts-table td { padding: 0.75rem; text-align: center; border-bottom: 1px solid var(--bs-gray-200); font-size: 0.9rem; color: var(--bs-gray-700); }
.board-posts-table th { border-top: solid 1px #000; font-weight: 400; }
.board-posts-table tr.notice td { background-color: var(--bs-gray-100); }
.board-posts-table a:link, .board-posts-table a:visited { color: #000; text-decoration: none; }
.board-posts-table a:hover { color: var(--bs-red); }

.board-posts-table tr.active { background-color: #f8f9fa; font-weight: 600; border-left: 3px solid var(--bs-red); }
.board-posts-table tr.active a { color: var(--bs-red); }

.board-posts-table td.title { text-align: left; max-width: 70%; min-width: 50%; }
.board-posts-table td.author { text-align: left; white-space: nowrap; }
.board-posts-table td.date { text-align: right; white-space: nowrap; }

.post-title { min-width: 300px; }

.post-categories { display: flex; align-items: center; gap: 0.25rem; font-size: 0.6rem; margin-right: 0.25rem; margin-bottom: 0.25rem; }
.post-categories span { border: solid 1px var(--bs-gray-700); color: var(--bs-gray-700); border-radius: 2rem; padding: 0 0.25rem; }

.board-footer { display: flex; justify-content: flex-end; align-items: center; margin-top: 1rem; }

@media (min-width: 768px) {
    .post-title { display: flex; align-items: center; justify-content: flex-start; }
    .post-categories { margin-bottom: 0; }
}

/* Author Profile Photos */
.profile-photo { width: 50px; height: 50px; border: 1px solid rgba(0, 0, 0, 0.1); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); transition: all 0.2s ease; border-radius: 50%; object-fit: cover; }
.profile-photo-icon { font-size: 50px; color: var(--bs-gray-300); line-height: 1; }
.profile-photo:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); transform: scale(1.05); }

/* Password Form */
.private-form-container { display: flex; justify-content: center; align-items: center; flex-direction: column; min-height: 60vh; max-width: 768px; margin: 2rem auto; border: solid 1px var(--bs-gray-200); padding: 4rem; border-radius: 2rem; box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.075); }
.private-form-container input.form-control { width: 100%; padding: 0.75rem 1rem; border: solid 1px var(--bs-gray-300); border-radius: 0.5rem; font-size: 1rem; transition: border-color 0.2s, box-shadow 0.2s; margin: 1rem 0 2rem 0; }

/* Author Profile Photos */
.profile-photo { width: 40px; height: 40px; border: 1px solid rgba(0, 0, 0, 0.1); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); transition: all 0.2s ease; border-radius: 50%; object-fit: cover; }
.profile-photo-icon { font-size: 40px; color: var(--bs-gray-300); line-height: 1; }
.profile-photo:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); transform: scale(1.05); }

/* Show */
.content-container { max-width: 768px; margin: 0 auto; padding: 1.5rem; }

.show h1 { line-height: 1.2; margin: 1rem 0; }
.show time { display: block; font-size: 0.9rem; font-weight: 600; color: var(--bs-gray-600); margin: 0 0 1rem 0.25rem; }

.show .post-meta { display: flex; gap: 1rem; align-items: center; font-size: 0.9rem; color: var(--bs-gray-600); margin: 1rem 0; line-height: 1.2; }
.show .name { font-weight: 500; color: #000; }
.show span { word-break: keep-all; }

.header-image { margin: 1rem 0; }
.header-image img { width: 100%; object-fit: contain; object-position: center; }
.header-image .image-caption { font-size: 0.85rem; color: var(--bs-gray-600); margin-top: 0.5rem; text-align: center; }

@media (min-width: 768px) {
    .header-image img { max-height: 60vh; }
}

.like-btn { background: none; border: none; color: var(--bs-gray-700); padding: 0; font-size: 0.9rem; display: flex; align-items: center; gap: 0.25rem; cursor: pointer; }

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.tags span::before { content: "#"; color: var(--bs-gray-500); }

.action-buttons { margin-top: 3rem; display: flex; gap: 0.5rem; justify-content: flex-end; align-items: center; }

/* Attachments */
.attachments { margin: 3rem 0; }
.attachments h6 { margin-bottom: 1rem; }

.attachment-list { display: flex; flex-direction: column; gap: 1rem; }

.attachment-item { display: flex; flex-direction: column; border: 1px solid var(--bs-gray-200); border-radius: 0.5rem; background: #fff; transition: all 0.2s ease; overflow: hidden; }
.attachment-item:hover { border-color: var(--bs-gray-300); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.attachment-item-body { display: flex; gap: 1rem; padding: 1rem; flex: 1; }

.attachment-thumbnail { flex-shrink: 0; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 0.375rem; overflow: hidden; background: var(--bs-gray-100); }
.attachment-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.attachment-thumbnail .file-icon { font-size: 1.5rem; color: var(--bs-gray-500); }

.attachment-content { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; /* Prevent flex item overflow */ }

.attachment-item h6 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--bs-dark); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.attachment-description { font-size: 0.875rem; color: var(--bs-gray-600); line-height: 1.4; margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }

.attachment-meta { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--bs-gray-500); }
.attachment-meta span { display: flex; align-items: center; gap: 0.25rem; }

.attachment-footer { border-top: 1px solid var(--bs-gray-200); background: var(--bs-gray-100); padding: 0.5rem 1rem; }

.attachment-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.attachment-actions .btn { padding: 0.375rem 0.75rem; font-size: 0.8rem; line-height: 1.2; }

/* Responsive adjustments */
@media (min-width: 576px) {
    .attachment-thumbnail { width: 80px; height: 80px; }
    .attachment-thumbnail .file-icon { font-size: 2rem; }
    
    .attachment-item h6 { font-size: 1.1rem; }
    
    .attachment-description { font-size: 0.9rem; }
    
    .attachment-meta { font-size: 0.8rem; }
}

@media (min-width: 992px) {
    .attachment-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

/* Post Navigation */
.post-navigation { margin: 3rem 0; }
.post-navigation .prev-post a, .post-navigation .next-post a { color: #000; font-size: 1rem; text-decoration: none; line-height: 1.3; }
.post-navigation .prev-post a:hover, .post-navigation .next-post a:hover { color: var(--bs-red); } 
.post-navigation .prev-post { display: flex; align-items: center; justify-content: flex-start; margin: 1rem 0; gap: 0.5rem; }
.post-navigation .next-post { display: flex; align-items: center; justify-content: flex-end; margin-top: 1rem; gap: 0.5rem; }
.post-navigation i.bi { color: var(--bs-gray-500); font-size: 1.25rem; }

@media (min-width: 768px) {
    .post-navigation { display: flex; justify-content: space-between; align-items: center; }
    .post-navigation .next-post { margin-top: 0; }
}


/* Comments */
.comments h5 span { font-size: 1rem; color: var(--bs-gray-700); font-weight: 500; }
.comments textarea { margin: 0.5rem 0; }
#commentForm { margin-bottom: 3rem; }

.comment-item { border: dashed 1px transparent; margin-top: 3rem; }
.comment-item:hover { border-color: rgba(25, 135, 84, 0.5); border-radius: 0.5rem; }
#comments-list > .comment-item:first-child { margin-top: 0; }
.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.8rem; }

.comment-author { font-weight: 700; color: var(--bs-dark); margin-right: 1rem; }
.comment-date { color: var(--bs-gray-500); }
.comment-pending { color: var(--bs-warning); margin-right: 0.25rem; font-weight: 600; font-size: 0.8em; }
.comment-item.pending { opacity: 0.4; }
.comment-item.pending:hover { opacity: 1; }

.comment-item .dropdown-menu { min-width: 80px; font-size: 0.8rem; font-weight: 500; padding: 0; border: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.comment-item .dropdown-menu .dropdown-divider { margin: 0; border-color: var(--bs-gray-100); }
.comment-item .dropdown-menu i { font-size: 0.8em; }
.comment-item .dropdown-menu .dropdown-item { color: var(--bs-gray-700); }

.comment-content { font-family: var(--font-hand); color: #000; font-size: 1.1rem; }

.comment-file-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.comments .file-preview-item { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.5rem; background: var(--bs-gray-100); border: 1px solid var(--bs-gray-300); border-radius: 0.375rem; font-size: 0.85rem; color: var(--bs-gray-700); }
.comments .file-preview-item img { width: 20px; height: 20px; object-fit: cover; border-radius: 3px; margin-right: 6px; }

.comment-attachments { margin: 1rem 0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.comment-attachments img { max-width: 120px; max-height: 80px; cursor: pointer; border-radius: 0.375rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); transition: all 0.2s ease; }

.reply-form, .edit-form { border: solid 1px var(--bs-gray-200); padding: 1rem; border-radius: 0.5rem; background: var(--bs-gray-100); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
.reply-form { margin-left: 30px; margin-top: 2rem; }
.reply-form textarea, .edit-form textarea { width: 100%; border: solid 1px var(--bs-gray-300); border-radius: 0.375rem; padding: 0.5rem; font-size: 1rem; resize: vertical; min-height: 100px; }

.existing-attachments { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; }
.existing-attachment-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.5rem; background: #fff; border: 1px solid var(--bs-gray-300); border-radius: 0.375rem; font-size: 0.85rem; color: var(--bs-gray-700); }
.existing-attachment-item img { width: 20px; height: 20px; object-fit: cover; border-radius: 3px; margin-right: 6px; }
.existing-attachment-item button { background: none; border: none; color: var(--bs-red); cursor: pointer; padding: 0; }

.guest-author-form { margin: 1rem 0; }
.guest-author-form .form-group { display: flex; align-items: center; gap: 0.5rem; }
.guest-author-form .email-verification-info-btn { color: var(--bs-info); font-size: 1.25rem; cursor: pointer; }


/* Form */
.form-group { margin: 1rem 0; }
.card-body > .form-group:first-child { margin-top: 0; }
.card-body > .form-group:last-child { margin-bottom: 0; }

.board-form { margin: 2rem 0.5rem; }
.board-form .form-label { font-weight: 400; margin-bottom: 0.25rem; display: block; }
.board-form .form-label small.text-muted { font-size: 0.8rem; color: var(--bs-gray-500) !important; }
.board-form .form-control, .board-form .form-select, .board-form textarea { font-weight: 500; color: #000; }
.board-form .form-control::placeholder, .board-form textarea::placeholder { color: var(--bs-gray-400); font-weight: 400; }

.board-form .note-editable { word-break: keep-all; }
.board-form .note-editable img { max-width: 100%; height: auto; }

.secret-post-section { border: dashed 1px var(--bs-gray-300); padding: 1rem; border-radius: 0.5rem; background: var(--bs-gray-100); }

@media (min-width: 768px) {
    .board-form { margin: 2rem 1rem; }
    .form-group { margin: 1.5rem 0; }
}

/* Bootstrap button vertical alignment fix */
.board .btn {
    vertical-align: top;
    line-height: 1.2;
}