/* 기본 스타일 */
body {
  background-color: #F7F7F7;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #F7F7F7;
}

/* PC 스타일 */
.worship-container {
    width: 100%;
    max-width: 720px;
    margin: 80px auto;
    background-color: #ffffff;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.worship-title {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.worship-subtitle {
    text-align: center;
    font-size: 1rem;
    color: #666;
    margin-bottom: 30px;
}

.worship-date {
    font-size: 14px;
    font-weight: 400;
    color: #1e6091;
    text-align: right;
    margin-bottom: 1.2rem;
}

.update-notice {
    text-align: left;
    font-size: 0.9rem;
    color: #666;
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #1e6091;
    clear: both;
}

.worship-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.worship-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1rem;
    color: #333;
}

.worship-list .li2 {
    font-size: 12px;
    list-style-type: decimal;
    margin-left: 1.2rem;
}

.worship-section {
    margin-top: 30px;
}

.worship-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.worship-section p {
    font-size: 1rem;
    color: #444;
    margin: 0;
}

.worship-italic {
    font-style: italic;
    color: #1e6091;
}

.worship-songs {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.worship-songs li {
    padding: 6px 0;
    font-size: 1rem;
    color: #555;
    border-bottom: 1px dashed #ccc;
}

.score-thumb {
    height: 40px;
    vertical-align: middle;
    margin-left: 8px;
    cursor: pointer;
    background-color: #ffffff;
}

.bible-reading {
    color: #1e6091;
    text-decoration: underline;
    cursor: pointer;
    background-color: #ffffff;
    padding: 4px;
    border-radius: 4px;
}

.bible-text {
    margin-top: 8px;
    font-size: 0.95rem;
    color: #333;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-left: 3px solid #1e6091;
}

.worship-list-img {
    width: 100%;
    margin: 20px 0;
    text-align: center;
}

.worship-list-img img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.img-group {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.poster-img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.download-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    font-size: 0.95rem;
    color: white;
    background-color: #1e6091;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.download-btn:hover {
    background-color: #15527a;
}

/* 모바일 스타일 */
@media (max-width: 700px) {
    main {
        padding: 0px 20px;
    }

    .worship-container {
        padding: 24px 16px;
        margin: 70px auto;
    }

    .worship-title {
        font-size: 1.5rem;
    }

    .worship-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .update-notice {
        font-size: 0.85rem;
        margin: 12px 0;
        padding: 8px;
    }

    .worship-list li {
        font-size: 0.95rem;
        padding: 8px 0;
    }

    .worship-section h2 {
        font-size: 1rem;
    }

    .worship-section p,
    .worship-list .li2 {
        font-size: 0.9rem;
    }

    .worship-list-img {
        margin: 15px 0;
    }
    
    .worship-list-img img {
        border-radius: 6px;
    }

    #scrollTopBtn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        bottom: 15px;
        right: 15px;
    }

    .youtube-btn {
        font-size: 0.75em;
        padding: 2px 6px;
        margin-left: 8px;
    }

    .pdf-btn {
        font-size: 0.75em;
        padding: 2px 6px;
        margin-left: 6px;
    }

    .word-btn {
        font-size: 0.75em;
        padding: 2px 6px;
        margin-left: 6px;
    }

    .word-preview iframe {
        height: 300px;
    }

    .preview-modal {
        background-color: rgba(0, 0, 0, 0.95);
    }

    .preview-content {
        padding: 0;
        background-color: #fff;
    }

    .preview-iframe {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    #pdfPreviewModal .preview-content {
        background-color: #f8f9fa;
        padding: 0;
        margin: 0;
    }

    #pdfPreviewModal .preview-iframe {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .preview-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
        width: 32px;
        height: 32px;
        background-color: rgba(0, 0, 0, 0.7);
    }

    /* 모바일에서 터치 영역 확대 */
    .preview-close:active {
        transform: scale(1.1);
        background-color: rgba(0, 0, 0, 0.9);
    }

    /* 모바일에서 PDF 컨트롤 최적화 */
    #pdfPreviewModal .preview-iframe {
        -webkit-overflow-scrolling: touch;
        overflow: auto;
    }

    /* 모바일에서 가로 모드 대응 */
    @media (orientation: landscape) {
        #pdfPreviewModal .preview-content {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #pdfPreviewModal .preview-iframe {
            height: 100%;
            max-height: 100vh;
        }
    }

    /* 모바일에서 세로 모드 대응 */
    @media (orientation: portrait) {
        #pdfPreviewModal .preview-content {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #pdfPreviewModal .preview-iframe {
            width: 100%;
            height: 100%;
            max-height: 100vh;
        }
    }
}

/* 모달 스타일 */
.score-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.modal-content-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-modal img.modal-content {
    max-width: 90%;
    max-height: 72vh;
    border-radius: 8px;
    transition: transform 0.3s ease;
    transform: scale(0.9);
    background-color: #fff;
    padding: 8px;
}

.score-modal.show img.modal-content {
    transform: scale(1);
}

.modal-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.modal-btn {
    padding: 6px 14px;
    font-size: 0.95rem;
    background-color: #1e6091;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.modal-btn:hover {
    background-color: #15527a;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

/* 스크롤 버튼 */
#scrollTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-size: 1.2rem;
    width: 45px;
    height: 45px;
    background-color: #1e6091;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#scrollTopBtn:hover {
    background-color: #15527a;
    transform: translateY(-2px);
}

/* 로그아웃 버튼 */
#logout-btn {
    font-size: 14px;
    padding: 8px 14px;
    color: #ffffff;
    background-color: #E06565;
}

#logout-btn:hover {
    background-color: #C05454;
}

/* 유튜브 버튼 스타일 */
.youtube-btn {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background-color: #ff0000;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.8em;
    transition: background-color 0.2s ease;
}

.youtube-btn:hover {
    background-color: #cc0000;
}

/* PDF 버튼 스타일 */
.pdf-btn {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background-color: #1e6091;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.8em;
    transition: background-color 0.2s ease;
}

.pdf-btn:hover {
    background-color: #15527a;
}

.pdf-btn.download {
    background-color: #28a745;
}

.pdf-btn.download:hover {
    background-color: #218838;
}

/* 워드 파일 버튼 스타일 */
.word-btn {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background-color: #2b579a;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.8em;
    transition: background-color 0.2s ease;
}

.word-btn:hover {
    background-color: #1e3f8a;
}

.word-btn.download {
    background-color: #28a745;
}

.word-btn.download:hover {
    background-color: #218838;
}

.word-preview {
    margin-top: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.word-preview iframe {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 3px;
}

/* 프리뷰 모달 스타일 */
.preview-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.preview-modal.show {
    display: flex;
}

.preview-content {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
}

.preview-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.preview-close:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

@media (max-width: 700px) {
    .preview-content {
        padding: 0;
    }
    
    .preview-close {
        top: 15px;
        right: 20px;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
}

/* PDF 프리뷰 특별 스타일 */
#pdfPreviewModal .preview-content {
    background-color: #f8f9fa;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#pdfPreviewModal .preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
    -webkit-overflow-scrolling: touch;
}

#pdfPreviewModal .preview-close {
    position: fixed;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10001;
    cursor: pointer;
    transition: all 0.2s ease;
}

#pdfPreviewModal .preview-close:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* 모바일 최적화 */
@media (max-width: 700px) {
    #pdfPreviewModal .preview-content {
        padding: 0;
        margin: 0;
    }

    #pdfPreviewModal .preview-iframe {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    #pdfPreviewModal .preview-close {
        top: 10px;
        right: 10px;
        font-size: 20px;
        width: 32px;
        height: 32px;
    }

    /* 모바일에서 터치 영역 확대 */
    #pdfPreviewModal .preview-close:active {
        transform: scale(1.1);
        background-color: rgba(0, 0, 0, 0.9);
    }

    /* 모바일에서 PDF 컨트롤 최적화 */
    #pdfPreviewModal .preview-iframe {
        -webkit-overflow-scrolling: touch;
        overflow: auto;
    }

    /* 모바일에서 가로 모드 대응 */
    @media (orientation: landscape) {
        #pdfPreviewModal .preview-content {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #pdfPreviewModal .preview-iframe {
            height: 100%;
            max-height: 100vh;
        }
    }

    /* 모바일에서 세로 모드 대응 */
    @media (orientation: portrait) {
        #pdfPreviewModal .preview-content {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #pdfPreviewModal .preview-iframe {
            width: 100%;
            height: 100%;
            max-height: 100vh;
        }
    }
}

/* 교회 소식 섹션 스타일 */
.church-notice {
    width: 100%;
    max-width: 720px;
    margin: 40px auto;
    background-color: #ffffff;
    padding: 30px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.church-notice .worship-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.church-notice .worship-section {
    margin-top: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.church-notice .worship-section:last-child {
    border-bottom: none;
}

.church-notice .worship-section h2 {
    color: #1e6091;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.church-notice .worship-section p {
    line-height: 1.6;
    margin-bottom: 8px;
}

.church-notice .worship-list {
    margin-top: 10px;
    padding-left: 15px;
}

.church-notice .worship-list li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.church-notice .worship-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #1e6091;
}

/* 모바일 최적화 */
@media (max-width: 700px) {
    .church-notice {
        margin: 20px auto;
        padding: 20px 15px;
        border-radius: 8px;
    }

    .church-notice .worship-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .church-notice .worship-section {
        margin-top: 20px;
        padding-bottom: 12px;
    }

    .church-notice .worship-section h2 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .church-notice .worship-section p {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 6px;
    }

    .church-notice .worship-list {
        margin-top: 8px;
        padding-left: 12px;
    }

    .church-notice .worship-list li {
        font-size: 0.95rem;
        padding-left: 12px;
        margin-bottom: 6px;
    }

    /* 모바일에서 터치 영역 확대 */
    .church-notice .worship-section h2,
    .church-notice .worship-list li {
        padding: 4px 0;
    }

    /* 모바일에서 가독성 개선 */
    .church-notice .worship-section p {
        word-break: keep-all;
        word-wrap: break-word;
    }
}