
/**
 * Profile & Account Styles - Custom CSS
 */

/* ========================================
   Universal Button Styles
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn--primary {
    background: var(--primary, #764ba2);
    color: white;
}

.btn--primary:hover {
    opacity: 0.9;
}

.btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--ghost {
    background: transparent;
    color: var(--muted-fg, #6b7280);
    border: 1px solid var(--border, #e5e7eb);
}

.btn--ghost:hover {
    background: var(--muted, #f3f4f6);
    color: var(--fg, #1f2937);
}

.btn--full {
    width: 100%;
}

.btn--danger {
    color: #dc2626;
}

.btn--danger:hover {
    background: rgba(220, 38, 38, 0.08);
}

/* ─── Feed Pagination ───────────────────────────────────── */
.feed-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 0 8px;
}
.feed-page-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: var(--base-200, #f2f2f2);
    color: var(--base-content, #1a1a1a);
    text-decoration: none;
    transition: background .15s;
}
.feed-page-btn:hover {
    background: var(--base-300, #e0e0e0);
}
.feed-page-btn--disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}
.feed-page-info {
    font-size: 13px;
    color: var(--muted-fg, #888);
}

.post-gallery .gallery-image:not(.hidden) {
    transition: opacity .2s, filter .2s, transform .2s;
}
.post-gallery .gallery-image:not(.hidden):hover {
    filter: brightness(1.08);
    transform: scale(1.03);
}

/* ─── Profile Wrapper ──────────────────────────────────── */
.profile-container {
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Widen overall profile layout to match explore spacing */
.profile-layout {
    max-width: 1440px;
    padding: 0 12px;
}
.profile-layout .profile-main {
    padding: 24px 12px;
    overflow-x: hidden;
}

/* ─── Profile Header ───────────────────────────────────── */
.ph-card {
    background: #fff;
    border-radius: 16px;
    overflow: visible;
    margin: 0 auto 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* Cover / BG image */
.ph-cover {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

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

/* Stats on cover bottom-right */
.ph-cover-stats {
    position: absolute;
    bottom: 12px;
    right: 16px;
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 8px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.ph-cover-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 14px;
    border-right: 1px solid rgba(0,0,0,.1);
}

.ph-cover-stat:last-child {
    border-right: none;
    padding-right: 0;
}

.ph-cover-stat-number {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.ph-cover-stat-label {
    font-size: 10px;
    color: #666;
    text-transform: lowercase;
    letter-spacing: .02em;
}

/* Avatar bridging cover and bottom */
.ph-bridge {
    position: relative;
    height: 50px;
}

.ph-avatar-wrap {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.ph-avatar-ring {
    background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7);
    border-radius: 50%;
    padding: 4px;
    display: inline-block;
    cursor: pointer;
}

.ph-avatar-ring.no-story {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    cursor: default;
}

.ph-avatar-inner {
    background: #fff;
    border-radius: 50%;
    padding: 3px;
    display: block;
    line-height: 0;
}

.ph-avatar-img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ph-avatar-initials {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -1px;
}

/* Bottom section: left buttons | center info | right social */
.ph-bottom {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 12px 24px 24px;
    min-height: 120px;
}

.ph-bottom-center {
    max-width: 700px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 16px;
}

.ph-bottom-right {
    position: absolute;
    top: 12px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

/* Social link icons */
.ph-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #555;
    transition: background .15s, color .15s, transform .15s;
    text-decoration: none;
}
.ph-social-link:hover {
    transform: scale(1.1);
}
.ph-social-link.fb:hover { background: #1877f2; color: #fff; }
.ph-social-link.ig:hover { background: #e4405f; color: #fff; }
.ph-social-link.yt:hover { background: #ff0000; color: #fff; }
.ph-social-link.li:hover { background: #0a66c2; color: #fff; }

/* Buttons */
.ph-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    color: #333;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1;
}

.ph-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.ph-btn-follow {
    background: #333;
    color: #fff;
    border-color: #333;
}

.ph-btn-follow:hover {
    background: #555;
    border-color: #555;
    color: #fff;
}

.ph-btn-follow.following {
    background: #fff;
    color: #333;
    border-color: #e0e0e0;
}

.ph-btn-icon {
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

/* Social link buttons */
.ph-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    color: #555;
    text-decoration: none;
    transition: all .15s;
    font-size: 15px;
}

.ph-social-link:hover {
    background: #f0f0f0;
    border-color: #ccc;
    color: #333;
}

/* User info */
.ph-username {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -.3px;
}

.ph-fullname {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

.ph-bio {
    margin: 4px 0 0;
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    white-space: pre-line;
    max-width: 400px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ph-bio.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.ph-bio-toggle {
    background: none;
    border: none;
    color: #667eea;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 0;
    margin-top: 2px;
}

.ph-bio-toggle:hover {
    text-decoration: underline;
}

.ph-bio-placeholder {
    font-style: italic;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
}

.ph-bio-edit-trigger {
    display: inline-flex;
    align-items: flex-start;
    gap: 5px;
    cursor: pointer;
}

.ph-bio-edit-trigger:hover .ph-bio {
    color: #222;
}

.ph-bio-pencil {
    margin-top: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s;
    color: #999;
}

.ph-bio-edit-trigger:hover .ph-bio-pencil {
    opacity: 1;
}

/* Bio form */
.ph-bio-form {
    display: none;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.ph-bio-textarea {
    width: 100%;
    max-width: 400px;
    background: #f8f8f8;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    font-family: inherit;
}

.ph-bio-textarea:focus {
    border-color: #999;
    background: #fff;
}

.ph-bio-textarea::placeholder {
    color: #aaa;
}

.ph-bio-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
}





/* Category badges */
.ph-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.ph-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.ph-badge-icon {
    font-size: 13px;
    line-height: 1;
}

/* Dropdown */
.ph-dropdown {
    position: relative;
    display: inline-block;
}

.ph-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.16);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
    padding: 6px 0;
}

.ph-dropdown.open .ph-dropdown-menu {
    display: block;
}

.ph-dropdown-menu a,
.ph-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    color: #1a1a1a;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: left;
    transition: background .1s;
}

.ph-dropdown-menu a:hover,
.ph-dropdown-menu button:hover {
    background: #f5f5f5;
}

.ph-dropdown-menu button.danger {
    color: #e53e3e;
}

/* Add post  */

.create-post-submit button{
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
/* ─── Post Cards Grid ──────────────────────────────────── */
.feed-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feed-card {
    background: #fff;
    border-radius: 14px;
    overflow: visible;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transition: box-shadow .2s, transform .15s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.feed-card:has(.dropdown[open]),
.feed-card:has(.dropdown:focus-within) {
    z-index: 10;
}

.feed-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

/* ─── Image collage ─────────────────────────────────────── */
.feed-card-collage {
    display: grid;
    gap: 3px;
    margin: 10px 10px 0;
    border-radius: 10px;
    overflow: hidden;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.10));
    max-height: 400px;
}

.feed-card-collage.collage-1 {
    grid-template-columns: 1fr;
}
.feed-card-collage.collage-1 .collage-item { aspect-ratio: 16/9; }

.feed-card-collage.collage-2 {
    grid-template-columns: 1fr 1fr;
}
.feed-card-collage.collage-2 .collage-item { aspect-ratio: 1/1; }

.feed-card-collage.collage-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.feed-card-collage.collage-3 .collage-item:first-child {
    grid-row: 1 / 3;
    aspect-ratio: auto;
}
.feed-card-collage.collage-3 .collage-item:not(:first-child) { aspect-ratio: 4/3; }

.feed-card-collage.collage-4 {
    grid-template-columns: 1fr 1fr;
}
.feed-card-collage.collage-4 .collage-item { aspect-ratio: 4/3; }

.feed-card-collage.collage-5 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.feed-card-collage.collage-5 .collage-item:nth-child(1) {
    grid-column: 1 / 2;
}
.feed-card-collage.collage-5 .collage-item:nth-child(2) {
    grid-column: 2 / 4;
}

.collage-item {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
    cursor: pointer;
}

.collage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.collage-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    backdrop-filter: blur(2px);
}

.feed-card-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feed-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.feed-card-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.feed-card-author-initial {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.feed-card-author-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.feed-card-author-time {
    font-size: 11px;
    color: #999;
    margin-left: auto;
}

.feed-card-text {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

.feed-card-text.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.feed-card-readmore {
    background: none;
    border: none;
    color: #667eea;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0 0;
    display: none;
}

.feed-card-readmore:hover {
    text-decoration: underline;
}

/* ─── Quote-style for text-only posts ────────────────── */
.feed-card:not(:has(.feed-card-collage)) {
    background: #fff;
}

.feed-card:not(:has(.feed-card-collage)) .feed-card-body {
    justify-content: center;
    flex: 1;
}

.feed-card:not(:has(.feed-card-collage)) .feed-card-text {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    -webkit-line-clamp: 6;
}

.feed-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
}

.feed-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    background: #f5f5f5;
    color: #666;
    border: none;
    cursor: pointer;
    transition: background .15s;
}

.feed-card-badge:hover {
    background: #eee;
}

.feed-card-badge.liked {
    background: #fee2e2;
    color: #dc2626;
}

.feed-card-badge svg {
    width: 14px;
    height: 14px;
}

.feed-card-menu {
    margin-left: auto;
}

/* Share card styles */
.feed-card-share .feed-card-share-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #999;
    margin-left: 4px;
}

.feed-card-shared-content {
    padding: 0 12px 12px;
}
.feed-card-shared-content > .card {
    max-width: 100% !important;
    width: 100%;
}



/* ─── Profile Tabs Navigation ──────────────────────────── */
.profile-tabs-container {
    background: var(--card, #ffffff);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    border: 1px solid var(--border, #e5e7eb);
}



.profile-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    background: transparent;
}

.profile-tab {
    position: relative;
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-tab:hover {
    background: var(--base-200, #f3f4f697);
}

.profile-tab.tab-active,
.profile-tab.active-tab {
    color: var(--primary, #764ba2);
}

.profile-tab-text {
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    background: var(--base-300, #e5e7eb);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    color: var(--base-content, #1f2937);
}

.profile-tab.tab-active .profile-tab-badge,
.profile-tab.active-tab .profile-tab-badge {
    background: var(--primary, #764ba2);
    color: white;
}
/* ── Responsive ── */
@media (max-width: 800px) {

    .profile-layout .profile-main {
        padding: 5px;
    }
    .profile-container {
        padding: 0;
    }

    .profile-tabs{
        gap: 0px;
    }
    
    .ph-cover {
        height: 160px;
    }
    .ph-avatar-img,
    .ph-avatar-initials {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }
    .ph-avatar-wrap {
        top: -45px;
    }
    .ph-bridge {
        height: 40px;
    }
    .ph-bottom {
        flex-direction: column;     
        align-items: stretch;
        padding: 12px 16px 20px;
        gap: 16px;
        min-height: auto;
    }
    .ph-bottom-center {
        order: 1;
        width: 100%;
        flex: 0 0 100%;
        text-align: center;
        padding: 0;
    }

    .ph-bio{
        max-width: 500px;
        font-size: 12px;
    }
    .ph-bottom-right {
        position: static;
        order: 2;
        flex: 0 1 auto;
        height: fit-content;
        justify-content: center;
        width: 100%;
    }
    .ph-username { font-size: 18px; }
    .ph-cover-stats {
        padding: 6px 10px;
        gap: 2px;
        top: 12px;
        bottom: auto;
    }
    .ph-cover-stat {
        padding: 0 10px;
    }
    .ph-cover-stat-number { font-size: 14px; }
    
}
/* Responsive: larger text on medium+ screens */
@media (min-width: 768px) {
    .profile-tab-text {
        font-size: 16px;
    }
    
    .profile-tab-badge {
        font-size: 12px;
        padding: 3px 10px;
    }
}

@keyframes tab-underline-in {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* Align feed with explore layout and prevent horizontal scroll */
.post-feed {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-x: hidden;
}

.post-card {
    width: 100%;
}

.create-post-card {
    margin-bottom: 16px;
    /* margin-top: 16px; */
}

.create-post-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.create-post-tools-btn {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    height: auto;
    gap: 6px;
    padding: 6px 12px;
    background: var(--base-200, #f3f4f6);
    color: var(--base-content, #1f2937);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.create-post-tools-btn svg{
    width: 20px;
    height: 20px;
}

/* ─── Tab Content Sections ─────────────────────────────── */
.tab-content-card {
    background: var(--card, #ffffff);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    border: 1px solid var(--border, #e5e7eb);
    padding: 20px;
}

.tab-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tab-content-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--base-content, #1f2937);
    margin: 0;
}

.tab-content-count {
    font-size: 14px;
    font-weight: 400;
    color: var(--muted-fg, #9ca3af);
    margin-left: 8px;
}

.tab-content-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--secondary, #10b981);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.tab-content-btn:hover {
    background: var(--secondary-hover, #059669);
    transform: translateY(-1px);
}

.tab-content-btn svg {
    width: 16px;
    height: 16px;
}

.tab-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    justify-items: center;
}

@media (min-width: 768px) {
    .tab-content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tab-content-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 16px;
    color: var(--muted-fg, #9ca3af);
}

.tab-content-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.5;
    stroke: currentColor;
}

.tab-content-empty-text {
    font-size: 18px;
    margin: 0;
}

.tab-content-load-more {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.tab-content-load-btn {
    padding: 10px 24px;
    background: var(--primary, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-content-load-btn:hover {
    background: var(--primary-hover, #5a2d82);
    transform: translateY(-1px);
}
