/* ==========================================
   Do it! khmer365 - Board Page Styles
   Notices + Q&A Community Board
   ========================================== */

/* --- Board Hero --- */
.board-hero {
    padding: 120px 0 50px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.board-hero::before {
    content: '';
    position: absolute; top: -30%; right: -10%;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(232,168,56,0.1) 0%, transparent 70%);
}
.board-hero-container {
    max-width: 700px; margin: 0 auto; padding: 0 2rem;
    position: relative; z-index: 1;
}
.board-hero-icon {
    width: 72px; height: 72px; border-radius: 50%;
    background: rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.2rem; font-size: 1.8rem;
}
.board-hero h1 {
    font-size: 2.2rem; font-weight: 700; margin-bottom: 0.75rem;
}
.board-hero p {
    font-size: 1.05rem; color: rgba(255,255,255,0.8);
}

/* --- Board Section --- */
.board-section {
    padding: 40px 0 80px;
    background: var(--bg-light);
    min-height: 60vh;
}
.board-container {
    max-width: 900px; margin: 0 auto; padding: 0 1.5rem;
}

/* --- Board Tabs --- */
.board-tabs {
    display: flex; gap: 0; margin-bottom: 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
}
.board-tab {
    flex: 1; padding: 1rem 1.5rem;
    border: none; background: white;
    font-size: 0.95rem; font-weight: 600;
    color: var(--text-light);
    cursor: pointer; transition: var(--transition);
    font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.board-tab:first-child { border-right: 1px solid var(--border-light); }
.board-tab:hover { color: var(--primary); background: var(--bg-light); }
.board-tab.active {
    color: var(--primary); background: var(--bg-blue);
    border-bottom: 3px solid var(--primary);
}
.board-tab i { font-size: 1rem; }
.tab-count {
    background: var(--border-light); color: var(--text-light);
    padding: 0.1rem 0.5rem; border-radius: 50px;
    font-size: 0.75rem; font-weight: 600;
}
.board-tab.active .tab-count {
    background: var(--primary); color: white;
}

/* --- Board Content --- */
.board-content { display: none; }
.board-content.active { display: block; }

/* --- Board Toolbar --- */
.board-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.board-search {
    display: flex; align-items: center;
    background: white; border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0 1rem; flex: 1; max-width: 400px;
    transition: var(--transition);
}
.board-search:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(42,107,199,0.1);
}
.board-search i { color: var(--text-light); margin-right: 0.5rem; font-size: 0.88rem; }
.board-search input {
    border: none; padding: 0.7rem 0; font-size: 0.9rem;
    font-family: inherit; color: var(--text-dark); outline: none;
    width: 100%; background: transparent;
}
.btn-write-post {
    padding: 0.7rem 1.3rem; background: var(--primary);
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 0.88rem; font-weight: 600; cursor: pointer;
    font-family: inherit; display: flex; align-items: center; gap: 0.4rem;
    transition: var(--transition); white-space: nowrap;
}
.btn-write-post:hover { background: var(--primary-light); transform: translateY(-1px); }

/* --- Board List Items --- */
.board-list { display: flex; flex-direction: column; gap: 0.5rem; }

.board-item {
    background: white; border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); padding: 1rem 1.5rem;
    cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; gap: 1rem;
}
.board-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.board-item-badge {
    padding: 0.2rem 0.6rem; border-radius: 50px;
    font-size: 0.72rem; font-weight: 600;
    white-space: nowrap; flex-shrink: 0;
}
.badge-notice { background: #FEF3CD; color: #856404; }
.badge-answered { background: #D4EDDA; color: #155724; }
.badge-pending { background: #FFF3CD; color: #856404; }
.badge-category { background: var(--bg-blue); color: var(--primary); }

.board-item-main { flex: 1; min-width: 0; }
.board-item-title {
    font-size: 0.95rem; font-weight: 600;
    color: var(--text-dark); margin-bottom: 0.25rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board-item-meta {
    font-size: 0.78rem; color: var(--text-light);
    display: flex; gap: 0.75rem; align-items: center;
}
.board-item-meta i { font-size: 0.7rem; }

.board-item-stats {
    display: flex; gap: 0.75rem; flex-shrink: 0;
}
.board-item-stat {
    display: flex; align-items: center; gap: 0.3rem;
    font-size: 0.78rem; color: var(--text-light);
}
.board-item-stat i { font-size: 0.7rem; }

/* Pinned notice */
.board-item.pinned {
    background: var(--bg-cream); border-color: var(--secondary);
    border-left: 4px solid var(--secondary);
}
.board-item.pinned .board-item-title { color: var(--primary-dark); }

/* Empty state */
.board-empty {
    text-align: center; padding: 3rem 2rem;
    color: var(--text-light);
}
.board-empty i { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.3; }
.board-empty p { font-size: 0.95rem; }

/* --- Write Form --- */
.write-form {
    background: white; border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 2rem;
    margin-bottom: 1.5rem; box-shadow: var(--shadow-sm);
}
.write-form h3 {
    font-size: 1.15rem; font-weight: 600; color: var(--text-dark);
    margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem;
}
.write-form h3 i { color: var(--primary); }
.write-form .form-group { margin-bottom: 1rem; }
.write-form label {
    display: block; font-size: 0.88rem; font-weight: 500;
    color: var(--text-dark); margin-bottom: 0.3rem;
}
.write-form input,
.write-form select,
.write-form textarea {
    width: 100%; padding: 0.7rem 1rem;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm); font-size: 0.92rem;
    font-family: inherit; color: var(--text-dark);
    background: var(--bg-light); transition: var(--transition);
}
.write-form input:focus,
.write-form select:focus,
.write-form textarea:focus {
    outline: none; border-color: var(--primary-light);
    background: white; box-shadow: 0 0 0 3px rgba(42,107,199,0.1);
}
.write-form textarea { resize: vertical; }

.form-actions {
    display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem;
}
.btn-cancel {
    padding: 0.7rem 1.5rem; background: var(--bg-light);
    border: 1.5px solid var(--border-light); border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 500; color: var(--text-medium);
    cursor: pointer; font-family: inherit; transition: var(--transition);
}
.btn-cancel:hover { background: var(--border-light); }
.btn-submit-post {
    padding: 0.7rem 1.5rem; background: var(--primary);
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    font-family: inherit; display: flex; align-items: center; gap: 0.4rem;
    transition: var(--transition);
}
.btn-submit-post:hover { background: var(--primary-light); }

/* --- Post Detail --- */
.btn-back-list {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: none; border: none; color: var(--primary);
    font-size: 0.9rem; font-weight: 500; cursor: pointer;
    font-family: inherit; margin-bottom: 1rem; padding: 0.4rem 0;
    transition: var(--transition);
}
.btn-back-list:hover { color: var(--primary-light); }

.post-detail-content {
    background: white; border: 1px solid var(--border-light);
    border-radius: var(--radius-md); overflow: hidden;
    margin-bottom: 1.5rem;
}
.post-detail-header {
    padding: 1.5rem 2rem; border-bottom: 1px solid var(--border-light);
}
.post-detail-header h2 {
    font-size: 1.3rem; font-weight: 700; color: var(--text-dark);
    margin-bottom: 0.5rem;
}
.post-detail-meta {
    font-size: 0.82rem; color: var(--text-light);
    display: flex; gap: 1rem; flex-wrap: wrap;
}
.post-detail-meta span { display: flex; align-items: center; gap: 0.3rem; }
.post-detail-meta i { font-size: 0.75rem; }

.post-detail-body {
    padding: 2rem; font-size: 0.95rem;
    color: var(--text-medium); line-height: 1.8;
    white-space: pre-wrap;
}

/* --- Comments --- */
.comments-section {
    background: white; border: 1px solid var(--border-light);
    border-radius: var(--radius-md); overflow: hidden;
}
.comments-section h4 {
    padding: 1rem 1.5rem; font-size: 0.95rem;
    font-weight: 600; color: var(--text-dark);
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--bg-light);
}
.comments-section h4 i { color: var(--primary); }
#commentCount { font-weight: 400; color: var(--text-light); }

.comments-list { padding: 0; }
.comment-item {
    padding: 1rem 1.5rem; border-bottom: 1px solid var(--bg-light);
}
.comment-item:last-child { border-bottom: none; }
.comment-author {
    font-size: 0.85rem; font-weight: 600; color: var(--primary);
    margin-bottom: 0.2rem;
}
.comment-text { font-size: 0.9rem; color: var(--text-medium); line-height: 1.6; }
.comment-date { font-size: 0.75rem; color: var(--text-light); margin-top: 0.3rem; }

.comment-write {
    padding: 1rem 1.5rem; border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}
.comment-write-row {
    display: flex; gap: 0.5rem;
}
.comment-write-row input {
    padding: 0.6rem 0.85rem; border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm); font-size: 0.88rem;
    font-family: inherit; color: var(--text-dark);
    background: white; transition: var(--transition);
}
.comment-write-row input:first-child { width: 140px; flex-shrink: 0; }
.comment-write-row input:nth-child(2) { flex: 1; }
.comment-write-row input:focus { outline: none; border-color: var(--primary-light); }
.btn-comment-submit {
    padding: 0.6rem 1rem; background: var(--primary);
    color: white; border: none; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.88rem; transition: var(--transition);
}
.btn-comment-submit:hover { background: var(--primary-light); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .board-hero h1 { font-size: 1.6rem; }
    .board-toolbar { flex-direction: column; }
    .board-search { max-width: 100%; }
    .board-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .board-item-stats { align-self: flex-end; }
    .write-form { padding: 1.5rem; }
    .post-detail-header { padding: 1rem 1.2rem; }
    .post-detail-body { padding: 1.2rem; }
    .comment-write-row { flex-direction: column; }
    .comment-write-row input:first-child { width: 100%; }
    .post-detail-header h2 { font-size: 1.1rem; }
    .board-tabs { flex-direction: row; }
    .board-tab { font-size: 0.88rem; padding: 0.8rem 1rem; }
    .board-tab span:not(.tab-count) { display: inline; }
}

@media (max-width: 480px) {
    .board-hero { padding: 100px 0 40px; }
    .board-hero h1 { font-size: 1.4rem; }
    .board-container { padding: 0 1rem; }
}
