/* =========================================================
   pet_card_modal.css
   공용 반려동물 프로필 카드 모달 (자랑 카드)
   접두사: pcm- (Pet Card Modal)
   ========================================================= */

/* ─── 오버레이 ─── */
.pcm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow-y: auto;
    padding: 2rem 1rem;
}
.pcm-overlay.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    animation: pcmFadeIn 0.25s ease;
}
@keyframes pcmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── 모달 카드 ─── */
.pcm-modal {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    animation: pcmSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}
@keyframes pcmSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── 히어로 ─── */
.pcm-hero {
    background: linear-gradient(160deg, #eef7ee 0%, #c8e6c9 50%, #a5d6a7 100%);
    padding: 32px 24px 24px;
    text-align: center;
    position: relative;
}

/* 닫기 */
.pcm-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 38px; height: 38px;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: #8c6e5d;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.pcm-close:hover { background: rgba(255,255,255,0.9); color: #5a3d30; }

/* 프로필 사진 */
.pcm-photo-wrap { margin-bottom: 14px; }

.pcm-photo {
    width: 140px; height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    background: #f8f0eb;
    transition: transform 0.3s ease;
}
.pcm-photo:hover { transform: scale(1.04); }

/* 사진 없을 때 */
.pcm-photo-ph {
    width: 140px; height: 140px;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.55);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-size: 3rem;
    line-height: 1;
}
.pcm-photo-ph-hint {
    font-size: 0.62rem;
    color: #b0967e;
    margin-top: 4px;
}

/* 이름 */
.pcm-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3d2c22;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

/* 품종 뱃지 */
.pcm-breed-badge {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #9c7a65;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    margin-bottom: 12px;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 나이/성별 필 태그 */
.pcm-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pcm-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.65);
    color: #7a5c4f;
    backdrop-filter: blur(4px);
}
.pcm-tag i, .pcm-tag .tag-icon { font-size: 0.82rem; }

/* ─── 사진 갤러리 (주인공 대우) ─── */
.pcm-gallery-section {
    background: #faf6f3;
    padding: 16px 0 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    position: relative;
}

/* 좌/우 화살표 버튼 */
.pcm-gal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    z-index: 5;
    width: 40px; height: 200px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 3rem;
    line-height: 1;
    font-weight: 100;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
}
.pcm-gal-arrow:hover {
    color: #e0e0e0;
}
.pcm-gal-prev { left: 0px; }
.pcm-gal-next { right: 0px; }
.pcm-gallery-section.has-arrows .pcm-gal-arrow { display: flex; align-items: center; justify-content: center; }

.pcm-gallery-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 13px;
    padding: 0 16px 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: center;
    cursor: default;
    box-sizing: content-box;
    scroll-behavior: smooth;
}
.pcm-gallery-track::-webkit-scrollbar { display: none; }
.pcm-gallery-track.is-dragging { cursor: grabbing; user-select: none; }

/* 사진 2개 이상이면 좌측 정렬 (스크롤 가능) */
.pcm-gallery-track.has-many {
    justify-content: flex-start;
}

.pcm-gallery-item {
    flex: 0 0 calc(50% - 5px);
    scroll-snap-align: center;
    text-align: center;
    min-width: 0;
}
.pcm-gallery-img {
    width: 100%; height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    background: #f4f0ed;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
}
.pcm-gallery-img:hover { transform: scale(1.02); }

/* PC 드래그 시 이미지 선택 방지 */
.pcm-gallery-track img {
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}
.pcm-gallery-item {
    user-select: none;
}

.pcm-gallery-caption {
    font-size: 0.72rem;
    color: #b0a099;
    margin-top: 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pcm-gallery-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding-top: 4px;
}
.pcm-gallery-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ddd;
    border: none; padding: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.pcm-gallery-dot.active {
    background: #e8a87c;
    width: 18px;
    border-radius: 3px;
}

/* ─── 바디 ─── */
.pcm-body { padding: 20px 24px 16px; }

/* 소개 말풍선 */
.pcm-intro-section { margin-bottom: 18px; }
.pcm-intro-bubble {
    position: relative;
    background: #fff8f2;
    border: 1px solid rgba(232, 168, 124, 0.2);
    border-radius: 18px;
    padding: 16px 18px;
    font-size: 0.88rem;
    color: #5a4a3c;
    line-height: 1.65;
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.pcm-intro-bubble::before {
    content: '💬';
    position: absolute;
    top: -12px; left: 20px;
    font-size: 1rem;
}

/* 상세 정보 그리드 (생년월일/입양일 — 접힘 가능한 보조 정보) */
.pcm-detail-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.pcm-detail-item {
    flex: 1;
    min-width: 140px;
    background: #faf8f6;
    border-radius: 12px;
    padding: 10px 14px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
}
.pcm-detail-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #c4b2a4;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pcm-detail-value {
    font-size: 0.84rem;
    font-weight: 600;
    color: #5a4a3c;
}

/* ─── 주인 전용 섹션 ─── */
.pcm-owner-section {
    margin-bottom: 16px;
    border: 1px dashed rgba(232, 168, 124, 0.25);
    border-radius: 14px;
    padding: 14px 16px;
    background: #fffcfa;
}
.pcm-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #b0967e;
    margin-bottom: 10px;
}

/* 메모 */
.pcm-memo-body {
    font-size: 0.84rem;
    color: #5a4a3c;
    line-height: 1.6;
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* 체중 */
.pcm-weight-list { }
.pcm-weight-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: 0.82rem;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}
.pcm-weight-row:last-child { border-bottom: none; }
.pcm-weight-date { color: #b0967e; min-width: 80px; flex-shrink: 0; }
.pcm-weight-kg { font-weight: 700; color: #5a4a3c; }
.pcm-weight-memo { color: #c4b2a4; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem; }

/* 기록 */
.pcm-note-list { }
.pcm-note-row {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    font-size: 0.82rem;
}
.pcm-note-row:last-child { border-bottom: none; }
.pcm-note-date { font-size: 0.7rem; font-weight: 600; color: #c4b2a4; margin-bottom: 2px; }
.pcm-note-text { color: #5a4a3c; line-height: 1.5; }

/* ─── 푸터 ─── */
.pcm-footer {
    text-align: center;
    padding: 14px 24px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.pcm-footer-text {
    font-size: 0.7rem;
    color: #d4c5b8;
    letter-spacing: 0.02em;
}

/* 수정 버튼 */
.pcm-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 22px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #7a5c4f;
    background: linear-gradient(135deg, #fff9f0, #ffecd2);
    border: 1px solid rgba(255, 154, 118, 0.25);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 10px;
}
.pcm-edit-btn:hover {
    background: linear-gradient(135deg, #ffecd2, #ffd8b8);
    border-color: rgba(255, 130, 80, 0.4);
    box-shadow: 0 3px 12px rgba(255, 154, 118, 0.25);
    color: #5a3d30;
    transform: translateY(-1px);
}

/* ─── 한줄 인사 ─── */
.pcm-greet-section {
    margin-top: 14px;
    padding: 0;
}
.pcm-greet-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #b0967e;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.pcm-greet-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e0d5c8 transparent;
}
.pcm-greet-item {
    padding: 8px 12px 6px;
    border-radius: 10px;
    background: #faf7f3;
    border: 1px solid rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    animation: pcmGreetIn 0.3s ease;
}
.pcm-greet-item:hover {
    background: #f5f0ea;
}
.pcm-greet-item.is-mine {
    background: linear-gradient(135deg, #f0faf0, #e8f5e8);
    border-color: rgba(76, 175, 80, 0.12);
}
@keyframes pcmGreetIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.pcm-greet-row {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.5;
}
.pcm-greet-nick {
    font-size: 0.76rem;
    font-weight: 700;
    color: #7a5c4f;
    white-space: nowrap;
    flex-shrink: 0;
}
.pcm-greet-nick::after {
    content: "·";
    color: #c4b2a4;
    margin-left: 2px;
    font-weight: 400;
}
.pcm-greet-content {
    font-size: 0.82rem;
    color: #5a4a3c;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    line-height: 1.5;
    font-weight: 400;
}
.pcm-greet-actions {
    display: flex;
    gap: 1px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
    margin-top: 1px;
}
.pcm-greet-item:hover .pcm-greet-actions {
    opacity: 1;
}
.pcm-greet-act-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #c4b2a4;
    transition: all 0.15s;
    line-height: 1;
}
.pcm-greet-act-btn:hover {
    color: #888;
    background: rgba(0,0,0,0.05);
}
.pcm-greet-act-btn.pcm-greet-del:hover {
    color: #e57373;
}
.pcm-greet-time {
    font-size: 0.64rem;
    color: #c4b8ab;
    margin-top: 1px;
    padding-left: 0;
    font-weight: 400;
    line-height: 1.3;
}

/* 빈 상태 */
.pcm-greet-empty {
    text-align: center;
    padding: 18px 12px;
    font-size: 0.8rem;
    color: #c4b2a4;
    background: #faf7f3;
    border-radius: 10px;
    border: 1px dashed rgba(0,0,0,0.08);
    line-height: 1.5;
}

/* 입력창 */
.pcm-greet-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 5px 5px 5px 14px;
    border-radius: 999px;
    background: #f8f4f0;
    border: 1px solid rgba(0,0,0,0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pcm-greet-input-wrap:focus-within {
    border-color: rgba(139, 115, 85, 0.3);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.08);
}
.pcm-greet-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.82rem;
    color: #5a4a3c;
    outline: none;
    padding: 5px 0;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.4;
}
.pcm-greet-input::placeholder {
    color: #c4b8ab;
    font-weight: 400;
}
.pcm-greet-send {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #a8d5a2, #7ec47a);
    color: #fff;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.pcm-greet-send:hover {
    background: linear-gradient(135deg, #7ec47a, #5cb85c);
    transform: scale(1.05);
}
.pcm-greet-send:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

/* 비로그인 안내 */
.pcm-greet-login-msg {
    text-align: center;
    padding: 8px;
    font-size: 0.74rem;
    color: #c4b8ab;
    font-style: italic;
    font-weight: 400;
}

/* 인라인 수정 입력 */
.pcm-greet-edit-input {
    width: 100%;
    border: 1px solid rgba(139, 115, 85, 0.3);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 400;
    color: #5a4a3c;
    background: #fff;
    outline: none;
    line-height: 1.4;
}
.pcm-greet-edit-input:focus {
    border-color: rgba(139, 115, 85, 0.5);
    box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.1);
}

/* ─── 반응형 ─── */
@media (max-width: 520px) {
    .pcm-overlay { padding: 16px 8px; }
    .pcm-modal { border-radius: 18px; }
    .pcm-hero { padding: 24px 16px 20px; }
    .pcm-photo, .pcm-photo-ph { width: 110px; height: 110px; }
    .pcm-name { font-size: 1.35rem; }
    .pcm-body { padding: 16px 18px 12px; }
    .pcm-gallery-item { flex: 0 0 calc(50% - 5px); }
    .pcm-gallery-track { padding: 0 14px 8px; }
    .pcm-detail-item { min-width: 120px; }
}

/* 초소형 기기 (≤360px) */
@media (max-width: 360px) {
    .pcm-overlay { padding: 10px 4px; }
    .pcm-modal { border-radius: 16px; }
    .pcm-hero { padding: 20px 12px 16px; }
    .pcm-photo, .pcm-photo-ph { width: 96px; height: 96px; font-size: 2.5rem; }
    .pcm-name { font-size: 1.2rem; }
    .pcm-breed-badge { font-size: 0.72rem; padding: 2px 10px; }
    .pcm-tag { font-size: 0.72rem; padding: 3px 10px; }
    .pcm-body { padding: 14px 14px 10px; }
    .pcm-intro-bubble { padding: 12px 14px; font-size: 0.82rem; }
    .pcm-gallery-item { flex: 0 0 calc(50% - 4px); }
    .pcm-gallery-track { padding: 0 10px 6px; gap: 8px; }
    .pcm-detail-item { min-width: 100px; padding: 8px 10px; }
    .pcm-detail-label { font-size: 0.64rem; }
    .pcm-detail-value { font-size: 0.78rem; }
    .pcm-owner-section { padding: 10px 12px; }
    .pcm-section-title { font-size: 0.72rem; }
    .pcm-weight-row { font-size: 0.76rem; gap: 6px; }
    .pcm-weight-date { min-width: 70px; }
    .pcm-note-row { font-size: 0.76rem; }
    .pcm-edit-btn { font-size: 0.76rem; padding: 6px 18px; }
    .pcm-footer { padding: 10px 14px 16px; }
}
