/* ============================================
   MasterStudy Course Carousel Pro - Styles
   ============================================ */

/* 캐러셀 컨테이너 */
.msc-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
    box-sizing: border-box;
}

.msc-carousel-wrapper[data-arrow-pos="outside"] {
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.msc-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.msc-grid-pro {
    width: 100%;
}

.msc-grid-pro .msc-grid-filter,
.msc-excerpt-only-wrap .msc-grid-filter,
.msc-uc-filter-outer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.msc-filter-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.msc-grid-pro .msc-filter-button,
.msc-grid-pro .msc-page-button,
.msc-excerpt-only-wrap .msc-filter-button,
.msc-excerpt-only-wrap .msc-page-button,
.msc-uc-filter-outer .msc-filter-button {
    border: 1px solid #d1d5db;
    background: #ffffff !important;
    color: #6b7280 !important;
    border-radius: 20px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
    line-height: 1.2;
}

.msc-grid-pro .msc-filter-button:hover,
.msc-grid-pro .msc-page-button:hover,
.msc-excerpt-only-wrap .msc-filter-button:hover,
.msc-excerpt-only-wrap .msc-page-button:hover,
.msc-uc-filter-outer .msc-filter-button:hover {
    border-color: #9ca3af;
    color: #374151 !important;
    background: #f9fafb !important;
}

.msc-grid-pro .msc-filter-button.is-active,
.msc-grid-pro .msc-page-button.is-active,
.msc-excerpt-only-wrap .msc-filter-button.is-active,
.msc-excerpt-only-wrap .msc-page-button.is-active,
.msc-uc-filter-outer .msc-filter-button.is-active {
    background: #1f2937 !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.18);
}

.msc-grid-list {
    display: grid;
    gap: 24px;
}

.msc-grid-page-item {
    min-width: 0;
}

.msc-grid-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
}

.msc-excerpt-only-list {
    display: grid;
    gap: 18px;
}

.msc-excerpt-only-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

@media (max-width: 1024px) {
    .msc-grid-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 767px) {
    .msc-grid-list {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .msc-grid-filter {
        gap: 8px;
        margin-bottom: 20px;
    }

    .msc-filter-button,
    .msc-page-button {
        padding: 9px 14px;
        font-size: 13px;
    }
}

/* 카로셀 아이템 */
.msc-item {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 카드 링크 */
.msc-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Coming Soon 배너 (최하단) */
.msc-coming-soon-footer {
    margin-top: auto;
    padding: 12px 12px 12px 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background-color: transparent;
}

.msc-coming-soon-label {
    color: #FF6B6B;
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.msc-coming-soon-label::before {
    content: '';
    font-size: 14px;
    margin-right: 0px;
}

.msc-coming-soon-date {
    background: #FFE8E8;
    color: #FF6B6B;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* 그림자 선택자 (Elementor 스타일 조정용) */
.msc-item.shadow-none,
.msc-item[data-shadow="none"] {
    box-shadow: none !important;
}

.msc-item.shadow-light,
.msc-item[data-shadow="light"] {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.msc-item.shadow-normal,
.msc-item[data-shadow="normal"] {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

.msc-item.shadow-strong,
.msc-item[data-shadow="strong"] {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15) !important;
}

.msc-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.msc-card-link:hover {
    opacity: 0.95;
}

/* 썸네일 */
.msc-item {
    position: relative;
}

.msc-thumb {
    position: relative;
    width: 100%;
    padding-top: 66.67%;
    overflow: hidden;
    background: #f5f5f5;
}

.msc-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.msc-item:hover .msc-thumb img {
    transform: scale(1.05);
}

/* 콘텐츠 */
.msc-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}

/* 메타정보 (카테고리 & 별점) */
.msc-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.msc-category {
    background: #f0f0f0;
    color: #666;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msc-rating {
    color: #f1c40f;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.msc-rating i {
    margin-right: 4px;
}

.msc-rating-none {
    color: #ccc;
    font-weight: 400;
    font-size: 12px;
}

/* 제목 */
.msc-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 요약문 */
.msc-excerpt {
    font-size: 13px;
    color: #777;
    margin: 0;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 수동 요약문: <br> 줄바꿈 그대로 표시 (line-clamp 해제) */
.msc-excerpt.msc-excerpt-pre {
    white-space: pre-line;
}

.msc-single-excerpt {
    width: 100%;
}

.msc-single-excerpt__content {
    color: #334155;
    line-height: 1.8;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.msc-single-excerpt__content p {
    margin: 0 0 16px;
}

.msc-single-excerpt__content p:last-child {
    margin-bottom: 0;
}

.msc-single-excerpt__empty {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

/* 강사명 */
.msc-instructor {
    font-size: 13px;
    color: #999;
    padding: 8px 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 레벨 배지 */
.msc-level {
    margin: 8px 0;
}

.msc-level-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #e8f1ff;
    color: #2B73E0;
    transition: all 0.3s ease;
}

.msc-level-badge:hover {
    background: #d0e3ff;
}

/* 날짜 */
.msc-dates {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 가격 박스 */
.msc-price-box {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.msc-discount {
    background: #ff4444;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.msc-sale {
    color: #2B73E0;
    font-weight: 700;
    font-size: 15px;
}

.msc-original {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
}

/* ============================================
   화살표 스타일
   ============================================ */

/* 기본 화살표 (내부 위치) */
.msc-carousel-wrapper[data-arrow-pos="inside"] .swiper-button-prev,
.msc-carousel-wrapper[data-arrow-pos="inside"] .swiper-button-next,
.msc-carousel .swiper-button-prev,
.msc-carousel .swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: var(--arrow-bg-size, 40px);
    height: var(--arrow-bg-size, 40px);
    background: rgba(255, 255, 255, var(--arrow-bg-opacity, 0.9));
    border-radius: 50%;
    color: #2B73E0;
    font-size: 24px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    padding: 0;
}

.msc-carousel-wrapper[data-arrow-pos="inside"] .swiper-button-prev,
.msc-carousel .swiper-button-prev {
    left: 10px !important;
}

.msc-carousel-wrapper[data-arrow-pos="inside"] .swiper-button-next,
.msc-carousel .swiper-button-next {
    right: 10px !important;
}

.msc-carousel-wrapper[data-arrow-pos="inside"] .swiper-button-prev:hover,
.msc-carousel-wrapper[data-arrow-pos="inside"] .swiper-button-next:hover,
.msc-carousel .swiper-button-prev:hover,
.msc-carousel .swiper-button-next:hover {
    background: #2B73E0;
    color: #fff;
    box-shadow: 0 4px 12px rgba(43, 115, 224, 0.3);
}

/* 상단 화살표 */
.msc-arrows-top {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 10px;
}

.msc-arrows-top .msc-nav-prev,
.msc-arrows-top .msc-nav-next {
    width: var(--arrow-bg-size, 36px);
    height: var(--arrow-bg-size, 36px);
    border: none;
    background: rgba(255, 255, 255, var(--arrow-bg-opacity, 0.9));
    border-radius: 50%;
    color: #2B73E0;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.msc-arrows-top .msc-nav-prev:hover,
.msc-arrows-top .msc-nav-next:hover {
    background: #2B73E0;
    color: #fff;
    box-shadow: 0 4px 12px rgba(43, 115, 224, 0.3);
}

/* 하단 화살표 */
.msc-arrows-bottom {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding: 0 10px;
}

.msc-arrows-bottom .msc-nav-prev,
.msc-arrows-bottom .msc-nav-next {
    width: var(--arrow-bg-size, 36px);
    height: var(--arrow-bg-size, 36px);
    border: none;
    background: rgba(255, 255, 255, var(--arrow-bg-opacity, 0.9));
    border-radius: 50%;
    color: #2B73E0;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.msc-arrows-bottom .msc-nav-prev:hover,
.msc-arrows-bottom .msc-nav-next:hover {
    background: #2B73E0;
    color: #fff;
    box-shadow: 0 4px 12px rgba(43, 115, 224, 0.3);
}

/* 외부 위치 화살표 */
.msc-arrows-outside {
    position: static;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 20px;
    gap: 20px;
}

.msc-arrows-outside .msc-nav-prev,
.msc-arrows-outside .msc-nav-next {
    width: var(--arrow-bg-size, 40px);
    height: var(--arrow-bg-size, 40px);
    min-width: var(--arrow-bg-size, 40px);
    min-height: var(--arrow-bg-size, 40px);
    border: none;
    background: rgba(255, 255, 255, var(--arrow-bg-opacity, 0.9));
    border-radius: 50%;
    color: #2B73E0;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    padding: 0;
    flex-shrink: 0;
}

.msc-arrows-outside .msc-nav-prev:hover,
.msc-arrows-outside .msc-nav-next:hover {
    background: #2B73E0;
    color: #fff;
    box-shadow: 0 4px 12px rgba(43, 115, 224, 0.3);
}

/* ============================================
   반응형 디자인
   ============================================ */

/* 1024px 이상 */
@media (min-width: 1025px) {
    .msc-content {
        padding: 20px;
    }

    .msc-title {
        font-size: 16px;
    }

    .msc-excerpt {
        font-size: 13px;
    }
}

/* 1024px ~ 769px */
@media (max-width: 1024px) {
    .msc-content {
        padding: 16px;
    }

    .msc-title {
        font-size: 15px;
    }

    .msc-excerpt {
        font-size: 12px;
    }

    .msc-price-box {
        font-size: 14px;
    }
}

/* 768px ~ 481px */
@media (max-width: 768px) {
    .msc-content {
        padding: 14px;
    }

    .msc-title {
        font-size: 14px;
    }

    .msc-excerpt {
        font-size: 11px;
        line-height: 1.4;
    }

    .msc-category {
        font-size: 11px;
        padding: 3px 8px;
    }

    .msc-rating {
        font-size: 12px;
    }

    .swiper-button-prev,
    .swiper-button-next {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .msc-discount {
        font-size: 11px;
        padding: 3px 6px;
    }

    .msc-sale {
        font-size: 14px;
    }
}

/* 480px 이하 */
@media (max-width: 480px) {
    .msc-carousel {
        margin: 0 -5px;
    }

    .msc-item {
        border-radius: 12px;
    }

    .msc-content {
        padding: 12px;
        gap: 6px;
    }

    .msc-title {
        font-size: 13px;
        line-height: 1.3;
    }

    .msc-excerpt {
        font-size: 10px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }

    .msc-meta {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .msc-category {
        font-size: 10px;
        padding: 2px 6px;
    }

    .msc-rating {
        font-size: 11px;
    }

    .msc-level-badge {
        font-size: 11px;
        padding: 4px 10px;
    }

    .msc-instructor {
        font-size: 12px;
        padding: 6px 0;
    }

    .msc-dates {
        font-size: 11px;
    }

    .msc-price-box {
        font-size: 12px;
        gap: 4px;
    }

    .msc-discount {
        font-size: 10px;
        padding: 2px 5px;
    }

    .msc-sale {
        font-size: 12px;
    }

    .swiper-button-prev,
    .swiper-button-next {
        width: 32px;
        height: 32px;
        font-size: 16px;
        left: 5px;
    }

    .swiper-button-next {
        right: 5px;
    }

    .msc-arrows-top,
    .msc-arrows-bottom {
        gap: 8px;
        margin: 10px 0;
        padding: 0;
    }

    .msc-arrows-top .msc-nav-prev,
    .msc-arrows-top .msc-nav-next,
    .msc-arrows-bottom .msc-nav-prev,
    .msc-arrows-bottom .msc-nav-next {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ─── 커리큘럼 섹션 ─── */
.msc-curriculum-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
    margin-top: 20px;
    padding: 20px;
    background-color: #F5F7FA;
    border: 1px solid #E2E2E2;
    border-radius: 6px;
}

.msc-curriculum-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    margin-bottom: 0 !important;
}

.msc-curriculum-badge {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    padding: 3px 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
    letter-spacing: 0.3px !important;
    margin-top: 1px !important;
    line-height: 1.5 !important;
}

.msc-curriculum-text {
    display: block !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    word-break: keep-all !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
}

/* ─── 상세보기 버튼 (프리미엄) ─── */
.msc-detail-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #1A2A3A;
    background: #ffffff;
    border: 1.5px solid #1A2A3A;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    letter-spacing: -0.01em;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 광택 sweep 효과 */
.msc-detail-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -110%;
    width: 60%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.38), transparent);
    transform: skewX(-15deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

.msc-btn-text {
    position: relative;
    z-index: 1;
}

.msc-btn-arrow {
    position: relative;
    z-index: 1;
    font-size: 16px;
    line-height: 1;
    transition: transform 0.3s ease;
    display: inline-block;
}

.msc-detail-button:hover {
    background: #1A2A3A;
    color: #ffffff;
    border-color: #1A2A3A;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 42, 58, 0.22), 0 2px 8px rgba(26, 42, 58, 0.10);
}

.msc-detail-button:hover::before {
    left: 150%;
}

.msc-detail-button:hover .msc-btn-arrow {
    transform: translateX(4px);
}

.msc-detail-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(26, 42, 58, 0.16);
}

/* 버튼 있을 때 article 외곽 유지 */
.msc-grid-item:has(.msc-detail-button) {
    border-radius: 12px;
    overflow: hidden;
}

/* ─── 필터 검색창 (프리미엄) ─── */
.msc-filter-search-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    background: #f4f5f7;
    border-radius: 28px;
    border: 1.5px solid transparent;
    padding: 4px 6px 4px 16px;
    gap: 4px;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.msc-filter-search-wrap:focus-within {
    background: #ffffff;
    border-color: #d1d5db;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.msc-search-input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    padding: 7px 4px;
    font-size: 14px;
    color: #374151;
    width: 160px;
    min-width: 80px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.4;
}

.msc-search-input:focus {
    width: 210px;
}

.msc-search-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.msc-search-btn {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: #e5e7eb;
    color: #6b7280;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.msc-search-btn:hover {
    background: #374151;
    color: #ffffff;
    transform: scale(1.05);
}

.msc-search-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

@media (max-width: 640px) {
    .msc-filter-search-wrap {
        width: 100%;
        flex: 1 1 100%;
    }
    .msc-search-input {
        flex: 1;
        width: auto;
    }
    .msc-search-input:focus {
        width: auto;
    }
}

@media (max-width: 480px) {
    .msc-curriculum-wrap {
        padding: 15px;
    }

    .msc-curriculum-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 10px;
    }

    .msc-curriculum-row:last-child {
        margin-bottom: 0;
    }

    .msc-curriculum-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .msc-curriculum-text {
        font-size: 13px;
    }

    .msc-detail-button {
        font-size: 14px;
        padding: 14px 16px;
    }
}
