/* 사역자 페이지 스타일 (그누보드 버전) */

/* ==================== PC 레이아웃 (1100px 컨테이너) ==================== */

/* 사역자 래퍼 */
.pastorsWrap {
    background: #fff;
    padding: 0;
    margin: 0;
    min-height: calc(100vh - 200px);
    max-width: 1312px;
    margin: 0 auto;
}

/* 타이틀 */
.pastors-title {
    text-align: center;
    font-size: 2rem;
    line-height: 1.3;
    margin: 0 0 40px 0;
    padding-top: 40px;
    font-weight: 700;
    color: #0d284d;
}

@media (min-width: 1024px) {
    .pastors-title {
        font-size: 3rem;
        margin-bottom: 60px;
        padding-top: 60px;
    }
}

/* 검색 영역 */
.filter-wrap {
    background: #fff;
    padding: 0 0 30px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

@media (min-width: 1024px) {
    .filter-wrap {
        padding: 0 0 40px 0;
        background: #fff;
    }
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 300px;
}

@media (min-width: 1024px) {
    .filter-search {
        max-width: 320px;
    }

    #searchInput {
        height: 44px;
        font-size: 15px;
    }

    #searchBtn {
        width: 44px;
        height: 44px;
    }
}

/* 선택삭제 버튼 */
.btn-delete-selected {
    padding: 10px 20px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-delete-selected:hover {
    background: #c82333;
}

.btn-delete-selected:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#searchInput {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
}

#searchInput:focus {
    border-color: #0d284d;
    outline: none;
}

#searchBtn {
    width: 44px;
    height: 44px;
    background: #0d284d;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

#searchBtn:hover {
    background: #0a1f3a;
}

#searchBtn svg {
    width: 20px;
    height: 20px;
}

/* 사역자 리스트 */
.pastorsList {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 12px;
    background: #fff;
}

@media (min-width: 768px) {
    .pastorsList {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px 16px;
    }
}

@media (min-width: 1024px) {
    .pastorsList {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px 20px;
        padding: 0;
        background: #fff;
    }
}

/* 사역자 카드 */
.pastorCard {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.pastorCard:hover {
    border-color: #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pastorCard .cardImage {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f0f0f0;
}

.pastorCard .cardImage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pastorCard .cardInfo {
    padding: 12px;
    text-align: center;
}

@media (min-width: 1024px) {
    .pastorCard .cardInfo {
        padding: 16px;
    }
}

.pastorCard .pastorName {
    font-size: 16px;
    font-weight: 600;
    color: #0d284d;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 1024px) {
    .pastorCard .pastorName {
        font-size: 17px;
        margin-bottom: 6px;
    }
}

.pastorCard .pastorChurch {
    font-size: 13px;
    color: #666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 1024px) {
    .pastorCard .pastorChurch {
        font-size: 14px;
    }
}

/* 관리자 체크박스 */
.adminCheckbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    cursor: pointer;
}

.adminCheckbox input {
    display: none;
}

.adminCheckbox .checkmark {
    display: block;
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.9);
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s;
}

.adminCheckbox input:checked + .checkmark {
    background: #0d284d;
    border-color: #0d284d;
}

.adminCheckbox input:checked + .checkmark::after {
    content: '';
    display: block;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin: 3px auto 0;
}

/* 수정/삭제 버튼 */
.cardEditBtns {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 5;
}

.cardEditBtns button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    transition: all 0.2s;
}

.cardEditBtns .btnEdit:hover {
    background: #0d284d;
    color: #fff;
}

.cardEditBtns .btnDelete:hover {
    background: #ff4444;
    color: #fff;
}

/* 로딩 */
.loading-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 40px 20px;
}

.loading-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
}

.loading-circle {
    stroke-dasharray: 63;
    stroke-dashoffset: 0;
    transform-origin: center;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); stroke-dashoffset: 63; }
    50% { stroke-dashoffset: 15.75; }
    100% { transform: rotate(360deg); stroke-dashoffset: 63; }
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0 0 16px 0;
}

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots .dot {
    width: 8px;
    height: 8px;
    background: #0d284d;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots .dot:nth-child(1) { animation-delay: 0s; }
.loading-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* 데이터 없음 */
.no-data {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 300px;
    padding: 40px 20px;
}

.no-data-icon svg {
    width: 64px;
    height: 64px;
    opacity: 0.5;
}

.no-data-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 16px 0 8px 0;
}

.no-data-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: #fff;
}

.pageBtn {
    min-width: 40px;
    height: 40px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.pageBtn:hover:not(:disabled):not(.active) {
    border-color: #0d284d;
    background: #f8f9fa;
    color: #0d284d;
}

.pageBtn.active {
    border-color: #0d284d;
    background: #0d284d;
    color: #fff;
}

.pageBtn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 등록 버튼 */
.write-btn-container {
    padding: 24px 16px 32px;
    background: #fff;
}

@media (min-width: 1024px) {
    .write-btn-container {
        padding: 30px 40px 40px;
        display: flex;
        justify-content: center;
        background: #fff;
    }
}

.btn-write-main {
    display: block;
    width: 100%;
    height: 52px;
    background: #0d284d;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    text-align: center;
    line-height: 52px;
    cursor: pointer;
    transition: all 0.2s;
}

@media (min-width: 1024px) {
    .btn-write-main {
        width: 300px;
        height: 56px;
        line-height: 56px;
        font-size: 17px;
        border-radius: 10px;
    }
}

.btn-write-main:hover {
    background: #0a1f3a;
}

/* 모달 스타일 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    margin: auto;
}

@media (min-width: 1024px) {
    .modal-content {
        max-width: 600px;
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0d284d;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 20px;
}

/* 폼 그룹 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-label.required::after {
    content: '*';
    color: #ff4444;
    margin-left: 4px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
    transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    border-color: #0d284d;
    outline: none;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.6;
}

/* 프로필 사진 업로드 */
.profile-upload-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.profile-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #ccc;
    font-size: 12px;
}

.btn-upload {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:hover {
    background: #e9ecef;
}

/* SNS 입력 필드 */
.sns-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sns-input-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sns-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 16px;
    flex-shrink: 0;
}

.sns-input-item .form-input {
    flex: 1;
}

/* 갤러리 업로드 */
.gallery-upload-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

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

.gallery-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-upload-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload-gallery:hover {
    border-color: #0d284d;
    color: #0d284d;
}

/* 유튜브 링크 */
.youtube-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.youtube-item {
    display: flex;
    gap: 8px;
}

.youtube-item .form-input {
    flex: 1;
}

.btn-remove-youtube {
    width: 40px;
    height: 40px;
    border: none;
    background: #ff4444;
    color: #fff;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-add-youtube {
    padding: 10px;
    background: transparent;
    border: 1px dashed #0d284d;
    border-radius: 8px;
    font-size: 14px;
    color: #0d284d;
    cursor: pointer;
    margin-top: 8px;
}

.btn-add-youtube:hover {
    background: #f8f9fa;
}

/* 폼 액션 */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.btn-cancel,
.btn-submit {
    flex: 1;
    height: 48px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f8f9fa;
    color: #666;
}

.btn-cancel:hover {
    background: #e9ecef;
}

.btn-submit {
    background: #0d284d;
    color: #fff;
}

.btn-submit:hover {
    background: #0a1f3a;
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 토스트 */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s;
    z-index: 10001;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 반응형 - 작은 모바일 */
@media (max-width: 400px) {
    .pastorsList {
        gap: 16px 10px;
        padding: 0;
    }

    .pastorCard .cardInfo {
        padding: 10px;
    }

    .pastorCard .pastorName {
        font-size: 14px;
    }

    .pastorCard .pastorChurch {
        font-size: 12px;
    }

    .gallery-preview {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==================== PC 전용 스타일 추가 ==================== */
@media (min-width: 1024px) {
    /* 페이지네이션 */
    .pagination {
        padding: 30px 40px;
    }

    .pageBtn {
        min-width: 44px;
        height: 44px;
        font-size: 15px;
    }

    /* 폼 스타일 개선 */
    .modal-body {
        padding: 30px;
    }

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

    .form-label {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .form-input,
    .form-textarea {
        padding: 14px 16px;
        font-size: 15px;
    }

    /* 프로필 업로드 */
    .profile-upload-wrap {
        gap: 24px;
    }

    .profile-preview {
        width: 120px;
        height: 120px;
    }

    .btn-upload {
        padding: 12px 24px;
        font-size: 15px;
    }

    /* 갤러리 업로드 */
    .gallery-preview {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }

    /* 폼 액션 버튼 */
    .form-actions {
        gap: 16px;
        margin-top: 30px;
        padding-top: 24px;
    }

    .btn-cancel,
    .btn-submit {
        height: 52px;
        font-size: 17px;
        border-radius: 10px;
    }
}

/* ==================== 프로필 모달 스타일 ==================== */

.profile-modal-overlay {
    padding: 0;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.profile-modal-overlay.active {
    visibility: visible;
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

.profile-modal-content {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    position: relative;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.profile-modal-overlay.active .profile-modal-content {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .profile-modal-overlay {
        padding: 20px;
        align-items: center;
    }

    .profile-modal-content {
        width: 100%;
        max-width: 500px;
        height: auto;
        max-height: calc(100vh - 40px);
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        transform: translateY(40px);
        opacity: 0;
    }

    .profile-modal-overlay.active .profile-modal-content {
        transform: translateY(0);
        opacity: 1;
    }
}

.profile-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.2s;
}

.profile-modal-close:hover {
    background: rgba(0, 0, 0, 0.6);
}

@media (min-width: 768px) {
    .profile-modal-close {
        top: 16px;
        right: 16px;
        background: rgba(255, 255, 255, 0.25);
    }

    .profile-modal-close:hover {
        background: rgba(255, 255, 255, 0.4);
    }
}

.profile-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: #fff;
}

/* 모달 내 프로필 스타일 오버라이드 */
.profile-modal-body .profile-container {
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    min-height: auto !important;
    max-width: 100% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.profile-modal-body .profile-header {
    padding: 40px 16px 60px !important;
}

.profile-modal-body .profile-content {
    max-width: 100% !important;
    padding: 0 16px 30px !important;
    margin-top: -20px;
}

.profile-modal-body .back-button-wrap {
    display: none !important;
}

/* ==================== 라이트박스 스타일 ==================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 10001;
    visibility: hidden;
    opacity: 0;
    transition: background 0.35s ease, opacity 0.35s ease, visibility 0s linear 0.35s;
}

.lightbox.active {
    visibility: visible;
    background: rgba(0, 0, 0, 0.95);
    opacity: 1;
    transition: background 0.35s ease, opacity 0.35s ease, visibility 0s linear 0s;
}

/* Swiper 컨테이너 */
.lightbox-swiper {
    width: 100%;
    height: 100%;
}

.lightbox-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-swiper .swiper-slide img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    transform: scale(0.85);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.lightbox.active .swiper-slide-active img {
    transform: scale(1);
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-close svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    stroke-width: 2;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    pointer-events: none;
    z-index: 10;
}

.lightbox-prev,
.lightbox-next {
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.lightbox-prev svg,
.lightbox-next svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
}

.lightbox-prev.swiper-button-disabled,
.lightbox-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: default;
}

/* 모바일에서 좌우 버튼 숨김 */
@media (max-width: 768px) {
    .lightbox-nav {
        display: none;
    }
    .content-body .c{padding:0px 15px;}

}

.lightbox-close:hover,
.lightbox-prev:hover:not(.swiper-button-disabled),
.lightbox-next:hover:not(.swiper-button-disabled) {
    background: rgba(255, 255, 255, 0.3);
}
