/**
 * 공통 모달 시스템 CSS
 * 전체 쇼핑몰 공통 (NAPLE, ADPRINT, PLABER)
 */

/* 기본 모달 오버레이 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-overlay.active {
    display: block;
}

/* 기본 모달 컨테이너 */
.modal-container {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

.modal-container.active {
    display: block;
}

/* 모달 헤더 */
.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 40px;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 300;
}

.modal-close:hover {
    color: #eeeeee;
    opacity: 0.8;
}

/* 모달 본문 */
.modal-body {
    padding: 20px;
}

/* 모달 푸터 */
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 기존 naple_modal 클래스와의 호환성 */
.naple_modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.naple_modal.active {
    display: flex;
}

.naple_modal_content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

/* 관리자 페이지 전용 모달 */
.admin-modal {
    background-color: white;
    border-radius: 4px;
    padding: 0;
}

.admin-modal .modal-header {
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.admin-modal .modal-footer {
    background-color: #f9f9f9;
}

/* ============================================
   NapleModal 시스템 얼럿 (modal-alert.js)
   z-index: 9999 (최상위)
   ============================================ */

/* NapleModal 최상위 컨테이너 */
.naple-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important; /* 최상위 - 로그인 모달(5000)보다 높음 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.naple-modal.show {
    opacity: 1;
    visibility: visible;
}

.naple-modal.hide {
    opacity: 0;
    visibility: hidden;
}

/* NapleModal 배경 */
.naple-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    z-index: 4999 !important; /* 로그인 모달(5000)보다 낮게, 챗봇(3999)보다 높게 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.naple-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.naple-modal-backdrop.hide {
    opacity: 0;
    visibility: hidden;
}

/* NapleModal 대화상자 */
.naple-modal-dialog {
    position: relative;
    z-index: 1;
    max-width: 500px;
    width: 90%;
    animation: modalSlideDown 0.3s ease;
}

@keyframes modalSlideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* NapleModal 컨텐츠 */
.naple-modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* NapleModal 헤더 */
.naple-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.naple-modal-icon {
    font-size: 24px;
}

.naple-modal-title {
    flex: 1;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.naple-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.2s;
}

.naple-modal-close:hover {
    color: #666;
}

/* NapleModal 본문 */
.naple-modal-body {
    padding: 20px;
}

.naple-modal-message {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* NapleModal 푸터 */
.naple-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* NapleModal 버튼 */
.naple-modal-button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.naple-modal-button-primary {
    background-color: #007bff;
    color: white;
}

.naple-modal-button-primary:hover {
    background-color: #0056b3;
}

.naple-modal-button-secondary {
    background-color: #6c757d;
    color: white;
}

.naple-modal-button-secondary:hover {
    background-color: #545b62;
}

.naple-modal-button-default {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.naple-modal-button-default:hover {
    background-color: #e9ecef;
}

/* 타입별 모달 테두리 색상 (현재 사용 안 함 - 깨끗한 흰색으로 통일) */
/*
.naple-modal-success .naple-modal-header {
    border-left: 4px solid #28a745;
}

.naple-modal-warning .naple-modal-header {
    border-left: 4px solid #ffc107;
}

.naple-modal-error .naple-modal-header {
    border-left: 4px solid #dc3545;
}

.naple-modal-info .naple-modal-header {
    border-left: 4px solid #17a2b8;
}
*/
