/* ===== 1. 기본 레이아웃 ===== */
.moim-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.moim-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.moim-search-container {
    background: #f9f9fa;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.moim-search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ===== 2. 검색 폼 스타일 ===== */
.search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 0px;
}

.search-row:last-child {
    margin-bottom: 0;
}

.moim-search-input-sm {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 220px;
}

.moim-search-input-area {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

.moim-search-op {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 120px;
    background-color: #fff;
}

.search-condition, .search-gender, .search-age, .search-area, .search-name {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.search-condition span, .search-gender span, .search-age span, .search-area span, .search-name span {
    font-weight: bold;
    color: #555;
    margin-right: 5px;
    white-space: nowrap;
}

.search-gender label {
    margin: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 3px 5px;
    white-space: nowrap;
}

.search-gender input[type="radio"] {
    margin-right: 3px;
}

.moim-search-age {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.moim-search-select {
    min-width: 100px;
}

/* ===== 3. 버튼 스타일 ===== */
.moim-search-btn {
    padding: 8px 30px;
    height: 42px;
    background: #4a6dff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.moim-search-btn:hover {
    background: #3956cc;
}

.moim-reset-btn {
    padding: 8px 20px;
    height: 42px;
    background: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.moim-reset-btn:hover {
    background: #e5e5e5;
    text-decoration: none;
    color: #333;
}

/* 스크롤 버튼 스타일 */
.sly-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    color: #495057;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s ease;
}

.sly-btn:hover {
    background-color: #e9ecef;
    color: #4a6dff;
}

/* ===== 4. 그룹 탭 네비게이션 ===== */
#moim_group_nav {
    position: relative;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    border-top: 1px solid #dee2e6;
}

#moim_group_nav .sly-wrap {
    position: relative;
    overflow: hidden;
    border-left: 1px solid #dee2e6;
}

#moim_group_nav .sly-list {
    white-space: nowrap;
    flex-wrap: nowrap !important;
    margin: 0;
    padding: 0;
}

#moim_group_nav .nav-item {
    display: inline-block;
    float: none;
}

#moim_group_nav .nav-link {
    color: #495057;
    border: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s ease;
}

#moim_group_nav .nav-link:hover {
    background-color: #f8f9fa;
}

#moim_group_nav .nav-link.active {
    color: #4a6dff;
    border-bottom: 2px solid #4a6dff;
}

/* 전체 카테고리 버튼 스타일 */
.all-categories-btn {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    border-left: 1px solid #dee2e6 !important;
    margin-left: 5px;
}

.all-categories-btn:hover {
    background-color: #e9ecef !important;
}

.all-categories-btn .fa {
    margin-right: 5px;
    color: #4a6dff;
}

/* ===== 5. 카테고리 선택 영역 ===== */
.category-container {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.category-group {
    margin-bottom: 10px;
}

.category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.category-item {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px; /* 높이 줄이기 위해 패딩 감소 */
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px; /* 사각형 라운딩으로 변경 (기존 20px에서 축소) */
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    font-size: 14px; /* 글자 크기도 약간 줄임 */
    height: 28px; /* 높이 명시적 지정 */
}

.category-item:hover {
    border-color: #4a6dff;
    background-color: #f0f4ff;
}

.category-item.active {
    background-color: #4a6dff;
    color: white;
    border-color: #4a6dff;
}

.category-item input[type="checkbox"] {
    display: none;
}

/* ===== 6. 광고 컨테이너 스타일 ===== */
.moim-ad-container {
    width: 100%;
    margin: 15px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    text-align: center;
    position: relative;
}

.moim-ad-container::before {
    content: "광고";
    position: absolute;
    top: 0;
    right: 0;
    background-color: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 0 5px 0 5px;
}

.moim-banner-ad {
    display: block;
    width: 100%;
    height: auto;
}

.moim-btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.moim-btn-secondary:hover {
    background-color: #5a6268;
    color: #fff;
}

.banner-preview {
    width: 100%;
    min-height: 100px;
    border: 1px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.banner-preview img {
    max-width: 100%;
    max-height: 200px;
}

.banner-preview .no-image {
    color: #aaa;
    font-size: 14px;
}

.moim-ad-container {
    width: 100%;
    margin: 15px 0;
    padding: 0;
    background-color: transparent;
    border-radius: 5px;
    text-align: center;
    position: relative;
}

.moim-ad-container::before {
    content: "광고";
    position: absolute;
    top: 0;
    right: 0;
    background-color: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 0 5px 0 5px;
    z-index: 10;
}

.moim-banner-ad {
    display: block;
    width: 100%;
    height: auto;
    overflow: hidden;
    border-radius: 5px;
}

.moim-banner-ad img {
    transition: transform 0.3s ease;
}

.moim-banner-ad:hover img {
    transform: scale(1.02);
}

/* ===== 7. 모달 스타일 ===== */
.modal-category-section {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-category-section:last-child {
    border-bottom: none;
}

.modal-category-title {
    color: #4a6dff;
    font-weight: 600;
    font-size: 18px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

#allCategoriesModal .modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 검색된 카테고리 스타일 */
.category-item.searched {
    background-color: #4a6dff;
    color: white;
    border-color: #4a6dff;
    position: relative;
}

.category-item.searched::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 6px;
    height: 6px;
    background-color: #dc3545;
    border-radius: 50%;
}

/* 검색 입력창 스타일 */
#categorySearchInput {
    border-right: 0;
}

#categorySearchInput:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

.input-group-append .btn {
    border-color: #dee2e6;
    background: #fff;
}

.input-group-append .btn:hover {
    background: #f8f9fa;
}

/* ===== 8. 모임 목록 카드 ===== */
.moim-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.moim-header-card {
    background: #f8f9fa; 
    padding: 18px; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.08); 
    border-left: 4px solid #4a6dff;
    position: relative;
}

.moim-info-row {
    display: flex;
    flex-wrap: wrap;
    margin-top: 15px;
    gap: 12px;
    font-size: 14px;
    color: #555;
}

.moim-info-badge {
    padding: 6px 12px;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.moim-info-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.moim-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 12px;
    color: white;
}

.moim-status-open {
    background: #28a745;
}

.moim-status-closed {
    background: #dc3545;
}

.moim-status-pause {
    background: #ffc107;
    color: #212529;
}

.moim-top-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.moim-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.moim-name {
    font-size: 22px;
    font-weight: bold;
    margin: 0 0 5px 0;
    color: #333;
}

.moim-url {
    font-size: 13px;
    color: #666;
}

.moim-url a {
    color: #4a6dff;
    text-decoration: none;
}

.moim-leader {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* 카테고리 관련 스타일 */
.moim-categories {
    margin-top: 5px;
    font-size: 14px;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.moim-group-name {
    margin-right: 8px;
    color: #4a6dff;
}

.moim-group-name i {
    margin-right: 3px;
}

.moim-category-list {
    color: #777;
    font-size: 13px;
}

.moim-members-count {
    font-size: 13px;
    padding: 3px 8px;
    background: #f0f4ff;
    border-radius: 20px;
    color: #4a6dff;
    margin-left: 10px;
}

/* ===== 9. 페이징 스타일 ===== */
.pg_wrap {
    margin: 20px 0; 
    text-align: center;
}

.pg {
    display: inline-block;
    font-size: 0;
}

.pg_wrap .pg li {
    display: inline-block;
    vertical-align: middle;
}

.pg_wrap .pg a, .pg_wrap .pg_current {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #555;
    font-size: 14px;
}

.pg_wrap .pg a:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.pg_wrap .pg_current {
    background: #4a6dff;
    color: #fff;
    border-color: #4a6dff;
    font-weight: bold;
}

.pg_wrap .pg_start, .pg_wrap .pg_prev, .pg_wrap .pg_next, .pg_wrap .pg_end {
    font-size: 12px;
}

/* ===== 10. 알림 메시지 ===== */
.moim-alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.moim-alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ===== 11. 반응형 스타일 ===== */
@media (max-width: 768px) {
    /* 11.1 검색 폼 반응형 */
    .search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-condition, .search-gender, .search-age, .search-area, .search-name,
    .moim-search-input-sm, .moim-search-input-area, .moim-search-select, .moim-search-op {
        width: 100%;
    }
    
    .search-name {
        flex-wrap: wrap;
    }
    
    .moim-search-btn {
        width: 100%;
    }
    
    .moim-reset-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }
    
    /* 11.2 모임 카드 반응형 */
    .moim-info-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .moim-info-badge {
        width: 100%;
    }
    
	.moim-categories {
    flex-direction: column;
    align-items: flex-start;
}

.moim-group-name {
    margin-bottom: 3px;
}
	
    /* 11.3 카테고리 및 탭 반응형 */
    .category-item {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    #moim_group_nav .nav-link {
        font-size: 14px;
        padding: 0.5rem 0.75rem;
    }
    
    /* 11.4 모달 반응형 */
    .modal-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .modal-header .input-group {
        margin-top: 10px;
        max-width: 100% !important;
        width: 100%;
    }
    
    .modal-category-title {
        font-size: 16px;
    }
}

/* 카테고리 선택 가이드 메시지 */
.category-guide {
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 5px;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* 모임 카드 레이아웃 수정 */
.moim-top-row {
    display: flex;
}

.moim-image-container {
    width: 120px;
    min-width: 120px;
    height: 120px;
    margin-right: 15px;
    overflow: hidden;
}

.moim-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moim-info-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.moim-extended-info {
    padding-left: 135px; /* 모임 이미지 너비 + 여백 */
    margin-top: 10px;
}

.moim-categories {
    margin-bottom: 5px;
}

.moim-short-desc {
    margin-top: 5px;
    font-style: italic;
    color: #666;
}

/* 모바일 환경 대응 */
@media (max-width: 576px) {
    .moim-extended-info {
        padding-left: 0;
    }
    
    .moim-image-container {
        width: 80px;
        min-width: 80px;
        height: 80px;
    }
}