/**
 * Theme Alert Styles
 * 테마 알림 스타일 - 여러 컴포넌트에서 공통으로 사용하는 알림 스타일
 */

/* ===========================================
   알림 색상 변수 (테마 공통)
   =========================================== */

:root {
    /* 알림 색상 변수 */
    --theme-alert-info-bg: #e8f4f8;
    --theme-alert-info-text: #408090;
    --theme-alert-info-border: #b8e6f1;

    --theme-alert-warning-bg: #fef3cd;
    --theme-alert-warning-text: #856404;
    --theme-alert-warning-border: #ffeaa7;

    --theme-alert-danger-bg: #f8d7da;
    --theme-alert-danger-text: #721c24;
    --theme-alert-danger-border: #f5c6cb;

    --theme-alert-success-bg: #d4edda;
    --theme-alert-success-text: #155724;
    --theme-alert-success-border: #c3e6cb;

    --theme-alert-primary-bg: #d1ecf1;
    --theme-alert-primary-text: #0c5460;
    --theme-alert-primary-border: #bee5eb;

    --theme-alert-secondary-bg: #e2e3e5;
    --theme-alert-secondary-text: #383d41;
    --theme-alert-secondary-border: #d6d8db;

    /* radius 변수 */
    --theme-alert-radius: 4px;

    /* 토스트 아이콘 색상 변수 */
    --theme-toast-success-icon: #28a745;
    --theme-toast-error-icon: #dc3545;
    --theme-toast-warning-icon: #ffc107;
}

/* ===========================================
   기본 알림 스타일 (테마 공통)
   =========================================== */

.alert {
    padding: 1rem;
    border-radius: var(--theme-alert-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-family: var(--theme-font-normal);
    font-size: var(--theme-font-size-body);
    line-height: 1.5;
    visibility: visible;
    border: 1px solid;
    transition: all 0.2s ease;
}

.alert .fa,
.alert .fas,
.alert .far,
.alert .fal,
.alert .fad,
.alert .fab {
    margin-top: 5px;
}

/* ===========================================
   알림 타입별 스타일 (테마 공통)
   =========================================== */

/* 정보 알림 */
.alert-info {
    background: var(--theme-alert-info-bg);
    color: var(--theme-alert-info-text);
    border-color: var(--theme-alert-info-border);
}

/* 경고 알림 */
.alert-warning {
    background: var(--theme-alert-warning-bg);
    color: var(--theme-alert-warning-text);
    border-color: var(--theme-alert-warning-border);
}

/* 위험 알림 */
.alert-danger {
    background: var(--theme-alert-danger-bg);
    color: var(--theme-alert-danger-text);
    border-color: var(--theme-alert-danger-border);
}

/* 성공 알림 */
.alert-success {
    background: var(--theme-alert-success-bg);
    color: var(--theme-alert-success-text);
    border-color: var(--theme-alert-success-border);
}

/* 주요 알림 */
.alert-primary {
    background: var(--theme-alert-primary-bg);
    color: var(--theme-alert-primary-text);
    border-color: var(--theme-alert-primary-border);
}

/* 보조 알림 */
.alert-secondary {
    background: var(--theme-alert-secondary-bg);
    color: var(--theme-alert-secondary-text);
    border-color: var(--theme-alert-secondary-border);
}

/* ===========================================
   알림 변형 스타일 (테마 공통)
   =========================================== */

/* 중앙 정렬 알림 */
.alert-center {
    justify-content: center;
    text-align: center;
}

/* 큰 알림 */
.alert-lg {
    padding: 1.25rem;
    font-size: var(--theme-font-size-input);
}

/* 작은 알림 */
.alert-sm {
    padding: 0.75rem;
    font-size: var(--theme-font-size-small);
}

/* 강조 알림 */
.alert-highlight {
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 간단한 알림 */
.alert-simple {
    justify-content: center;
}

/* 숨김 상태 */
.alert-hidden {
    display: none !important;
}

/* ===========================================
   문구 여백
   =========================================== */
.alert p {
    margin: 0;
}


/* ===========================================
   접근성 개선 (테마 공통)
   =========================================== */

.alert:focus {
    outline: 2px solid var(--theme-main-color);
    outline-offset: 2px;
}


/* ===========================================
   모달 알럿
   =========================================== */

.modal-alert-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--theme-modal-bg-light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'S-CoreDream-3', sans-serif;
}

/* Date Picker Backdrop - 캘린더 전용 */
.modal-alert-container.kaice-date-backdrop {
    z-index: 9998 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: block !important;
}

.modal-alert-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-alert-title {
    font-size: 20px;
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 15px;
    color: #333;
    font-family: 'S-CoreDream-3', sans-serif;
}

.modal-alert-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
    font-family: 'S-CoreDream-3', sans-serif;
}

/* 버튼 스타일은 button-styles.css의 .btn.btn-primary 사용 */

/* 반응형 디자인 */
@media (max-width: 480px) {
    .modal-alert-box {
        padding: 20px;
        margin: 20px;
    }
    
    .modal-alert-icon {
        font-size: 40px;
        margin-bottom: 15px;
    }
    
    .modal-alert-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .modal-alert-message {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .modal-alert-button {
        padding: 10px 25px;
        font-size: 14px;
    }
}

/* 애니메이션 효과 */
.modal-alert-container {
    animation: modalAlertFadeIn 0.3s ease-out;
}

.modal-alert-box {
    animation: modalAlertSlideIn 0.3s ease-out;
}

@keyframes modalAlertFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* ===========================================
   Confirm 모달 버튼 그룹
   =========================================== */

.modal-alert-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-alert-buttons .btn {
    min-width: 100px;
}

/* ===========================================
   kaice-oes 네임스페이스 호환 (exam 플러그인)
   =========================================== */

.kaice-oes.alert {
    padding: 1rem;
    border-radius: var(--theme-alert-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-family: var(--theme-font-normal);
    font-size: var(--theme-font-size-body);
    line-height: 1.5;
    visibility: visible;
    border: 1px solid;
    transition: all 0.2s ease;
}

.kaice-oes.alert-info {
    background: var(--theme-alert-info-bg);
    color: var(--theme-alert-info-text);
    border-color: var(--theme-alert-info-border);
}

.kaice-oes.alert-warning {
    background: var(--theme-alert-warning-bg);
    color: var(--theme-alert-warning-text);
    border-color: var(--theme-alert-warning-border);
}

.kaice-oes.alert-danger {
    background: var(--theme-alert-danger-bg);
    color: var(--theme-alert-danger-text);
    border-color: var(--theme-alert-danger-border);
}

.kaice-oes.alert-success {
    background: var(--theme-alert-success-bg);
    color: var(--theme-alert-success-text);
    border-color: var(--theme-alert-success-border);
}

/* ===========================================
   토스트 메시지 스타일 (글래스모피즘)
   =========================================== */

/* 토스트 컨테이너 */
#kaice-toast-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999999;
    width: 100%;
    max-width: 480px;
    pointer-events: none;
}

/* 토스트 메시지 - 글래스모피즘 스타일 */
.kaice-toast {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 32px;
    border-radius: 16px;
    font-size: 15px;
    font-family: var(--theme-font-normal, 'S-CoreDream-4', sans-serif);
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: auto;
    text-align: center;
    visibility: hidden;
    min-height: 60px;
}

/* 토스트 메시지 텍스트 */
.kaice-toast-message {
    white-space: pre-line;
    line-height: 1.5;
}

/* 글래스모피즘 배경 */
.kaice-toast::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    z-index: -1;
}

.kaice-toast.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* 토스트 아이콘 */
.kaice-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kaice-toast-icon i {
    font-size: 14px;
}

/* 공통 배경 - 투명한 연회색 */
.kaice-toast::before {
    background-color: rgba(240, 240, 240, 0.7);
}

/* 성공 토스트 */
.kaice-toast-success {
    color: var(--theme-alert-success-text);
}

.kaice-toast-success .kaice-toast-icon {
    background-color: var(--theme-toast-success-icon);
    color: #ffffff;
}

/* 에러 토스트 */
.kaice-toast-error {
    color: var(--theme-alert-danger-text);
}

.kaice-toast-error .kaice-toast-icon {
    background-color: var(--theme-toast-error-icon);
    color: #ffffff;
}

/* 정보 토스트 */
.kaice-toast-info {
    color: var(--theme-alert-primary-text);
}

.kaice-toast-info .kaice-toast-icon {
    background-color: var(--theme-main-color, #408090);
    color: #ffffff;
}

/* 경고 토스트 */
.kaice-toast-warning {
    color: var(--theme-alert-warning-text);
}

.kaice-toast-warning .kaice-toast-icon {
    background-color: var(--theme-toast-warning-icon);
    color: #212529;
}

/* 반응형 토스트 */
@media (max-width: 520px) {
    #kaice-toast-container {
        bottom: 16px;
        left: 16px;
        right: 16px;
        max-width: none;
        transform: none;
    }

    .kaice-toast {
        padding: 16px 24px;
        font-size: 14px;
        min-height: 52px;
        border-radius: 12px;
    }

    .kaice-toast-icon {
        width: 24px;
        height: 24px;
    }

    .kaice-toast-icon i {
        font-size: 12px;
    }
}