/* 학습교안 상세 페이지 스타일 */

/* Engagement 버튼 스타일 */
.engagement-btn {
    position: relative;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
}

.engagement-btn.liked {
    background: #fee2e2;
    border-color: #fecaca;
}

.engagement-btn.liked .fas.fa-heart {
    color: #ef4444;
}

.engagement-btn:not(.liked) .fas.fa-heart {
    color: #6b7280;
}

.engagement-btn.favorited {
    background: #f3e8ff;
    border-color: #ddd6fe;
}

.engagement-btn.favorited .fas.fa-bookmark {
    color: #8b5cf6;
}

.engagement-btn:not(.favorited) .fas.fa-bookmark {
    color: #6b7280;
}

.engagement-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #fff;
    color: #666;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

/* Pin Container를 포함하는 wrapper는 overflow visible이어야 sticky가 작동 */
.content-wrapper.js-content-wrapper {
    overflow: visible !important;
}

/* Pin Container & Sticky Sidebar */
.js-pin-container {
    position: relative;
    overflow: visible !important;
}

.courses-single-info {
    position: absolute;
    z-index: 12;
    max-width: 350px;
    width: 100%;
    height: 100%; 
    right: 7%; 
    top: 0;
    overflow: visible !important;
    padding-top: 50px;
}

.sidebar-sticky-content {
    position: sticky;
    top: 150px;
}

.courses-single-info__content {
    max-height: none;
}

#js-pin-content .sidebar-sticky-content > .relative {
    margin: 0 auto;
}

@media (max-width: 1199px) {
    .courses-single-info {
        width: 300px;
    }
}
/* 모바일에서는 static으로 변경하고 인라인 스타일 재설정 */
@media (max-width: 991px) {
    .courses-single-info {
        position: static !important;
        height: fit-content !important;
        right: 0 !important;
        padding-top: 0 !important;
        z-index: 1;
        width: 100% !important;
        max-width: none;
    }
    
    .courses-single-info > div {
        position: static !important;
    }
}

/* Page Header Type 5 */
.page-header.-type-5 {
    position: relative;
    /* overflow: hidden; */
}

.page-header__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.page-header__bg .bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.1;
}

.page-header__content {
    position: relative;
    z-index: 1;
}

/* Badges */
.badge {
    display: inline-block;
    border-radius: 200px;
    font-weight: 400;
}

.bg-green-1 {
    /* background-color: #daf5e7; */
}

.bg-orange-1 {
    background-color: #ff6b2b;
}

.bg-purple-1 {
    background-color: #6c5ce7;
}

/* Video Trigger Button */
.video-trigger {
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Sidebar Content */
.worksheets-single-info .button {
    text-align: center;
}

.worksheets-single-info__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.worksheets-single-info__list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.worksheets-single-info__list li:last-child {
    border-bottom: none;
}

/* Page Nav Menu */
.page-nav-menu {
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 40px;
}

.page-nav-menu.-line {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 20px 0;
}

.page-nav-menu__link {
    display: inline-block;
    padding-bottom: 12px;
    color: #333;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.page-nav-menu__link:hover {
    color: #6c5ce7;
}

.page-nav-menu__link.is-active {
    color: #6c5ce7;
    border-bottom-color: #6c5ce7;
}

/* Content Sections */
#overview,
#course-content,
#instructors,
#reviews {
    scroll-margin-top: 100px;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* Overview Section */
.overview-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

.overview-content p {
    line-height: 1.8;
    margin-bottom: 20px;
}

.overview-content ul {
    list-style: none;
    padding-left: 0;
}

.overview-content ul li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
}

.overview-content ul li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #6c5ce7;
    font-weight: bold;
}

/* Course Content Accordion */
.accordion-curriculum {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-curriculum__item {
    border-bottom: 1px solid #e5e7eb;
}

.accordion-curriculum__item:last-child {
    border-bottom: none;
}

.accordion-curriculum__button {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.accordion-curriculum__button:hover {
    background-color: #f9fafb;
}

.accordion-curriculum__icon {
    transition: transform 0.3s ease;
}

.accordion-curriculum__item.is-active .accordion-curriculum__icon {
    transform: rotate(180deg);
}

.accordion-curriculum__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #f9fafb;
}

.accordion-curriculum__item.is-active .accordion-curriculum__content {
    max-height: 1000px;
}

.accordion-curriculum__content-inner {
    padding: 20px;
}

/* Instructor Card */
.instructor-card {
    display: flex;
    gap: 20px;
    padding: 30px;
    background: #f9fafb;
    border-radius: 8px;
}

.instructor-card__image {
    flex-shrink: 0;
}

.instructor-card__image img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.instructor-card__content h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.instructor-card__stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.instructor-card__stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Reviews Section */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.review-item {
    padding: 30px;
    background: #f9fafb;
    border-radius: 8px;
}

.review-item__header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.review-item__avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.review-item__info h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.review-item__rating {
    display: flex;
    gap: 5px;
}

.review-item__content p {
    line-height: 1.8;
}

/* Related Worksheets Slider */
.js-section-slider {
    padding: 20px 0;
}

.worksheetsCard {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.worksheetsCard:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.worksheetsCard__image {
    position: relative;
    overflow: hidden;
    padding-top: 56.62%; /* 710x402 비율 */
}

.worksheetsCard__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.worksheetsCard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
}

.worksheetsCard-footer__author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.worksheetsCard-footer__author img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 1199px) {
    .worksheets-single-info {
        position: static;
        max-width: 100%;
        margin-top: 40px;
    }
}

@media (max-width: 991px) {
    .page-header.-type-5 .page-header__content {
        padding-top: 60px;
        padding-bottom: 60px;
    }
    
    .page-nav-menu {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .instructor-card {
        flex-direction: column;
        text-align: center;
    }
    
    .instructor-card__stats {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .page-header.-type-5 h1 {
        font-size: 24px;
    }
    
    .worksheets-single-info__content {
        max-height: none;
    }
    
    .review-item__header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 문의 이미지 업로드 영역 - 후기와 동일한 스타일 */
.inquiry-image-previews {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .inquiry-image-previews {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .inquiry-image-previews {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 문의 이미지 카드 공통 */
.inquiry-image-card {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 비율 */
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

/* + 추가 카드 */
.inquiry-image-card.add-card {
    border: 2px dashed #d1d5db;
    background-color: #f9fafb;
    transition: all 0.3s ease;
}

.inquiry-image-card.add-card:hover {
    border-color: #6440fb;
    background-color: #f5f3ff;
}

.inquiry-image-card.add-card .add-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: #9ca3af;
    pointer-events: none;
}

.inquiry-image-card.add-card:hover .add-icon {
    color: #6440fb;
}

/* 문의 이미지 프리뷰 카드 */
.inquiry-image-card.preview-card {
    background-color: #f3f4f6;
}

.inquiry-image-card.preview-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inquiry-image-card.preview-card .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.2s ease;
    z-index: 10;
}

.inquiry-image-card.preview-card .remove-image:hover {
    background-color: rgba(220, 38, 38, 0.9);
}
/* 교구 카드 스타일 */
.material-card {
    background: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.material-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12) !important;
}

.material-card .material-thumbnail {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f8f9fa;
}

.material-card .material-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-card .badge-pill {
    display: inline-block;
    border-radius: 50px;
}

.material-card .button {
    transition: all 0.3s ease;
}

.material-card .button:hover:not(:disabled) {
    transform: scale(1.05);
}

/* 교구 섹션 반응형 */
@media (max-width: 991px) {
    .material-card {
        margin-bottom: 20px;
    }
}

@media (max-width: 767px) {
    #learning-tools .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* 교구 수량 입력 모달 */
.material-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.material-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.material-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    z-index: 10001;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.material-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid #e5e7eb;
}

.material-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.material-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.material-modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* 스크롤바 스타일링 */
.material-modal-body::-webkit-scrollbar {
    width: 8px;
}

.material-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.material-modal-body::-webkit-scrollbar-thumb {
    background: #9333ea;
    border-radius: 4px;
}

.material-modal-body::-webkit-scrollbar-thumb:hover {
    background: #7c2fc2;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 200px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    font-weight: 600;
    color: #6b7280;
    line-height: 1;
    user-select: none;
}

.quantity-btn:hover {
    background: #f3f4f6;
    border-color: #9333ea;
    color: #9333ea;
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    flex: 1;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    padding: 0 10px;
}

.quantity-input:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Remove spinner buttons from number input */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input[type=number] {
    -moz-appearance: textfield;
}

.material-modal-total {
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 10px;
}

.material-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
}

.material-modal-footer .button {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

@media (max-width: 576px) {
    .material-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .material-modal-header,
    .material-modal-body,
    .material-modal-footer {
        padding: 20px;
    }
    
    .material-modal-footer .button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ====================================================
   미리보기 이미지 모달 (pim)
   ==================================================== */
.pim-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pim-container {
    position: relative;
    width: min(92vw, 760px);
    max-height: 90vh;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform-origin: center center;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    transition: transform 0.42s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
}

.pim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 0 20px;
    height: 52px;
    min-height: 52px;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.pim-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.pim-close {
    background: rgba(255,255,255,0.08);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
    flex-shrink: 0;
}
.pim-close:hover { background: rgba(255,255,255,0.2); }

.pim-track-wrap {
    overflow: hidden;
    flex: 1;
}

.pim-track {
    display: flex;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}

.pim-slide {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    min-height: 340px;
    max-height: 76vh;
}

.pim-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.pim-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.2s;
    line-height: 1;
}
.pim-nav:hover { background: rgba(255,255,255,0.25); }
.pim-prev { left: 12px; }
.pim-next { right: 12px; }

.pim-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 0 14px;
    background: #111;
}

.pim-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.pim-dot.active {
    background: #fff;
    transform: scale(1.25);
}

@media (max-width: 600px) {
    .pim-container { width: 98vw; }
    .pim-nav { width: 36px; height: 36px; font-size: 22px; }
}