/* ===================================================================
   PROFILE-TABS.CSS - Shared pill-shaped tab component
   Used by: user_profile.html, collections_profile.html, notifications.html
   Single source of truth — no inline tab styles in templates.
   =================================================================== */

/* Wrapper shell for tabs + optional overflow arrows */
.profile-tabs-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

/* Scrolling tabs container */
.profile-tabs-container {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    flex: 1;
    flex-wrap: nowrap;
    padding-bottom: 15px 0;
    border-radius: var(--radius-pill);
}

/* Hide scrollbar for Chrome/Safari */
.profile-tabs-container::-webkit-scrollbar {
    display: none;
}

/* Individual tab — pill shape */
.profile-tab {
    padding: 6px 25px;
    font-size: 17px;
    font-weight: 500;
    color: var(--gray-500, #6b7280);
    background: transparent;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

.profile-tab:hover:not(.profile-tab-active) {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-800, #1f2937);
    text-decoration: none;
}

/* Active tab — dark pill */
.profile-tab-active {
    background: var(--black, #000000);
    color: var(--white, #ffffff);
    font-weight: 600;
}

.profile-tab-active:hover {
    color: var(--white, #ffffff);
    text-decoration: none;
}

/* Inline count next to tab label */
.profile-tab-count {
    font-size: 17px;
    margin-left: 5px;
    display: inline-block;
    min-width: 25px;
    text-align: left;
    font-variant-numeric: tabular-nums;
    /* opacity removed — was 0.7, caused WCAG failure (2.76:1 on inactive tabs).
       De-emphasis provided by font-weight: normal vs tab's 500. */
}

/* Fixed-width badge to prevent layout shift */
.stat-badge {
    display: inline-block;
    text-align: center;
    padding-right: 4px;
    font-weight: normal;
    transition: none;
    font-variant-numeric: tabular-nums;
}

.stat-badge.wide {
    min-width: 50px;
}

/* === OVERFLOW ARROWS === */

/* Right arrow button */
.overflow-arrow {
    background: linear-gradient(
        to left,
        var(--gray-50, #f7f7f7) 0%,
        rgba(247, 247, 247, 0.95) 20%,
        rgba(247, 247, 247, 0.7) 50%,
        rgba(247, 247, 247, 0) 100%
    );
    border-radius: var(--radius-pill);
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 50px;
    border: none;
    padding: 0;
    background-color: transparent;
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.15s ease-out;
    opacity: 0;
}

/* Left arrow button */
.overflow-arrow-left {
    background: linear-gradient(
        to right,
        var(--gray-50, #f7f7f7) 0%,
        rgba(247, 247, 247, 0.95) 20%,
        rgba(247, 247, 247, 0.7) 50%,
        rgba(247, 247, 247, 0) 100%
    );
    border-radius: var(--radius-pill);
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 50px;
    border: none;
    padding: 0;
    background-color: transparent;
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.15s ease-out;
    opacity: 0;
}

/* Arrow icon styling */
.overflow-arrow i {
    color: var(--gray-500, #6b7280);
    font-size: 20px;
    padding-right: 16px;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
    pointer-events: none;
}

.overflow-arrow:hover i {
    color: var(--gray-800, #1f2937);
    transform: translateX(2px);
}

.overflow-arrow:active {
    transform: none;
}

.overflow-arrow:active i {
    transform: scale(0.95);
}

.overflow-arrow-left i {
    color: var(--gray-500, #6b7280);
    font-size: 20px;
    padding-left: 16px;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
    pointer-events: none;
}

.overflow-arrow-left:hover i {
    color: var(--gray-800, #1f2937);
    transform: translateX(-2px);
}

.overflow-arrow-left:active {
    transform: none;
}

.overflow-arrow-left:active i {
    transform: translateX(-2px) scale(0.95);
}

/* === RESPONSIVE === */

/* Tablet and below */
@media (max-width: 1024px) {
    .profile-tabs-wrapper {
        width: 100%;
    }

    .profile-tabs-container {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .profile-tabs-container::-webkit-scrollbar {
        display: none;
    }

    .profile-tab {
        flex-shrink: 0;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .profile-tabs-container {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
}

/* ==========================================================================
   Follow cards (Followers / Following tabs) — CC_SPEC_PROFILE_SUBTABS 6.E
   Grid mirrors .collection-grid breakpoints (4 -> 3 @1199 -> 2 @767 -> 1 @480).
   .follow-card reuses .prompt-card border-radius / shadow / transition (DRY, Step 0.7).
   "Following" button uses grayscale tokens --gray-100 / --gray-225 (Step 0.8), no raw hex.
   ========================================================================== */
.follow-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.875rem;
    align-items: start;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}
@media (max-width: 1199px) {
    .follow-cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
    .follow-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .follow-cards-grid { grid-template-columns: minmax(0, 1fr); }
}

.follow-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.follow-card-banner {
    aspect-ratio: 13 / 9;
    background-size: cover;
    background-position: center;
}
.follow-card-banner--placeholder {
    background-color: var(--gray-200);
}

.follow-card-body {
    padding: 0 1rem 1rem;
    margin-top: -58px; /* deeper overlap for the 94px avatar straddling the banner edge */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.follow-card-link { display: block; text-decoration: none; color: inherit; }
.follow-card-link:hover { text-decoration: none; }

.follow-card-btn-wrap { padding: 0 30px 30px; }

.follow-card-avatar {
    width: 94px;
    height: 94px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    background: var(--gray-100);
}
.follow-card-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

.follow-card-name {
    margin: 0.8rem 0px 0;
    font-size: 24px;
    font-weight: 500;
    color: var(--gray-800);
    text-align: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-card-bio {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--gray-500);
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em; /* reserve ~2 lines so empty-bio cards keep uniform height */
}

/* Shared geometry so the dark "Follow" and greyed "Following" states are IDENTICAL
   in size, padding, and border-radius — only the colors differ. Matches the dark
   .btn-primary (padding 14px 28px, 50px pill, 1px border box) so both states line up. */
.follow-card-btn {
    width: 100%;
    padding: 10px 28px;
    border-radius: 10px;
    border: 1px solid transparent; /* reserve the border box so --following's border doesn't resize */
    font-weight: 600;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.follow-card-btn--following {
    /* State override: colors only — geometry comes from .follow-card-btn above. */
    background-color: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-700);
}
.follow-card-btn--following:hover {
    background-color: var(--gray-225);
}

.follow-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}
