/* =========================================================
   user_profile_modal.css
   공용 유저 프로필 모달
   접두사: upm- (User Profile Modal)
   ========================================================= */

/* ─── 오버레이 ─── */
.upm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    padding: 2rem 1rem;
}
.upm-overlay.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    animation: upmFadeIn 0.25s ease;
}
@keyframes upmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── 모달 카드 ─── */
.upm-modal {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: upmSlideUp 0.25s ease-out;
    box-sizing: border-box;
}
@keyframes upmSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── 히어로 ─── */
.upm-hero {
    background: linear-gradient(160deg, #f7f5f2 0%, #ede8e3 100%);
    padding: 28px 20px 22px;
    text-align: center;
    position: relative;
}

/* 닫기 */
.upm-close {
    position: absolute;
    top: 10px; right: 10px;
    width: 34px; height: 34px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    color: #999;
    transition: background 0.15s;
}
.upm-close:hover { background: #f5f5f5; color: #333; }

/* 아바타 */
.upm-avatar-wrap { margin-bottom: 14px; }

.upm-avatar {
    width: 88px; height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8e8e8;
    background: #fff;
    transition: transform 0.2s;
}
.upm-avatar:hover { transform: scale(1.03); }

.upm-avatar-ph {
    width: 88px; height: 88px;
    border-radius: 50%;
    border: 2px solid #e8e8e8;
    margin: 0 auto;
    background: #fff;
    display: flex;
    align-items: center; justify-content: center;
    font-size: 2rem;
    color: #bbb;
}

/* 닉네임 */
.upm-nickname {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

/* 레벨 뱃지 */
.upm-level-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    background: #f0f0f0;
    margin-bottom: 10px;
}

/* 바이오 */
.upm-bio {
    font-size: 0.84rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* ─── 메타 ─── */
.upm-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.82rem;
    color: #888;
}
.upm-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.upm-meta-item i { font-size: 0.85rem; }
.upm-meta-item b { font-weight: 600; color: #555; }

/* ─── 바디 ─── */
.upm-body { padding: 16px 20px 8px; }

/* 섹션 공통 */
.upm-section {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.upm-section:last-child { border-bottom: none; }

.upm-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #666;
    margin-bottom: 10px;
}
.upm-count {
    font-weight: 400;
    color: #aaa;
    font-size: 0.78rem;
}

/* ─── 상세 프로필 ─── */
.upm-info-section {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}
.upm-info-row {
    display: flex;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.82rem;
    line-height: 1.5;
}
.upm-info-row + .upm-info-row {
    border-top: 1px solid #f5f5f5;
}
.upm-info-label {
    flex-shrink: 0;
    min-width: 70px;
    font-weight: 600;
    color: #888;
    font-size: 0.78rem;
}
.upm-info-value {
    color: #444;
    flex: 1;
    word-break: break-word;
    white-space: pre-wrap;
}

/* ─── 반려동물 그리드 ─── */
.upm-pet-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.upm-pet-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff9f0, #ffecd2);
    border: 1px solid rgba(255, 154, 118, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.82rem;
    color: #7a5c4f;
}
.upm-pet-card:hover {
    background: linear-gradient(135deg, #ffecd2, #ffcba4);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(255, 154, 118, 0.2);
}
.upm-pet-photo {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.8);
    background: #f8f0eb;
}
.upm-pet-photo-ph {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.6);
    font-size: 1.2rem;
}
.upm-pet-name { font-weight: 600; }
.upm-pet-breed { font-size: 0.72rem; color: #b0967e; }
.upm-pet-empty {
    text-align: center;
    padding: 14px;
    font-size: 0.8rem;
    color: #c4b2a4;
}

/* ─── 게시글 목록 ─── */
.upm-post-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    cursor: pointer;
    transition: background 0.15s;
}
.upm-post-item:hover { background: rgba(0,0,0,0.015); }
.upm-post-item:last-child { border-bottom: none; }

.upm-post-thumb {
    width: 56px; height: 56px;
    border-radius: 10px;
    object-fit: cover;
    background: #f4f4f4;
    flex-shrink: 0;
}
.upm-post-thumb-ph {
    width: 56px; height: 56px;
    border-radius: 10px;
    background: #f4f4f4;
    display: flex; align-items: center; justify-content: center;
    color: #ddd;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.upm-post-info { flex: 1; min-width: 0; }
.upm-post-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.upm-post-meta {
    font-size: 0.72rem;
    color: #aaa;
    display: flex;
    gap: 10px;
}
.upm-post-meta span { display: inline-flex; align-items: center; gap: 3px; }

/* ─── 방명록 ─── */
.upm-cmt-form {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px 4px 4px 12px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    transition: border-color 0.15s;
}
.upm-cmt-form:focus-within {
    border-color: #03c75a;
}
.upm-cmt-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 0.84rem;
    color: #333;
    outline: none;
    padding: 6px 0;
    min-height: 32px;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    overflow: hidden;
}
.upm-cmt-input::placeholder { color: #b0b8b0; }
.upm-cmt-submit {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    background: #03c75a;
    color: #fff;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.upm-cmt-submit:hover { background: #02b350; }
.upm-cmt-submit:disabled { background: #ccc; cursor: default; }

.upm-cmt-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    animation: upmCmtIn 0.3s ease;
}
.upm-cmt-item:last-child { border-bottom: none; }
@keyframes upmCmtIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.upm-cmt-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}
.upm-cmt-avatar-ph {
    width: 32px; height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    color: #ccc;
    font-size: 0.9rem;
}
.upm-cmt-body { flex: 1; min-width: 0; }
.upm-cmt-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}
.upm-cmt-nick {
    font-size: 0.78rem;
    font-weight: 700;
    color: #555;
}
.upm-cmt-date {
    font-size: 0.68rem;
    color: #bbb;
}
.upm-cmt-text {
    font-size: 0.82rem;
    color: #444;
    line-height: 1.5;
    word-break: break-word;
}
.upm-cmt-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}
.upm-cmt-actions button {
    background: none;
    border: none;
    font-size: 0.7rem;
    color: #bbb;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}
.upm-cmt-actions button:hover { color: #888; background: rgba(0,0,0,0.04); }
.upm-cmt-actions .upm-cmt-del:hover { color: #e57373; }

/* 인라인 수정 */
.upm-cmt-edit-area {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    align-items: flex-end;
}
.upm-cmt-edit-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #03c75a;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-family: inherit;
    color: #333;
    outline: none;
    resize: none;
    line-height: 1.5;
    min-height: 34px;
    background: #fff;
    overflow: hidden;
}
.upm-cmt-edit-input:focus {
    border-color: #03c75a;
    box-shadow: 0 0 0 2px rgba(3, 199, 90, 0.15);
}
.upm-cmt-edit-area button {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    color: #888;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}
.upm-cmt-edit-save {
    background: #03c75a !important;
    color: #fff !important;
}
.upm-cmt-edit-save:hover {
    background: #02b350 !important;
    transform: scale(1.05);
}
.upm-cmt-edit-cancel:hover {
    background: #fce4e4 !important;
    color: #e57373 !important;
    transform: scale(1.08);
}

/* ─── 공통 ─── */
.upm-load-more {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    color: #888;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    margin-top: 8px;
}
.upm-load-more:hover { background: #f5f5f5; color: #555; }

.upm-empty {
    text-align: center;
    padding: 20px;
    font-size: 0.82rem;
    color: #bbb;
}

/* ─── 에러 상태 ─── */
.upm-status {
    text-align: center;
    padding: 48px 24px;
}
.upm-status-icon { font-size: 3rem; color: #ccc; margin-bottom: 12px; }
.upm-status-title { font-size: 1.1rem; font-weight: 600; color: #555; margin-bottom: 6px; }
.upm-status-desc { font-size: 0.85rem; color: #999; }

/* ─── 푸터 ─── */
.upm-footer {
    text-align: center;
    padding: 12px 20px 16px;
}
.upm-footer-text {
    font-size: 0.68rem;
    color: #bbb;
    letter-spacing: 0.02em;
}

/* ─── 반응형 ─── */
@media (max-width: 520px) {
    .upm-overlay { padding: 14px 6px; }
    .upm-modal { border-radius: 14px; }
    .upm-hero { padding: 24px 16px 18px; }
    .upm-avatar, .upm-avatar-ph { width: 80px; height: 80px; }
    .upm-nickname { font-size: 1.12rem; }
    .upm-body { padding: 14px 16px 8px; }
    .upm-meta { padding: 10px 16px; gap: 14px; }
}

@media (max-width: 360px) {
    .upm-overlay { padding: 6px 4px; }
    .upm-modal { border-radius: 12px; }
    .upm-hero { padding: 20px 14px 16px; }
    .upm-avatar, .upm-avatar-ph { width: 72px; height: 72px; font-size: 1.8rem; }
    .upm-nickname { font-size: 1.05rem; }
    .upm-body { padding: 12px 14px 6px; }
    .upm-info-section { padding: 10px 12px; }
    .upm-post-thumb, .upm-post-thumb-ph { width: 44px; height: 44px; }
}

/* =========================================================
   SweetAlert2가 upm-overlay(z-index:9997) 뒤에 숨겨지지 않도록
   .swal2-container z-index를 오버레이보다 높게 강제 설정
   ========================================================= */
.swal2-container {
    z-index: 99999 !important;
}

