/**
 * ENM Modal System - 공통 모달/알림 스타일
 * enmAlert, enmConfirm, enmNotice, enmToast
 */

/* ================================
   공통 변수
   ================================ */
:root {
    --enm-overlay-bg: rgba(0, 0, 0, 0.5);
    --enm-modal-bg: #ffffff;
    --enm-modal-radius: 10rem;
    --enm-modal-shadow: 0 0 15rem rgba(0, 0, 0, 0.2);
    --enm-btn-primary: #333333;
    --enm-btn-secondary: #888888;
    --enm-btn-radius: 5rem;
    --enm-text-color: #333333;
    --enm-toast-success: #28a745;
    --enm-toast-error: #dc3545;
    --enm-toast-warning: #ffc107;
    --enm-toast-info: #17a2b8;
}

/* ================================
   중앙 모달 (Alert, Confirm)
   ================================ */
.enm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--enm-overlay-bg);
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.enm-modal-overlay.enm-active {
    display: flex;
}

.enm-modal-content {
    background: var(--enm-modal-bg);
    padding: 30rem 40rem;
    border-radius: var(--enm-modal-radius);
    text-align: center;
    box-shadow: var(--enm-modal-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: enmModalFadeIn 0.2s ease-out;
}

@keyframes enmModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.enm-modal-logo {
    margin-bottom: 25rem;
}

.enm-modal-logo img {
    width: 200px;
    height: auto;
}

.enm-modal-message {
    font-size: 16rem;
    font-weight: 400;
    color: var(--enm-text-color);
    line-height: 1.5em;
    word-break: keep-all;
    margin: 0;
    white-space: pre-wrap;
}

.enm-modal-input {
    display: block;
    width: 300rem !important;
    max-width: 300rem !important;
    margin: 15rem auto 0;
    padding: 10rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14rem;
}

.enm-modal-buttons {
    margin-top: 20rem;
    display: flex;
    gap: 10rem;
}

.enm-modal-btn {
    padding: 8rem 20rem;
    border: none;
    border-radius: var(--enm-btn-radius);
    font-size: 15rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.enm-modal-btn:hover {
    opacity: 0.85;
}

.enm-modal-btn-confirm {
    background: var(--enm-btn-primary);
    color: #ffffff;
}

.enm-modal-btn-cancel {
    background: var(--enm-btn-secondary);
    color: #ffffff;
}

/* ================================
   토스트/알림 컨테이너
   ================================ */
.enm-toast-container {
    position: fixed;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    gap: 10rem;
    pointer-events: none;
}

/* 우측 상단 (Notice) */
.enm-toast-container.enm-top-right {
    top: 20rem;
    right: 20rem;
}

/* 우측 하단 (Toast) */
.enm-toast-container.enm-bottom-right {
    bottom: 20rem;
    right: 20rem;
}

/* ================================
   토스트 아이템
   ================================ */
.enm-toast-item {
    background: var(--enm-modal-bg);
    padding: 15rem 20rem;
    border-radius: 8rem;
    box-shadow: 0 4rem 12rem rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12rem;
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: enmToastSlideIn 0.3s ease-out;
    border-left: 4rem solid var(--enm-toast-info);
}

.enm-toast-item.enm-success {
    border-left-color: var(--enm-toast-success);
}

.enm-toast-item.enm-error {
    border-left-color: var(--enm-toast-error);
}

.enm-toast-item.enm-warning {
    border-left-color: var(--enm-toast-warning);
}

.enm-toast-item.enm-info {
    border-left-color: var(--enm-toast-info);
}

@keyframes enmToastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes enmToastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.enm-toast-item.enm-hiding {
    animation: enmToastSlideOut 0.3s ease-in forwards;
}

.enm-toast-icon {
    width: 24rem;
    height: 24rem;
    flex-shrink: 0;
}

.enm-toast-icon svg {
    width: 100%;
    height: 100%;
}

.enm-toast-title {
    font-size: 16rem;
    font-weight: 600;
    color: var(--enm-text-color);
    line-height: 1.4;
    word-break: keep-all;
}

.enm-toast-message {
    flex: 1;
    font-size: 14rem;
    color: var(--enm-text-color);
    line-height: 1.4;
    word-break: keep-all;
}

.enm-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.enm-toast-close:hover {
    opacity: 1;
}

.enm-toast-close svg {
    width: 16rem;
    height: 16rem;
}

/* ================================
   진행 바 (자동 닫힘 표시)
   ================================ */
.enm-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0 8rem;
}

.enm-toast-item {
    position: relative;
    overflow: hidden;
}

/* ================================
   로딩 오버레이 (Loading)
   ================================ */
#enmLoadingOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--enm-overlay-bg);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

#enmLoadingOverlay.enm-active {
    display: flex;
}

.enm-loading-content {
    background: var(--enm-modal-bg);
    padding: 30rem;
    border-radius: 8rem;
    text-align: center;
    box-shadow: 0 4rem 15rem rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: enmModalFadeIn 0.2s ease-out;
    max-width: 90%;
}

.enm-loading-logo {
    margin-bottom: 25rem;
}

.enm-loading-logo img {
    width: 200px;
    height: auto;
}

.enm-loading-icon {
    margin-bottom: 20rem;
}

.enm-loading-icon svg {
    animation: enmLoadingSpin 1s linear infinite;
}

.enm-loading-message {
    /* font-weight: 500; */
    color: var(--enm-text-color);
    font-size: 15rem;
    margin: 0;
    line-height: 1.5;
}

.enm-loading-subtext {
    font-size: 14rem;
    color: #666666;
    display: block;
    margin-top: 5rem;
}

@keyframes enmLoadingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ================================
   반응형
   ================================ */
@media all and (max-width: 480px) {
    .enm-modal-content {
        padding: 20rem 15rem;
        margin: 0 15rem;
        max-width: 60%;
    }

    .enm-modal-logo img,
    .enm-loading-logo img {
        width: 150px;
    }

    .enm-modal-message {
        font-size: 15rem;
    }

    .enm-modal-btn {
        font-size: 14rem;
        padding: 8rem 16rem;
    }

    .enm-toast-container.enm-top-right,
    .enm-toast-container.enm-bottom-right {
        left: 10rem;
        right: 10rem;
    }

    .enm-toast-item {
        min-width: auto;
        max-width: none;
    }
	.enm-loading-logo{margin-bottom:15rem;}
	.enm-loading-icon{margin-bottom:7rem;}
	.enm-loading-message{font-size:12rem;}
	.enm-loading-subtext{font-size:11rem; margin-top:0;}
}