/* community/assets/css/community-style.css */

:root {
    --primary-color: #333;
    --background-color: #ffffff;
    --card-background: #ffffff;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #ddd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

.community-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: 20px;
}

/* --- Left Sidebar --- */
.left-sidebar .widget {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.left-sidebar .widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.left-sidebar .menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.left-sidebar .menu-list li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}
.left-sidebar .menu-list li a.active,
.left-sidebar .menu-list li a:hover {
    background-color: #e9f5ff;
    color: var(--primary-color);
}

/* --- Main Content --- */
.main-content .content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.post-count-info {
    background: #f8f9fa;
    color: #6c757d;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e9ecef;
}

.header-right {
    display: flex;
    align-items: center;
}
.main-content .content-header h2 {
    font-size: 24px;
    margin: 0;
}
.main-content .write-btn {
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s;
}
.main-content .write-btn:hover {
    background-color: #1a1a1a;
}

.post-list .post-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
    height: 50px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.post-list .post-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    background-color: #f9f9f9;
}
.post-card .post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0; /* flex item이 줄어들 수 있게 함 */
    align-items: flex-start; /* 왼쪽 정렬 */
}
.post-card .post-content h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    align-self: flex-start; /* 제목을 왼쪽 끝에 정렬 */
}
.post-card .post-content h3 a {
    text-decoration: none;
    color: var(--text-color);
}
.post-card .post-content h3 a:hover {
    color: var(--primary-color);
}
.post-card .post-meta {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-bottom: 2px;
    align-self: flex-start; /* 카테고리를 왼쪽 끝에 정렬 */
}
.post-card .post-thumbnail img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    margin-left: 12px;
}

/* --- Right Sidebar --- */
.right-sidebar .widget {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.right-sidebar .widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

/* 공지사항 위젯 스타일 */
.notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notice-list li {
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 0;
}

.notice-list li:last-child {
    border-bottom: none;
}

.notice-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.notice-link:hover {
    color: var(--primary-color);
}

.notice-title {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.notice-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 10px;
    white-space: nowrap;
}

.no-notice {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin: 20px 0;
}

.widget-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.widget-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.widget-footer a:hover {
    text-decoration: underline;
}

/* --- Single Post View Styles --- */
.post-view-container {
    max-width: 800px;
    margin: 30px auto;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
}

.post-header .post-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 20px;
}

.post-header .post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.post-meta .author-info {
    display: flex;
    align-items: center;
}

.post-meta .author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
}

.post-meta .author-details {
    display: flex;
    flex-direction: column;
}

.post-meta .author-name {
    font-weight: 600;
}

.post-meta .post-date {
    font-size: 14px;
    color: var(--text-secondary);
}

.post-meta .post-stats {
    font-size: 14px;
    color: var(--text-secondary);
}

.post-body {
    line-height: 1.8;
    font-size: 16px;
}

.post-body h1, .post-body h2, .post-body h3 {
    margin-top: 40px;
    margin-bottom: 20px;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body img {
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    max-width: 100%; /* 커스텀 이미지가 아닌 경우만 적용 */
}

.post-image-wrapper {
    text-align: center;
    margin: 20px 0;
    clear: both;
    overflow: hidden;
}

.post-image-wrapper img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
    max-width: 100%; /* 커스텀 이미지가 아닌 경우만 적용 */
}

/* Summernote 에디터 및 게시글 이미지 스타일 */
.note-editable img,
.post-body img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 15px 0 !important;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 특정 너비의 이미지 스타일 */
.note-editable img[width="200"],
.post-body img[width="200"] {
    width: 200px !important;
    max-width: 200px !important;
}

.note-editable img[width="400"],
.post-body img[width="400"] {
    width: 400px !important;
    max-width: 400px !important;
}

.note-editable img[width="600"],
.post-body img[width="600"] {
    width: 600px !important;
    max-width: 600px !important;
}

/* 반응형 이미지 크기 조절 */
@media (max-width: 320px) {
    .note-editable img,
    .post-body img {
        width: 90% !important;
        max-width: 90% !important;
    }
}

.post-actions {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.post-actions .btn {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s;
}
.post-actions .btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}
.post-actions .btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}
.post-actions .btn-danger {
    background-color: #666;
    color: #fff;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

/* 공지사항 전용 스타일 */
.post-category.notice-category {
    font-weight: 600;
}

.notice-post h3 a {
    font-weight: 600;
}

/* 검색 위젯 */
.search-form .search-input-group {
    display: flex;
    margin-bottom: 10px;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.search-btn {
    background: #333;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: #1a1a1a;
}

.search-filters select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
}

.quick-search-form .search-input-group {
    display: flex;
    margin-bottom: 10px;
}

.quick-search-form .search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.advanced-search-link {
    display: block;
    text-align: center;
    color: #333;
    text-decoration: none;
    font-size: 12px;
    padding: 5px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 10px;
    padding-top: 8px;
}

.advanced-search-link:hover {
    text-decoration: underline;
}

/* 포스트 카테고리 스타일 */
.post-category {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    background-color: #f8f9fa;
    color: #6c757d;
    border-radius: 10px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

/* --- 댓글 및 대댓글 스타일 --- */
.comments-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

#comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-item {
    display: flex;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.comment-item:last-child {
    border-bottom: none;
}

/* 대댓글 스타일 */
.reply-comment {
    background-color: #f9f9f9;
    border-left: 3px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    margin-top: 10px;
    padding: 15px 20px;
}

.reply-comment .comment-avatar img {
    width: 32px;
    height: 32px;
}

.comment-avatar {
    margin-right: 15px;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-color);
}

.comment-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.reply-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.reply-btn:hover {
    background-color: #f0f0f0;
}

.comment-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.comment-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s;
}

.comment-actions button:hover {
    color: var(--primary-color);
}

.comment-body p {
    margin: 0;
    line-height: 1.5;
    color: var(--text-color);
}

/* 대댓글 작성 폼 */
.reply-form-item {
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

.reply-form {
    padding: 15px 0;
    background-color: white;
    margin-left: 30px;
    border-radius: 8px;
}

.reply-form-content {
    display: flex;
    align-items: flex-start;
    padding: 0 20px;
}

.reply-avatar {
    margin-right: 15px;
}

.reply-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.reply-input-wrapper {
    flex: 1;
}

.reply-input-wrapper textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.reply-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px #f0f0f0;
}

.reply-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.reply-form-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.submit-reply-btn {
    background-color: var(--primary-color);
    color: white;
}

.submit-reply-btn:hover {
    background-color: #1a1a1a;
}

.cancel-reply-btn {
    background-color: #6c757d;
    color: white;
}

.cancel-reply-btn:hover {
    background-color: #545b62;
}

/* 댓글 없음 메시지 */
.no-comments {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 40px 0;
}

/* 댓글 폼 컨테이너 */
.comment-form-container {
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 30px;
}

/* 댓글 폼 스타일 */
#comment-form {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

#comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 15px;
    box-sizing: border-box;
    overflow: hidden;
    line-height: 1.5;
}

#comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px #f0f0f0;
}

#comment-form button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

#comment-form button[type="submit"]:hover {
    background-color: #1a1a1a;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 8px;
}

.pagination .page-link {
    text-decoration: none;
    color: var(--primary-color);
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
}

.pagination .page-link:hover {
    background-color: #e9f5ff;
}

.pagination .page-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 구독 게시판 퀵 리스트 */
.subscription-quick-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-quick-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.subscription-quick-item:hover {
    background-color: #e9ecef;
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.subscription-quick-item .sub-category {
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subscription-quick-item .sub-count {
    font-size: 12px;
    color: #6c757d;
    background-color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    min-width: 24px;
    text-align: center;
}

.see-all-link {
    display: block;
    text-align: center;
    padding: 8px 12px;
    margin-top: 10px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.see-all-link:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

/* --- All Boards Page Styles --- */
.all-boards-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.all-boards-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.all-boards-list li a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: var(--primary-color);
}

.post-count {
    font-size: 12px;
    color: var(--text-secondary);
    background-color: #f8f9fa;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: normal;
}

.board-request-section {
    margin-top: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.board-request-section p {
    margin: 0 0 15px 0;
    color: var(--text-secondary);
}

.request-board-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.request-board-btn:hover {
    background-color: #1a1a1a;
    text-decoration: none;
}

/* 댓글 좋아요 버튼 스타일 */
.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-like-btn:hover {
    background-color: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.comment-like-btn.liked {
    color: #f44336;
}

.comment-like-btn svg {
    width: 14px;
    height: 14px;
}

.comment-like-btn .like-count {
    font-weight: 500;
}

.like-count-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #65676b;
}

/* 댓글 푸터 (좋아요, 답글 버튼) */
.comment-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
}

.comment-footer .reply-btn {
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-footer .reply-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

