/* 커뮤니티 스타일 - 공지사항과 유사한 디자인 */
.community-page {
    padding: 120px 0 80px;
    background: #f8f9fa;
    min-height: 100vh;
}

.community-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.community-header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.community-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.community-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.community-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.community-title i {
    color: #667eea;
    font-size: 2.5rem;
}

.community-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.community-description p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.5;
}

.community-description p:first-child {
    color: #495057;
    font-weight: 500;
}

.search-box {
    flex: 1;
    max-width: 400px;
}

.search-form {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
}

.search-btn {
    padding: 12px 16px;
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #5a6fd8;
}

.write-btn {
    padding: 12px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.write-btn:hover {
    background: #218838;
}

.write-btn.disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.community-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.community-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s;
}

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

.community-item:hover {
    background-color: #f8f9fa;
    margin: 0 -20px;
    padding: 20px;
    border-radius: 8px;
}

.community-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.community-date {
    color: #999;
    font-size: 0.9rem;
    min-width: 80px;
}

.community-author {
    color: #667eea;
    font-weight: 500;
    min-width: 80px;
}

.community-title-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    flex: 1;
    transition: color 0.3s;
}

.community-title-link:hover {
    color: #667eea;
}

.community-badge {
    background: #ff4757;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.community-title-text {
    color: #999;
    font-style: italic;
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.no-posts i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #dee2e6;
}

.no-posts h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px 0;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #dc3545;
}

.error-message h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #721c24;
}

.error-message p {
    color: #721c24;
    margin-bottom: 10px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .community-page {
        padding: 100px 0 60px;
    }
    
    .community-container {
        padding: 0 15px;
    }
    
    .community-header {
        padding: 20px;
    }
    
    .community-title h1 {
        font-size: 2rem;
    }
    
    .community-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        width: 100%;
        max-width: none;
    }
    
    .community-content {
        padding: 20px;
    }
    
    .community-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .community-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        width: 100%;
    }
    
    .community-date, .community-author {
        min-width: auto;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .pagination a, .pagination span {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
}

.page-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: #667eea;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px;
}

.close-btn:hover {
    color: #dc3545;
}

.write-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

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

.cancel-btn,
.submit-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

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

.cancel-btn:hover {
    background: #5a6268;
}

.submit-btn {
    background: #28a745;
    color: white;
}

.submit-btn:hover {
    background: #218838;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .community-container {
        padding: 100px 15px 60px;
    }
    
    .community-header {
        padding: 20px;
    }
    
    .community-title h1 {
        font-size: 2rem;
    }
    
    .community-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        max-width: none;
        width: 100%;
    }
    
    .posts-container {
        padding: 20px;
    }
    
    .post-item {
        padding: 20px;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .write-form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* 파일 첨부 스타일 */
.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
}

.form-group input[type="file"]:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

/* 이미지 미리보기 */
.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #dee2e6;
    background: white;
    display: flex;
    flex-direction: column;
}

.image-preview-item .image-wrapper {
    position: relative;
    aspect-ratio: 1;
    width: 100%;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.95);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.image-preview-item .remove-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

.image-preview-item .insert-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.image-preview-item .insert-btn:hover {
    background: #5568d3;
}

.image-preview-item .insert-btn i {
    font-size: 0.8rem;
}

/* 파일 목록 */
.file-list {
    margin-top: 10px;
}

.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-list-item .file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-list-item .file-icon {
    color: #667eea;
    font-size: 20px;
}

.file-list-item .file-name {
    font-size: 0.9rem;
    color: #495057;
}

.file-list-item .file-size {
    font-size: 0.8rem;
    color: #6c757d;
}

.file-list-item .remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.file-list-item .remove-btn:hover {
    background: #c82333;
}

/* 게시글 상세에서 이미지 표시 */
.community-content-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 첨부파일 다운로드 영역 */
.attached-files {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.attached-files h4 {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.file-download-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-download-item .file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-download-item .file-icon {
    color: #667eea;
    font-size: 20px;
}

.file-download-item .download-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.file-download-item .download-btn:hover {
    background: #218838;
}
