/* Community Page Styles */

/* Community Container Layout */
.community-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 1024px) {
    .community-container {
        grid-template-columns: 1fr 380px;
    }
}

/* Community Main Area */
.community-main {
    order: -1;
}

.community-sidebar {
    order: 1;
}

/* Sticky Sidebar */
.sticky-sidebar {
    position: relative;
}

@media (min-width: 1024px) {
    .sticky-sidebar {
        position: sticky;
        top: 100px;
    }
}

/* Board Tabs */
.board-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    border: 2px solid #d1d5db;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

/* Mobile board tabs - 더 작은 패딩 */
@media (max-width: 768px) {
    .board-tab {
        padding: 0.4rem 1rem;
        font-size: 0.8125rem;
    }

    .board-tab .count {
        font-size: 0.6875rem;
    }
}

.board-tab:hover {
    border-color: #f97316;
    color: #f97316;
}

.board-tab.active {
    background: linear-gradient(to right, #f97316, #ec4899);
    color: white;
    font-weight: 700;
    border-color: transparent;
}

.board-tab .count {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Hide scrollbar for board tabs */
.overflow-x-auto::-webkit-scrollbar {
    height: 4px;
}

.overflow-x-auto::-webkit-scrollbar-track {
    background: transparent;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 2px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* For Firefox */
.overflow-x-auto {
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

/* All Filters Container - Desktop always visible */
@media (min-width: 768px) {
    #allFiltersContainer {
        display: block !important;
    }
}

/* Write Button */
.btn-write {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Post Item */
.post-item {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s;
}

@media (min-width: 768px) {
    .post-item {
        flex-direction: row;
    }
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Pinned Post */
.post-item.pinned {
    border: 2px solid #fbbf24;
    background: #fffbeb;
}

/* Post Thumbnail */
.post-thumbnail {
    flex-shrink: 0;
    overflow: hidden;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

@media (min-width: 768px) {
    .post-thumbnail {
        width: 240px;
        height: auto;
    }
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s;
}

.post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

/* Post Content */
.post-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Board Badge */
.board-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

/* Board Badge Colors */
.board-badge.board-event {
    background-color: #fce7f3;
    color: #ec4899;
    border: 1px solid #ec4899;
}

.board-badge.board-notice {
    background-color: #fee2e2;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.board-badge.board-free {
    background-color: #dbeafe;
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.board-badge.board-study {
    background-color: #e9d5ff;
    color: #a855f7;
    border: 1px solid #a855f7;
}

.board-badge.board-review {
    background-color: #d1fae5;
    color: #10b981;
    border: 1px solid #10b981;
}

/* Pinned Badge */
.pinned-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: #fef3c7;
    color: #f59e0b;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid #fbbf24;
}

/* Post Title */
.post-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-title a {
    color: inherit;
    transition: color 0.2s;
}

.post-title a:hover {
    color: #f97316;
}

/* Post Summary */
.post-summary {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.author-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* Sidebar Widget */
.sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f97316;
}

/* Community Menu */
.community-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.community-menu li {
    margin-bottom: 4px;
}

.community-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s;
}

.community-menu a:hover {
    background-color: #fef3e7;
    color: #f97316;
}

.community-menu a.active {
    background: linear-gradient(to right, #fff7ed, #ffe4e6);
    color: #f97316;
    font-weight: 600;
}

.menu-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
}

.menu-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    background-color: #f3f4f6;
    color: #6b7280;
    border-radius: 9999px;
    font-weight: 600;
}

.community-menu a.active .menu-count {
    background-color: #f97316;
    color: white;
}

/* Recent Posts */
.recent-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-posts li {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.recent-posts li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-posts a {
    display: block;
    transition: all 0.2s;
}

.recent-posts a:hover {
    transform: translateX(4px);
}

.recent-post-title {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.4;
    margin-bottom: 6px;
}

.recent-posts a:hover .recent-post-title {
    color: #f97316;
}

.recent-post-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

.board-badge-small {
    padding: 2px 8px;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 9999px;
}

/* Inherit board colors */
.board-badge-small.board-event {
    background-color: #fce7f3;
    color: #ec4899;
}

.board-badge-small.board-notice {
    background-color: #fee2e2;
    color: #ef4444;
}

.board-badge-small.board-free {
    background-color: #dbeafe;
    color: #3b82f6;
}

.board-badge-small.board-study {
    background-color: #e9d5ff;
    color: #a855f7;
}

.board-badge-small.board-review {
    background-color: #d1fae5;
    color: #10b981;
}

.recent-post-date {
    color: #9ca3af;
}

/* Banner Widget */
.banner-widget {
    overflow: hidden;
    border-radius: 12px;
}

/* Random Course */
.random-course {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.random-course:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.random-course .course-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.random-course .course-title a {
    color: inherit;
    transition: color 0.2s;
}

.random-course .course-title a:hover {
    color: #f97316;
}

.level-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.level-badge.level-green {
    background-color: #d1fae5;
    color: #059669;
}

.level-badge.level-blue {
    background-color: #dbeafe;
    color: #2563eb;
}

.level-badge.level-purple {
    background-color: #e9d5ff;
    color: #9333ea;
}

.level-badge.level-red {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Filter Select */
.filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .post-item {
        margin-bottom: 16px;
    }

    .post-content {
        padding: 16px;
    }

    .post-title {
        font-size: 1.125rem;
    }

    .sidebar-widget {
        padding: 16px;
    }
}
