/**
 * Profile CSS
 * 寵物/用戶 Profile 頁面專用樣式
 */

/* ========================================
   Pet Profile Page
======================================== */
.pet-profile-page {
    margin: 0 auto;
    padding-bottom: calc(var(--bottom-nav-height) + 24px);
}

/* ========================================
   Profile Hero Section
======================================== */
.profile-hero {
    position: relative;
    margin-bottom: 40px;
}

/* 連接 hero 與 info card */
.profile-hero::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--paws-card);
    border-radius: 20px 20px 0 0;
}

.cover-photo {
    height: 260px;
    border-radius: 20px 20px 0 0;
    background-size: cover;
    background-position: center;
    background-color: var(--paws-bg);
}

.cover-photo.default {
    background: linear-gradient(135deg, var(--paws-primary) 0%, var(--paws-primary-light) 100%);
}

.profile-avatar-wrap {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--paws-primary) 0%, var(--paws-primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 3px solid var(--paws-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar .material-icons {
    font-size: 40px;
}

/* ========================================
   Profile Info Section
======================================== */
.profile-info-section {
    text-align: center;
    margin-top: -20px;
    margin-bottom: 12px;
}

.profile-info-card {
    background: var(--paws-card);
    padding: 28px 16px 0;
    margin-bottom: 0;
}

.profile-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pet-name {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gender-icon {
    display: flex;
}

.gender-icon .material-icons {
    font-size: 22px;
}

.pet-username {
    font-size: 14px;
    color: var(--paws-primary);
    margin: 2px 0 12px;
}

/* ========================================
   Pet Details
======================================== */
.pet-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
}

.detail-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .8rem;
    color: var(--paws-text-secondary);
}

.detail-item:not(:last-child)::after {
    content: '·';
    margin-left: 6px;
    color: var(--paws-text-muted);
}

.detail-item .material-icons {
    font-size: .8rem;
    color: var(--paws-primary);
}

.detail-item .detail-category-img {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
}

/* ========================================
   Personality Tags
======================================== */
.personality-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.personality-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    padding: 5px 10px;
    background: linear-gradient(135deg, var(--paws-primary-light) 0%, var(--paws-primary) 100%);
    color: white;
    border-radius: 14px;
    font-weight: 500;
}

.tag-icon {
    font-size: 12px;
}

/* ========================================
   Profile Stats + Owner (Combined)
======================================== */
.profile-stats-wrap {
    margin: 0 -16px 0;
    border-top: 1px solid var(--paws-border);
    background: rgba(255, 189, 89, 0.08);
    border-radius: 0 0 20px 20px;
    padding-bottom: 16px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 16px 0 12px;
}

.profile-stats .stat {
    flex: 1;
    text-align: center;
    position: relative;
}

.profile-stats .stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 24px;
    background: var(--paws-border);
}

.profile-stats .stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--paws-text);
    line-height: 1.2;
}

.profile-stats .stat-label {
    display: block;
    font-size: 12px;
    color: var(--paws-text-muted);
    margin-top: 2px;
}

/* Owner Inline (在 Stats 下方，置中) */
.owner-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
}

.owner-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--paws-primary) 0%, var(--paws-primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
}

.owner-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.owner-label-sm {
    font-size: 12px;
    color: var(--paws-text-muted);
}

.owner-name-sm {
    font-size: 13px;
    font-weight: 500;
    color: var(--paws-text);
}

/* ========================================
   Diaries Section (in Profile)
======================================== */
.diaries-section {
    padding: 0 0 16px 0;
    border-top: 6px solid var(--paws-bg);
    margin-top: 10px;
}

.empty-diaries {
    text-align: center;
    padding: 40px 20px;
    background: var(--paws-card);
    border-radius: 16px;
}

.empty-diaries .material-icons {
    font-size: 48px;
    color: var(--paws-text-muted);
}

.empty-diaries p {
    color: var(--paws-text-muted);
    margin: 12px 0 0;
}

.btn-create-diary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 10px 20px;
    background: var(--paws-primary);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.add-diary-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--paws-primary);
    color: white;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.add-diary-btn .material-icons {
    font-size: 16px;
}

/* ========================================
   Story Section
======================================== */
.story-section {
    padding: 24px 0;
    border-top: 8px solid var(--paws-bg);
}

.story-content {
    background: var(--paws-card);
    border-radius: 16px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--paws-text-secondary);
}

/* ========================================
   Desktop Layout
======================================== */
@media (min-width: 768px) {
    .pet-profile-page {
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    .pet-profile-page {
        max-width: 700px;
    }
}

/* ========================================
   Follow Button
======================================== */
.profile-action-wrap {
    margin-top: 16px;
    padding-bottom: 16px;
}

.follow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 200px;
    padding: 10px 24px;
    background: var(--paws-primary);
    color: white;
    border: 2px solid var(--paws-primary);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.follow-btn .material-icons {
    font-size: 18px;
}

.follow-btn:hover {
    background: var(--paws-primary-dark, #e5a000);
    border-color: var(--paws-primary-dark, #e5a000);
}

.follow-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Following state */
.follow-btn.following {
    background: transparent;
    color: var(--paws-text-secondary);
    border-color: var(--paws-border);
}

.follow-btn.following:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}
