.profile-avatar-container {
    position: absolute;
    bottom: -72px;
    left: 40px;
    padding: 6px;
    background: var(--surface-color);
    border-radius: 50%;
}

.profile-avatar {
    width: 168px;
    height: 168px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 4px solid var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 700;
    color: var(--text-secondary);
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-md);
}

.profile-title {
    position: absolute;
    bottom: -95px;
    left: 228px;
}

.profile-title h1 {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.04em;
}

.profile-title p {
    margin: 2px 0 0 0;
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 500;
}

/* Content Grid */
.profile-content {
    padding: 2rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
}

.info-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.info-card h3 {
    margin-top: 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#profile-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#profile-details-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
}

#profile-details-list li:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
}

.detail-value {
    color: #334155;
    font-weight: 600;
    text-align: right;
}

/* Family List Styles */
.family-group {
    margin-bottom: 1.5rem;
}

.family-group h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.family-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.family-member-item:hover {
    background: #f8fafc;
}

.fm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.fm-info div:first-child {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.fm-info div:last-child {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Photos Section */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.photo-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: #f1f5f9;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.photo-item:hover {
    transform: scale(1.05);
}

.no-photos {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem 0;
}

/* --- LIGHTBOX --- */
#lightbox {
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#lightbox.hidden {
    display: none !important;
}

#lightbox-img {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    border: 2px solid white;
    border-radius: 4px;
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

#lightbox-close:hover,
#lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-nav {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
    border: none;
    z-index: 2001;
}

#lightbox-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

#lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

/* Mobile Profile Optimization */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .profile-content {
        padding: 1rem;
    }

    .profile-avatar-container {
        left: 50%;
        transform: translateX(-50%);
        bottom: -60px;
    }

    .profile-title {
        left: 0;
        right: 0;
        text-align: center;
        bottom: auto;
        top: 100%;
        margin-top: 65px;
        padding: 0 1rem;
    }

    .profile-title h1 {
        font-size: 1.5rem;
    }
}