/* ==========================================================================
   수강신청 상세 (Register Detail) V3 Styles
   ========================================================================== */

/* ================================================
   1. 메인 레이아웃
   ================================================ */

.register-detail {
    width: 100%;
    background: #F8F9FB;
    font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 32px 0;
}

.register-detail__section {
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ================================================
   2. 상단 영역 (비디오 + 과목정보)
   ================================================ */

.register-detail-hero {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 28px;
}

/* 비디오 영역 */
.register-detail-video {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #111827;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.register-detail-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.register-detail-video__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
}

.register-detail-video__placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 과목 정보 영역 */
.register-detail-info {
    display: flex;
    flex-direction: column;
}

/* 헤더 */
.register-detail-info__header {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.register-detail-info__top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.register-detail-info__badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.register-detail-info__title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.register-detail-info__subtitle {
    margin: 0;
    font-size: var(--edu-text-sm);
    font-weight: 500;
    color: #6B7280;
}

.register-detail-info__title {
    margin: 0;
    font-size: var(--edu-text-page-title);
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.register-detail-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
}

.register-detail-badge--recruiting {
    background: #E6F9F7;
    color: #009A87;
}

.register-detail-badge--closed {
    background: #F3F4F6;
    color: #6B7280;
}

.register-detail-badge--mobile {
    background: #EFF6FF;
    color: #1D4ED8;
}

/* 버튼 그룹 */
.register-detail-info__buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* 정보 테이블 - uses board.css .table-edu--info */
.register-detail-info__table-wrap {
    flex: 1;
}

/* 가격 정보 */
.register-detail-price__original {
    text-decoration: line-through;
    color: #9CA3AF;
}

.register-detail-price__sale {
    font-size: 18px;
    font-weight: 700;
    color: #DC2626;
}

/* 액션 버튼 */
.register-detail-info__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
}

/* ================================================
   3. 과목 정보 카드
   ================================================ */

.register-detail-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
}

.register-detail-card__header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.register-detail-card__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.register-detail-card__body {
    padding: 24px;
}

/* 과목 정보 섹션 */
.register-course-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.register-course-info__section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.register-course-info__label {
    font-size: 15px;
    font-weight: 600;
    color: #6B7280;
}

.register-course-info__text {
    margin: 0;
    font-size: 17px;
    line-height: 1.7;
    color: #374151;
    white-space: pre-line;
}

.register-course-info__note {
    margin: 8px 0 0;
    font-size: 15px;
    color: #6B7280;
}

.register-course-info__divider {
    height: 1px;
    background: #E5E7EB;
    margin: 0;
}

.register-course-info__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.register-course-info__col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.register-course-info__remark {
    text-align: center;
    padding: 30px 0;
    margin-top: 24px;
    border-top: 1px solid #E5E7EB;
}

/* 평가 기준 그리드 */
.register-eval-grid {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
}

.register-eval-grid__header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #F3F4F6;
}

.register-eval-grid--training .register-eval-grid__header {
    grid-template-columns: repeat(5, 1fr);
}

.register-eval-grid__header > div {
    padding: 8px 10px;
    font-size: 15px;
    font-weight: 600;
    color: #6B7280;
    text-align: center;
    border-right: 1px solid #E5E7EB;
}

.register-eval-grid__header > div:last-child {
    border-right: none;
}

.register-eval-grid__values {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid #E5E7EB;
}

.register-eval-grid--training .register-eval-grid__values {
    grid-template-columns: repeat(5, 1fr);
}

.register-eval-grid__values > div {
    padding: 8px 10px;
    font-size: 16px;
    color: #374151;
    text-align: center;
    border-right: 1px solid #E5E7EB;
}

.register-eval-grid__values > div:last-child {
    border-right: none;
}

/* 성적분포 태그 */
.register-grade-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.register-grade-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #F3F4F6;
    border-radius: 6px;
    font-size: 15px;
    color: #374151;
}

.register-grade-notes {
    margin: 12px 0 0;
    padding-left: 16px;
    list-style: disc;
}

.register-grade-notes li {
    font-size: var(--edu-text-sm);
    color: #6B7280;
    line-height: 1.5;
}

.register-grade-notes li + li {
    margin-top: 4px;
}

/* 교재 리스트 */
.register-textbooks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.register-textbook {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
}

.register-textbook__image {
    width: 80px;
    height: 104px;
    object-fit: cover;
    border-radius: 6px;
    background: #F3F4F6;
    flex-shrink: 0;
}

.register-textbook__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.register-textbook__type {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    width: fit-content;
}

.register-textbook__type--master {
    background: #E6F9F7;
    color: #009A87;
}

.register-textbook__type--sub {
    background: #EFF6FF;
    color: #1D4ED8;
}

.register-textbook__type--ref {
    background: #F3F4F6;
    color: #6B7280;
}

.register-textbook__title {
    margin: 4px 0 0;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.register-textbook__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 15px;
    color: #6B7280;
}

/* ================================================
   4. 수강 후기
   ================================================ */

.register-reviews {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
}

.register-reviews__header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.register-reviews__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.register-reviews__body {
    padding: 0;
}

.register-review-item {
    border-bottom: 1px solid #E5E7EB;
}

.register-review-item:last-child {
    border-bottom: none;
}

.register-review-item summary {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    list-style: none;
    gap: 16px;
    transition: background-color 0.15s;
}

.register-review-item summary::-webkit-details-marker {
    display: none;
}

.register-review-item summary:hover {
    background: #F9FAFB;
}

.register-review-item[open] summary {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.register-review-item__num {
    flex-shrink: 0;
    width: 24px;
    font-size: 15px;
    color: #9CA3AF;
    text-align: center;
}

.register-review-item__title {
    flex: 1;
    font-size: 17px;
    color: #111827;
    font-weight: 500;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.register-review-item__rating {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 120px;
    font-size: 15px;
    color: #6B7280;
}

.register-review-item__rating-bar {
    position: relative;
    width: 70px;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.register-review-item__rating-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #0073E6;
    border-radius: 4px;
    transition: width 0.2s;
}

.register-review-item__author {
    flex-shrink: 0;
    width: 60px;
    font-size: 15px;
    color: #6B7280;
}

.register-review-item__date {
    flex-shrink: 0;
    width: 90px;
    font-size: 15px;
    color: #9CA3AF;
}

.register-review-item__content {
    padding: 20px 24px 20px 64px;
    font-size: 16px;
    line-height: 1.7;
    color: #4B5563;
    background: #fff;
    white-space: pre-line;
}

/* 더보기 버튼 */
.register-reviews__more {
    display: flex;
    justify-content: center;
    padding: 20px 24px;
    border-top: 1px solid #E5E7EB;
}

/* 빈 상태 */
.register-reviews__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: #6B7280;
    font-size: 17px;
}

/* ================================================
   5. 접근성 및 숨김 처리
   ================================================ */

/* ico-smartlearning 숨기기 */
.register-detail .ico-smartlearning {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 테이블 캡션 숨기기 - uses board.css .table-edu--info caption */

/* ================================================
   6. 반응형
   ================================================ */

@media (max-width: 1024px) {
    .register-detail-info__top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .register-detail-info__buttons {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .register-detail {
        padding: 24px 0;
    }

    .register-detail__section {
        gap: 24px;
    }

    .register-detail-hero {
        padding: 20px;
        gap: 20px;
    }

    .register-detail-info__subtitle {
        font-size: var(--edu-text-xs);
    }

    .register-detail-info__title {
        font-size: var(--edu-text-card-title);
    }

    .register-detail-info__top-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .register-detail-info__actions {
        flex-direction: column;
    }

    .register-detail-info__actions .btn-edu {
        width: 100%;
    }

    .register-detail-card__header {
        padding: 16px 20px;
    }

    .register-detail-card__body {
        padding: 20px;
    }

    .register-course-info__row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .register-textbooks {
        grid-template-columns: 1fr;
    }

    .register-eval-grid__header,
    .register-eval-grid__values {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .register-eval-grid__header > div:nth-child(n+5),
    .register-eval-grid__values > div:nth-child(n+5) {
        display: none;
    }

    /* 리뷰 모바일 */
    .register-review-item summary {
        flex-wrap: wrap;
        padding: 14px 20px;
        gap: 8px;
    }

    .register-review-item__num {
        display: none;
    }

    .register-review-item__title {
        width: 100%;
        order: 1;
        margin-bottom: 4px;
        white-space: normal;
    }

    .register-review-item__rating {
        order: 2;
        width: auto;
    }

    .register-review-item__author {
        order: 3;
        width: auto;
    }

    .register-review-item__date {
        order: 4;
        width: auto;
        margin-left: auto;
    }

    .register-review-item__content {
        padding: 16px 20px;
    }

    .register-reviews__header {
        padding: 16px 20px;
    }

    .register-reviews__more {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .register-detail-info__buttons {
        flex-direction: column;
    }

    .register-detail-info__buttons .btn-edu {
        width: 100%;
    }

    .register-eval-grid__header,
    .register-eval-grid__values {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .register-eval-grid__header > div:nth-child(n+4),
    .register-eval-grid__values > div:nth-child(n+4) {
        display: none;
    }

    .register-grade-tags {
        flex-direction: column;
    }

    .register-textbook {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .register-textbook__info {
        align-items: center;
    }
}

/* ================================================
   7. 모달 스타일 (수업목차, 교수정보)
   ================================================ */

/* 모달 공통 - bootbox는 body에 직접 렌더링됨 */
.bootbox.modal {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-left: 0 !important;
}

.bootbox.modal > .empty-iframe {
    display: none !important;
}

/* popup 모달 전용 dialog 스타일 */
.bootbox:has(.modal-content.popup) .modal-dialog {
    position: relative !important;
    margin: 30px auto !important;
    max-width: none !important;
    width: auto !important;
    float: none !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

.bootbox .modal-content.popup {
    border-radius: 12px;
    overflow: hidden;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, sans-serif;
}

.bootbox .modal-content.popup .modal-header {
    padding: 20px 24px;
    background: #fff;
    border-bottom: 1px solid #E5E7EB;
}

.bootbox .modal-content.popup .modal-header .close {
    background: none;
    border: none;
    font-size: 24px;
    color: #8A8F99;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 1;
    text-shadow: none;
}

.bootbox .modal-content.popup .modal-header .close:hover {
    color: #1A1F29;
}

.bootbox .modal-content.popup .modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.bootbox .modal-content.popup .modal-body {
    padding: 24px;
    background: #fff;
    max-height: 70vh;
    overflow: auto;
}

.bootbox .modal-content.popup .modal-footer {
    padding: 16px 24px;
    background: #F9FAFB;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: center;
}

.bootbox .modal-content.popup .modal-footer button,
.bootbox .modal-content.popup .modal-footer [name=btnClose] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}

.bootbox .modal-content.popup .modal-footer button:hover,
.bootbox .modal-content.popup .modal-footer [name=btnClose]:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

/* 수업목차 모달 테이블 */
.bootbox .modal-content.popup table.table-1,
.bootbox .modal-content.popup .small table,
.bootbox .modal-content.popup .table table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 15px !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 8px !important;
}

.bootbox .modal-content.popup table caption {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.bootbox .modal-content.popup table.table-1 thead th,
.bootbox .modal-content.popup .small table thead th,
.bootbox .modal-content.popup .table table thead th {
    padding: 12px 10px !important;
    background: #F3F4F6 !important;
    color: #374151 !important;
    font-weight: 600 !important;
    text-align: center !important;
    border-bottom: 1px solid #E5E7EB !important;
    border-right: 1px solid #E5E7EB !important;
    font-size: 15px !important;
}

.bootbox .modal-content.popup table.table-1 thead th:last-child,
.bootbox .modal-content.popup .small table thead th:last-child,
.bootbox .modal-content.popup .table table thead th:last-child {
    border-right: none !important;
}

.bootbox .modal-content.popup table.table-1 tbody td,
.bootbox .modal-content.popup .small table tbody td,
.bootbox .modal-content.popup .table table tbody td {
    padding: 10px 8px !important;
    color: #374151 !important;
    text-align: center !important;
    border-bottom: 1px solid #E5E7EB !important;
    border-right: 1px solid #E5E7EB !important;
    font-size: 15px !important;
    vertical-align: middle !important;
    line-height: 1.5 !important;
    background: #fff !important;
}

.bootbox .modal-content.popup table.table-1 tbody td:last-child,
.bootbox .modal-content.popup .small table tbody td:last-child,
.bootbox .modal-content.popup .table table tbody td:last-child {
    border-right: none !important;
}

.bootbox .modal-content.popup table.table-1 tbody tr:last-child td,
.bootbox .modal-content.popup .small table tbody tr:last-child td,
.bootbox .modal-content.popup .table table tbody tr:last-child td {
    border-bottom: none !important;
}

.bootbox .modal-content.popup table.table-1 tbody td.aleft,
.bootbox .modal-content.popup .small table tbody td.aleft,
.bootbox .modal-content.popup .table table tbody td.aleft {
    text-align: left !important;
}

/* 교수정보 모달 */
.bootbox .modal-content.popup .professor-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
}

.bootbox .modal-content.popup .professor-wrap .title-conts {
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid #E5E7EB !important;
}

.bootbox .modal-content.popup .professor-wrap > .table {
    border: 1px solid #E5E7EB !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.bootbox .modal-content.popup .professor-wrap > .table table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: none !important;
    border-radius: 0 !important;
}

.bootbox .modal-content.popup .professor-wrap > .table th {
    padding: 14px 16px !important;
    background: #F9FAFB !important;
    color: #6B7280 !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    text-align: left !important;
    border-bottom: 1px solid #E5E7EB !important;
    border-right: 1px solid #E5E7EB !important;
    vertical-align: top !important;
    width: 100px !important;
}

.bootbox .modal-content.popup .professor-wrap > .table td {
    padding: 14px 16px !important;
    color: #374151 !important;
    font-size: 16px !important;
    line-height: 1.7 !important;
    border-bottom: 1px solid #E5E7EB !important;
    background: #fff !important;
}

.bootbox .modal-content.popup .professor-wrap > .table tr:last-child th,
.bootbox .modal-content.popup .professor-wrap > .table tr:last-child td {
    border-bottom: none !important;
}

.bootbox .modal-content.popup .professor-wrap > .table ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.bootbox .modal-content.popup .professor-wrap > .table li {
    line-height: 1.7 !important;
}

/* 모달 스크롤바 스타일 */
.bootbox .modal-content.popup .modal-body::-webkit-scrollbar {
    width: 6px;
}

.bootbox .modal-content.popup .modal-body::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 3px;
}

.bootbox .modal-content.popup .modal-body::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.bootbox .modal-content.popup .modal-body::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* 모달 반응형 */
@media (max-width: 768px) {
    .bootbox .modal-content.popup {
        width: 95% !important;
        margin: 20px auto;
    }

    .bootbox .modal-content.popup .modal-header {
        padding: 16px 20px !important;
    }

    .bootbox .modal-content.popup .modal-body {
        padding: 20px !important;
    }

    .bootbox .modal-content.popup .modal-footer {
        padding: 12px 20px !important;
    }

    .bootbox .modal-content.popup table.table-1,
    .bootbox .modal-content.popup .small table {
        font-size: 16px !important;
    }

    .bootbox .modal-content.popup table.table-1 thead th,
    .bootbox .modal-content.popup table.table-1 tbody td,
    .bootbox .modal-content.popup .small table thead th,
    .bootbox .modal-content.popup .small table tbody td {
        padding: 8px 6px !important;
    }

    .bootbox .modal-content.popup .professor-wrap > .table th,
    .bootbox .modal-content.popup .professor-wrap > .table td {
        padding: 12px !important;
    }
}
