/* eMediKey 모바일 공통 스타일 */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile App Container */
.mobile-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background1:linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    background: #fcfcfc;
    background1: #f8f9fa;
    background1: #e8f4ff;
}

.no-show {
  display: none !important;
}
/* 상단 헤더 */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.header-btn {
    width: 84px;
    height: 44px;
    border: none;
    background: none;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-touch-callout: none;
    user-select: none;
}

.header-btn:hover,
.header-btn:active {
    background: rgba(255,255,255,0.2);
    transform: scale(0.95);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    flex: 1;
    margin: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: emoji;
}

.back-btn {
    margin-bottom: 5px;
    font-size: 25px;
}

.back-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 메인 콘텐츠 */
.main-content {
    flex: 1;
    margin-top: 60px;
    margin-bottom: 80px;
    padding: 20px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 홈 화면 콘텐츠 */
.welcome-section {
    text-align: center;
    padding: 20px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.app-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.welcome-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
}

.welcome-section p {
    color: #000;
    font-size: 16px;
}

/* 빠른 작업 그리드 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.action-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #eaeaea;
}

.action-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}

.action-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.action-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.action-card p {
  display: none;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

/* 응급연락처 */
.emergency-contact {
    margin-bottom: 24px;
}

.emergency-card {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(255,107,107,0.3);
}

.emergency-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.emergency-numbers {
    display: flex;
    gap: 12px;
}

.emergency-btn {
    flex: 1;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 16px 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.emergency-btn:active {
    background: rgba(255,255,255,0.3);
    transform: scale(0.98);
}

/* 하단 탭 네비게이션 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: white;
    display: flex;
    border-top: 1px solid #f1f3f4;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    border: none;
    background: none;
    padding: 8px 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #6c757d;
    text-decoration: none;
}

.nav-item.active {
    color: #667eea;
}

.nav-item:active {
    transform: scale(0.95);
    background: rgba(102, 126, 234, 0.05);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    display: block;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}

/* 햄버거 메뉴 */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}

.menu-overlay.show .menu-content {
    transform: translateX(0);
}

.menu-header {
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.menu-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-close:hover {
    background: rgba(255,255,255,0.2);
}

/* 메뉴 사용자 정보 */
.menu-user-info {
    padding: 20px;
    border-bottom: 1px solid #f1f3f4;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    margin: 10px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.user-email {
    font-size: 13px;
    color: #6c757d;
}

/* 메뉴 아이템 */
.menu-items {
    padding: 8px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    color: #2c3e50;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.menu-item:hover,
.menu-item:active {
    background: #f8f9fa;
}

.menu-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.menu-divider {
    height: 1px;
    background: #f1f3f4;
    margin: 8px 20px;
}

.auth-item {
    color: #667eea;
    font-weight: 600;
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    font-weight: 500;
}

/* 토스트 알림 */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0; /* margin 제거 */
    padding: 15px 20px;
    background: rgb(255 239 45);
    color: #333333;
    font-weight: 500;
    border-radius: 6px;
    box-shadow: rgba(0, 0, 0, 0.15) 0px 4px 12px;
    z-index: 10001;
    pointer-events: none;
    white-space: nowrap; /* 텍스트가 길어도 한 줄 유지 (선택) */
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0; /* margin 제거 */
  padding: 15px 30px;
  background: rgb(255 246 178);
  color: #333333;
  font-weight: 500;
  border:solid 0.5px #8d8d8d;
  border-radius: 16px;
  box-shadow: rgba(0, 0, 0, 0.15) 0px 4px 12px;
  z-index: 10001;
  pointer-events: none;
  white-space: nowrap; /* 텍스트가 길어도 한 줄 유지 (선택) */
}

.toast.success {
    background: rgba(40, 167, 69, 0.9);
}

.toast.error {
    background: rgba(220, 53, 69, 0.9);
}

.toast.warning {
    background: rgba(255, 193, 7, 0.9);
    color: #333;
}

@keyframes toastIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 폼 스타일 */
.form-container {
    padding: 20px 16px;
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.form-label .required {
    color: #dc3545;
}

.form-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #f8f9fa;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.form-input.success {
    border-color: #28a745;
    background: #f8fff9;
}

.form-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

.form-success {
    color: #28a745;
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

.form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    background: #f8f9fa;
    -webkit-appearance: none;
}

.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    background: #f8f9fa;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 체크박스 */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.checkbox-input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label {
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    cursor: pointer;
}

.checkbox-label strong {
    color: #2c3e50;
    font-weight: 600;
}

.checkbox-label small {
    color: #6c757d;
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

/* 버튼 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 48px;
    -webkit-touch-callout: none;
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: #007AFF;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #9765ca;
  color: #fff;
  border: solid 0.9px #6b6b6b;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}



/* ✅ PNG 이미지 아이콘 스타일 */
.nav-icon-img {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
    display: block;
    opacity: 0.5; /* 비활성 상태 */
    transition: all 0.2s ease;
    filter: grayscale(100%); /* 회색 처리 */
}

/* active 상태일 때 */
.nav-item.active .nav-icon-img {
    opacity: 1;
    filter: grayscale(0%) brightness(1.1);
    /* 또는 색상 필터 적용 */
    /* filter: brightness(0) saturate(100%) invert(47%) sepia(89%) saturate(1345%) hue-rotate(219deg) brightness(98%) contrast(92%); */
}

/* 호버/액티브 효과 */
.nav-item:active .nav-icon-img {
    transform: scale(0.9);
}

/* 기존 .nav-icon 스타일 (이모지용) - 필요 없으면 제거 */
.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    display: block;
}

/* 카드 */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #f1f3f4;
    margin-bottom: 16px;
}

.card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f3f4;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.card-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin: 4px 0 0 0;
}

/* 유틸리티 클래스 */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-10 { margin-bottom: 10px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-10 { margin-top: 10px !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }

.fs-10 { font-size: 10px !important; }
.fs-11 { font-size: 11px !important; }
.fs-12 { font-size: 12px !important; }
.fs-13 { font-size: 13px !important; }
.fs-14 { font-size: 14px !important; }
.fs-15 { font-size: 15px !important; }
.fs-20 { font-size: 20px !important; }
.fs-25 { font-size: 25px !important; }
.fs-30 { font-size: 30px !important; }
.fs-40 { font-size: 40px !important; }

/* 반응형 디자인 */
@media (max-width: 375px) {
    .main-content {
        padding: 16px 12px;
    }

    .quick-actions {
        grid-template-columns1: 2fr;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .emergency-numbers {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-height: 667px) {
    .welcome-section {
        padding: 30px 20px;
    }

    .app-icon {
        font-size: 48px;
        margin-bottom: 12px;
    }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark1) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }

    .welcome-section,
    .action-card,
    .card,
    .bottom-nav,
    .menu-content {
        background: #2d2d2d;
        border-color: #404040;
    }

    .form-input,
    .form-textarea,
    .form-select {
        background: #404040;
        border-color: #555;
        color: white;
    }

    .form-input:focus,
    .form-textarea:focus,
    .form-select:focus {
        background: #2d2d2d;
    }
}

/* iOS 안전 영역 대응 */
@supports (padding: max(0px)) {
    .app-header {
        padding-top: max(env(safe-area-inset-top), 0px);
        height: calc(60px + max(env(safe-area-inset-top), 0px));
    }

    .main-content {
        margin-top: calc(60px + max(env(safe-area-inset-top), 0px));
        margin-bottom: calc(60px + max(env(safe-area-inset-bottom), 0px));
    }

    .bottom-nav {
        padding-bottom: max(env(safe-area-inset-bottom), 0px);
        height: calc(60px + max(env(safe-area-inset-bottom), 0px));
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 포커스 표시 개선 */
.header-btn:focus-visible,
.nav-item:focus-visible,
.btn:focus-visible,
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ========================================
   모달 및 오버레이 스타일 (admin.css, appComm.css 등 참조)
   ======================================== */

/* 1. 모달 오버레이 (전체 화면 배경) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* 어두운 배경 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* 다른 요소 위에 표시 */
    transition: opacity 0.3s ease;
}

/* 숨김 상태 */
.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

/* 2. 모달 컨텐츠 래퍼 */
.modal-content-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 95%; /* 모바일 화면 최적화 */
    max-width: 600px; /* 데스크톱 최대 너비 */
    max-height: 90vh; /* 화면 높이를 초과하지 않도록 제한 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

/* 모달이 활성화될 때 애니메이션 */
.modal-overlay:not(.hidden) .modal-content-wrapper {
    transform: scale(1);
}

/* 3. 모달 헤더 */
.modal-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    background: #f7f7f7;
}

.modal-header .modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.modal-header .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
}

/* 4. 모달 본문 */
.modal-body {
    padding: 20px;
    overflow-y: auto; /* 내용이 길면 스크롤 가능 */
    flex-grow: 1; /* 남은 공간을 차지 */
    line-height: 1.6;
    color: #555;
    font-size: 0.95rem;
}

/* AppUtils.showConfirm을 위한 스타일 */
.modal-body.confirm-message {
    text-align: center;
    padding: 30px 20px;
    font-size: 1.1rem;
    font-weight: 500;
}


/* 5. 모달 푸터 (버튼 영역) */
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end; /* 버튼을 오른쪽으로 정렬 */
    gap: 10px;
}

/* 6. 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* 반투명 흰색 배경 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1001; /* 모달보다 위에 표시 */
}

.loading-spinner {
    padding: 20px 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    font-weight: 500;
    color: #007bff;
}

.spinner {
    border: 4px solid rgba(0, 123, 255, 0.1);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 7. 미디어 쿼리 (모바일 환경에 맞게 조정) */
@media (max-width: 768px) {
    .modal-content-wrapper {
        margin: 10px;
        width: calc(100% - 20px);
        max-width: none;
    }

    .form-select {
      padding : 16px;
    }
}


.back-btn.invisible{
  /* display: none !important; */ /* 주석 처리 또는 제거 */
  visibility: hidden !important; /* 공간은 차지하되 보이지 않게 */
  pointer-events: none !important;ㄴ
}

/* ===== 커스텀 팝업 스타일 ===== */
.custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    transition: opacity 0.3s ease;
    visibility: hidden;
}

.custom-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-popup-box {
    background: white;
    width: 85%;
    max-width: 320px;
    padding: 24px 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-popup-overlay.show .custom-popup-box {
    transform: scale(1);
}

.popup-icon {
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
}

.popup-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.popup-message {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 25px;
    word-break: keep-all; /* 한글 줄바꿈 최적화 */
}

.popup-btn {
    width: 100%;
    padding: 14px;
    background: #667eea; /* 앱 테마 컬러 */
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.popup-btn:active {
    background: #5a6fd6;
    transform: scale(0.98);
}
