/**
 * ENM 프리미엄 컴포넌트 모달
 * 데이터 리스트, 폼 및 기타 복합 콘텐츠를 모달에서 사용할 때 사용.
 * 강의 목록 페이지의 수강관리, 수강생 수 디자인을 하다가 문득 영감을 받아 제작.
 * 
 * @author Seonghwan <godols@godols.com>
 * @link https://godols.com
 * @version 1.0
 * @since 2002.11.06
 *
 * <!-- 주의 사항 -->
 * 가급적 enm-modal.css 로드 후 사용되도록 순서를 지켜주기 바람.
 * 의존성은 없지만 모양새가 빠짐.
 *
 */

:root {
    --modal-primary: #0076fd;
    --modal-primary-dark: #0056b3;
    --modal-bg: #ffffff;
    --modal-body-bg: #f8f9fc;
    --modal-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.4);
    --modal-header-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 기본 모달 래퍼 */
.enm-component-modal { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    z-index: 1000; 
    align-items: center; 
    justify-content: center; 
}

/* 블러 효과가 적용된 오버레이 */
.enm-component-modal .modal-overlay { 
    position: absolute; 
    width: 100%; height: 100%; 
    backdrop-filter: blur(8px); 
    background: rgba(20, 20, 30, 0.7); 
    transition: all 0.3s;
}

/* 모달 컨테이너 */
.enm-component-modal .modal-container { 
    position: relative;
    width: 850px; 
    max-width: 95%; 
    height: auto; 
    max-height: 85vh;
    border-radius:15px; 
    box-shadow: var(--modal-shadow); 
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 헤더 */
.enm-component-modal .modal-header {
    background: linear-gradient(135deg, var(--modal-primary) 0%, var(--modal-primary-dark) 100%);
    color: white;
    padding: 15px 25px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--modal-header-shadow);
    z-index: 100;
}

.enm-component-modal .modal-title {
    font-weight: 700;
    font-size: 20px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: -0.5px;
    margin: 0;
}

.enm-component-modal .modal-title .modal-subtitle {
    font-weight: 400;
    opacity: 0.8;
    margin-left: 5px;
    font-size: 16px;
}

.enm-component-modal .modal-close {
    background: rgba(255,255,255,0.1) !important;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    color: white !important;
    font-size: 24px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    line-height: 1;
}

.enm-component-modal .modal-close:hover { 
    background: rgba(255,255,255,0.25) !important; 
    transform: rotate(90deg);
}

/* 바디 */
.enm-component-modal .modal-body {
    padding: 25px;
    background: var(--modal-body-bg);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    /* overflow: hidden; */
    overflow-y: auto;
}

/* 모달 내 리스트 래퍼 */
.enm-component-modal .modal-list-wrap { 
    border: none; 
    border-radius: 10px;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.03);
    background: white;
    flex: 1;
    min-height:400px;
}
.enm-component-modal .modal-list-wrap::-webkit-scrollbar{width:7px;}


.enm-component-modal .table-list {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0; 
}

.enm-component-modal .table-list thead th { 
    position: sticky; top: 0; 
    background: #fff; 
    z-index: 10; 
    border-bottom: 2px solid #e3e6f0; 
    padding: 15px 12px;
    color: #858796;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.05em;
}

.enm-component-modal .table-list td { 
    padding: 15px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f2f8; 
    color: #5a5c69;
    font-size: 14px;
    transition: background 0.2s;
}

.enm-component-modal .table-list tr:hover td { background: #f4f6fd; }

/* 테이블 내부 프로그레스 바 */
.enm-component-modal .pg-bar__wrap {
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
}
.enm-component-modal .pg-bar-bg {
    width: 100px; 
	height: 8px; 
    background: #eaecf4; 
    border-radius: 20px; 
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.enm-component-modal .pg-bar-fill {
    height: 100%; 
    background: linear-gradient(90deg, var(--modal-primary) 0%, #00c6ff 100%);
    border-radius: 20px;
    position: relative;
}

.enm-component-modal .pg-bar-fill::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg) translateX(-150%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: skewX(-20deg) translateX(-150%); }
    100% { transform: skewX(-20deg) translateX(250%); }
}

/* 모달 내 페이지네이션 */
.enm-component-modal .pagination { margin-top: 20px; margin-bottom: 20px; justify-content: center; gap: 10px; display: flex; }
.enm-component-modal .pagination a { 
    display: inline-flex; justify-content: center; align-items: center;
    width: 32px; height: 32px; 
    border: none; border-radius: 50%; 
    text-decoration: none; color: #5a5c69; 
    font-size: 13px; font-weight: 600;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.enm-component-modal .pagination a.active { 
    background: var(--modal-primary); color: #fff; 
    box-shadow: 0 4px 10px rgba(0, 118, 253, 0.4); 
    transform: scale(1.1);
}
.enm-component-modal .pagination a:hover:not(.active) { 
    background: #eaecf4; color: #333; transform: translateY(-2px);
}
