/* --- Page Specific Styles --- */
.container { max-width: 1200px; margin: 40px auto; padding: 0 20px; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 20px; }
.page-header h1 { color: var(--primary-navy); font-size: 2rem; }
.page-header p { color: #666; }

.btn-create-topic {
    background-color: var(--accent-teal);
    color: var(--primary-navy);
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}
.btn-create-topic:hover { transform: translateY(-2px); background-color: #2ec1c1; }

/* Layout Grid */
.forum-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

/* Main Content (Topic List) */
.forum-main { background: transparent; }

.topic-filter {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 20px;
}
.filter-item { color: #666; text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.filter-item.active { color: var(--primary-navy); border-bottom: 2px solid var(--accent-teal); padding-bottom: 2px; }

.topic-list {
    background: var(--white);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
}

.topic-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid #eee;
    align-items: center;
    transition: background 0.2s;
}
.topic-item:last-child { border-bottom: none; }
.topic-item:hover { background-color: #f9f9f9; }

.topic-icon {
    width: 40px; height: 40px;
    background-color: #e0f2f1;
    color: var(--dark-teal);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    margin-right: 20px;
    flex-shrink: 0;
}

.topic-content { flex-grow: 1; }
.topic-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-navy);
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}
.topic-title:hover { color: var(--accent-teal); }

.topic-meta { font-size: 0.85rem; color: #888; display: flex; gap: 15px; align-items: center; }
.tag { padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.tag-warning { background: #ffebee; color: #c62828; }
.tag-question { background: #e3f2fd; color: #1565c0; }
.tag-share { background: #e8f5e9; color: #2e7d32; }

.topic-stats {
    text-align: right;
    min-width: 80px;
    font-size: 0.9rem;
    color: #666;
}
.stat-number { font-weight: bold; color: var(--primary-navy); }

/* Like Button */
.btn-like {
    background: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    color: #888;
    font-size: 0.85rem;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all 0.2s;
    margin-right: 15px;
}
.btn-like:hover { background-color: #ffebee; border-color: #ffcdd2; color: #e91e63; }
.btn-like.liked { background-color: #e91e63; border-color: #e91e63; color: white; }
.heart-icon { font-size: 1rem; line-height: 1; }

/* Follow Button */
.btn-follow {
    background: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    color: #888;
    font-size: 0.85rem;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all 0.2s;
    margin-right: 15px;
}
.btn-follow:hover { background-color: #e3f2fd; border-color: #bbdefb; color: #1976d2; }
.btn-follow.followed { background-color: #1976d2; border-color: #1976d2; color: white; }
.follow-icon { font-size: 1rem; line-height: 1; }

/* User Link & Card */
.user-link {
    font-weight: 600;
    color: var(--primary-navy);
    cursor: pointer;
    transition: color 0.2s;
}
.user-link:hover { color: var(--accent-teal); text-decoration: underline; }

.user-card-content { max-width: 380px; text-align: center; padding: 30px; }
.uc-header { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.uc-avatar { width: 80px; height: 80px; background: #e0f2f1; border-radius: 50%; font-size: 3rem; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; color: var(--dark-teal); }
.uc-info h3 { margin: 0; color: var(--primary-navy); font-size: 1.4rem; }
.uc-info p { color: #888; font-size: 0.9rem; margin-top: 5px; }
.uc-stats { display: flex; justify-content: space-around; margin-bottom: 25px; border-top: 1px solid #eee; border-bottom: 1px solid #eee; padding: 15px 0; }
.uc-stat-item { display: flex; flex-direction: column; }
.uc-stat-item strong { font-size: 1.2rem; color: var(--primary-navy); }
.uc-stat-item span { font-size: 0.8rem; color: #888; }
.uc-actions { display: flex; gap: 10px; justify-content: center; }
.btn-message { background: var(--light-gray); color: #333; border: none; padding: 8px 20px; border-radius: 20px; cursor: pointer; font-family: 'Sarabun', sans-serif; transition: background 0.2s; display: flex; align-items: center; gap: 5px; }
.btn-message:hover { background: #e0e0e0; }

/* Topic Detail View */
.btn-back { background: none; border: none; color: var(--primary-navy); font-weight: 600; cursor: pointer; margin-bottom: 20px; display: flex; align-items: center; gap: 5px; font-size: 1rem; font-family: 'Sarabun', sans-serif; }
.btn-back:hover { color: var(--accent-teal); }

.detail-card { background: var(--white); padding: 30px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); margin-bottom: 30px; }
.detail-header { border-bottom: 1px solid #eee; padding-bottom: 20px; margin-bottom: 20px; }
.detail-title { font-size: 1.8rem; color: var(--primary-navy); margin: 10px 0; line-height: 1.3; }
.detail-meta { color: #888; font-size: 0.9rem; }
.detail-body { font-size: 1.1rem; color: #333; line-height: 1.8; margin-bottom: 30px; min-height: 100px; }

.comment-section h3 { color: var(--primary-navy); margin-bottom: 20px; }
.comment-item { background: var(--white); padding: 20px; border-radius: 10px; border-bottom: 1px solid #eee; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.comment-user { font-weight: bold; color: var(--primary-navy); }
.comment-time { font-size: 0.85rem; color: #999; }

.btn-delete-comment {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Sarabun', sans-serif;
    margin-left: 10px;
}
.btn-delete-comment:hover { color: var(--danger-red); text-decoration: underline; }

/* Notification Styles */
.notif-badge {
    background-color: var(--danger-red);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    text-align: center;
}

.notif-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    width: 300px;
    background-color: var(--white);
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1001;
    overflow: hidden;
}

.notif-header { padding: 10px 15px; background-color: var(--light-gray); border-bottom: 1px solid #ddd; font-weight: bold; color: var(--primary-navy); font-size: 0.9rem; }
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item { padding: 12px 15px; border-bottom: 1px solid #eee; font-size: 0.85rem; cursor: pointer; transition: background 0.2s; color: #333; line-height: 1.4; }
.notif-item:hover { background-color: #f9f9f9; }
.notif-item.unread { background-color: #e0f7fa; border-left: 3px solid var(--accent-teal); }
.notif-empty { padding: 20px; text-align: center; color: #999; font-size: 0.9rem; }

/* Animation for bell */
@keyframes bellShake {
    0% { transform: rotate(0); } 15% { transform: rotate(5deg); } 30% { transform: rotate(-5deg); } 45% { transform: rotate(4deg); } 60% { transform: rotate(-4deg); } 75% { transform: rotate(2deg); } 85% { transform: rotate(-2deg); } 100% { transform: rotate(0); }
}
.bell-shaking { animation: bellShake 0.5s cubic-bezier(.36,.07,.19,.97) both; }

/* Search Box */
.search-section {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
}
.search-input { flex: 1; padding: 12px 20px; border: 2px solid #e1e1e1; border-radius: 5px; font-size: 1rem; font-family: 'Sarabun', sans-serif; }
.search-input:focus { border-color: var(--accent-teal); outline: none; }

/* Sidebar */
.sidebar-card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}
.sidebar-title { font-size: 1.1rem; color: var(--primary-navy); margin-bottom: 15px; font-weight: 600; border-bottom: 2px solid #f4f4f4; padding-bottom: 10px; }

.category-list { list-style: none; }
.category-list li { margin-bottom: 10px; }
.category-list a { color: #555; text-decoration: none; display: flex; justify-content: space-between; transition: color 0.2s; }
.category-list a:hover { color: var(--accent-teal); }
.cat-count { background: #eee; padding: 2px 8px; border-radius: 10px; font-size: 0.8rem; }

@media (max-width: 768px) {
    .forum-layout { grid-template-columns: 1fr; }
    .topic-stats { display: none; }
}

/* --- Modal Styles --- */
.modal h2 { color: var(--primary-navy); margin-bottom: 20px; border-bottom: 2px solid var(--light-gray); padding-bottom: 10px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: #444; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; font-family: 'Sarabun', sans-serif; }
.btn-submit-topic { background-color: var(--primary-navy); color: var(--white); border: none; padding: 12px 20px; border-radius: 5px; cursor: pointer; font-weight: bold; width: 100%; transition: background 0.3s; }
.btn-submit-topic:hover { background-color: var(--accent-teal); color: var(--primary-navy); }

footer {
    margin-top: 60px;
}