/**
 * User Profile Styles
 * ÇiftçidenEve - Modern Profile Page Design
 * Created: 2026-01-25
 */

/* =============================================================================
   CSS Variables
   ============================================================================= */

:root {
    /* Hero Section */
    --profile-hero-height: 280px;
    --profile-hero-height-tablet: 220px;
    --profile-hero-height-mobile: 180px;

    /* Avatar */
    --profile-avatar-size: 140px;
    --profile-avatar-size-tablet: 120px;
    --profile-avatar-size-mobile: 100px;
    --profile-avatar-border-width: 4px;
    --profile-avatar-offset: -70px;

    /* Tab Navigation */
    --profile-tab-height: 52px;
    --profile-tab-sticky-top: 70px;

    /* Mobile Action Bar */
    --profile-mobile-bar-height: 64px;

    /* Colors */
    --profile-primary: #1A6355;
    --profile-accent: #b9475e;
    --profile-accent-hover: #e79275;

    /* Section Spacing */
    --profile-section-padding: 40px;
    --profile-section-padding-mobile: 24px;
}

/* =============================================================================
   Profile Container
   ============================================================================= */

.user-profile {
    background: #fff;
    min-height: 100vh;
}

.user-profile * {
    box-sizing: border-box;
}

/* =============================================================================
   Hero Section
   ============================================================================= */

.profile-hero {
    position: relative;
    width: 100%;
    height: var(--profile-hero-height);
    overflow: visible;
}

.profile-hero__cover {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #e6e6e6;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Cover Overlay */
.profile-hero__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

/* =============================================================================
   Profile Info Bar
   ============================================================================= */

.profile-info-bar {
    position: relative;
    max-width: 1230px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: var(--profile-avatar-offset);
    z-index: 10;
}

/* Avatar */
.profile-hero__avatar {
    position: relative;
    flex-shrink: 0;
    width: var(--profile-avatar-size);
    height: var(--profile-avatar-size);
    border-radius: 50%;
    border: var(--profile-avatar-border-width) solid #fff;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    overflow: hidden;
}

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

/* Profile Details */
.profile-hero__details {
    flex: 1;
    padding-top: calc(var(--profile-avatar-size) / 2 + 20px);
    min-width: 0;
}

.profile-hero__name {
    margin: 0 0 4px 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 32px;
    font-weight: 600;
    color: #1A6355;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-hero__username {
    font-size: 15px;
    color: #7d91a3;
    margin-bottom: 8px;
}

.profile-hero__location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #7d91a3;
    margin-bottom: 12px;
}

.profile-hero__location i {
    color: var(--profile-primary);
}

/* =============================================================================
   Stats Bar
   ============================================================================= */

.profile-hero__stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.profile-stat__value {
    font-size: 20px;
    font-weight: 600;
    color: #1A6355;
}

.profile-stat__label {
    font-size: 12px;
    color: #7d91a3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-stat__divider {
    width: 1px;
    height: 32px;
    background: #e6e6e6;
}

/* =============================================================================
   Bio Section
   ============================================================================= */

.profile-hero__bio {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.6;
    color: #4D4D4D;
    max-width: 600px;
}

.profile-hero__bio p {
    margin: 0 0 8px 0;
}

.profile-hero__bio p:last-child {
    margin-bottom: 0;
}

/* =============================================================================
   Seller Badge
   ============================================================================= */

.profile-seller-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #FFF3E5 0%, #fff 100%);
    border: 1px solid #f0e6dc;
    border-radius: 8px;
    margin-top: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.profile-seller-badge:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.profile-seller-badge__avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.profile-seller-badge__info {
    display: flex;
    flex-direction: column;
}

.profile-seller-badge__label {
    font-size: 11px;
    color: #7d91a3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-seller-badge__name {
    font-size: 14px;
    font-weight: 600;
    color: #1A6355;
}

.profile-seller-badge__arrow {
    color: #c8c0bb;
    font-size: 12px;
}

/* =============================================================================
   Action Buttons
   ============================================================================= */

.profile-hero__actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    padding-top: calc(var(--profile-avatar-size) / 2 + 20px);
}

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

.profile-hero__action-btn--primary {
    background: var(--profile-accent);
    color: #fff;
}

.profile-hero__action-btn--primary:hover {
    background: var(--profile-accent-hover);
}

.profile-hero__action-btn--secondary {
    background: #fff;
    color: var(--profile-primary);
    border: 2px solid var(--profile-primary);
}

.profile-hero__action-btn--secondary:hover {
    background: var(--profile-primary);
    color: #fff;
}

.profile-hero__action-btn--following {
    background: var(--profile-primary);
    color: #fff;
    border: 2px solid var(--profile-primary);
}

.profile-hero__action-btn--following:hover {
    background: transparent;
    color: var(--profile-primary);
}

/* =============================================================================
   Sticky Tab Navigation
   ============================================================================= */

.profile-tabs {
    position: sticky;
    top: var(--profile-tab-sticky-top);
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
    margin-top: 24px;
}

.profile-tabs__container {
    max-width: 1230px;
    margin: 0 auto;
    padding: 0 20px;
}

.profile-tabs__list {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.profile-tabs__list::-webkit-scrollbar {
    display: none;
}

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

.profile-tabs__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #7d91a3;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.profile-tabs__link:hover {
    color: var(--profile-primary);
}

.profile-tabs__link.active {
    color: var(--profile-primary);
    border-bottom-color: var(--profile-primary);
}

.profile-tabs__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #f3f3f3;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #595959;
}

.profile-tabs__link.active .profile-tabs__count {
    background: var(--profile-primary);
    color: #fff;
}

/* =============================================================================
   Content Sections
   ============================================================================= */

.profile-content {
    max-width: 1230px;
    margin: 0 auto;
    padding: var(--profile-section-padding) 20px;
}

.profile-section {
    scroll-margin-top: calc(var(--profile-tab-sticky-top) + var(--profile-tab-height) + 20px);
}

.profile-section__title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #1A6355;
    margin: 0 0 24px 0;
}

/* =============================================================================
   Mobile Action Bar
   ============================================================================= */

.profile-mobile-actions {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--profile-mobile-bar-height);
    background: #fff;
    border-top: 1px solid #e6e6e6;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

.profile-mobile-actions__container {
    display: flex;
    gap: 12px;
    height: 100%;
}

.profile-mobile-actions__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.profile-mobile-actions__btn--primary {
    background: var(--profile-accent);
    color: #fff;
}

.profile-mobile-actions__btn--secondary {
    background: #f3f3f3;
    color: var(--profile-primary);
}

/* =============================================================================
   Edit Buttons (Own Profile)
   ============================================================================= */

.profile-hero__edit-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.profile-hero__edit-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.profile-hero__edit-cover {
    bottom: 16px;
    right: 16px;
}

.profile-hero__edit-avatar {
    bottom: 4px;
    right: 4px;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.profile-hero__upload-input {
    display: none;
}

/* Reposition buttons */
.profile-hero__reposition-btns {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: none;
    gap: 8px;
}

.profile-hero__reposition-btns.active {
    display: flex;
}

.profile-hero__reposition-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.profile-hero__reposition-btn--cancel {
    background: rgba(255, 255, 255, 0.9);
    color: #595959;
}

.profile-hero__reposition-btn--save {
    background: var(--profile-accent);
    color: #fff;
}

/* =============================================================================
   Rating Display
   ============================================================================= */

.profile-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.profile-rating__stars {
    display: flex;
    gap: 2px;
    color: #f5a623;
}

.profile-rating__value {
    font-weight: 600;
    color: #1A6355;
}

.profile-rating__count {
    font-size: 13px;
    color: #7d91a3;
}

/* =============================================================================
   Responsive - Tablet
   ============================================================================= */

@media (max-width: 1050px) {
    :root {
        --profile-hero-height: var(--profile-hero-height-tablet);
        --profile-avatar-size: var(--profile-avatar-size-tablet);
        --profile-avatar-offset: -60px;
    }

    .profile-info-bar {
        flex-wrap: wrap;
    }

    .profile-hero__actions {
        width: 100%;
        padding-top: 16px;
        justify-content: flex-start;
    }

    .profile-hero__name {
        font-size: 28px;
    }
}

/* =============================================================================
   Responsive - Mobile
   ============================================================================= */

@media (max-width: 670px) {
    :root {
        --profile-hero-height: var(--profile-hero-height-mobile);
        --profile-avatar-size: var(--profile-avatar-size-mobile);
        --profile-avatar-offset: -50px;
        --profile-tab-sticky-top: 56px;
        --profile-section-padding: var(--profile-section-padding-mobile);
    }

    .profile-info-bar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 0 16px;
    }

    .profile-hero__avatar {
        margin-top: 0;
    }

    .profile-hero__details {
        padding-top: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .profile-hero__name {
        font-size: 24px;
        justify-content: center;
    }

    .profile-hero__location {
        justify-content: center;
    }

    .profile-hero__stats {
        justify-content: center;
    }

    .profile-hero__bio {
        text-align: center;
    }

    .profile-seller-badge {
        justify-content: center;
    }

    /* Hide desktop actions, show mobile bar */
    .profile-hero__actions {
        display: none;
    }

    .profile-mobile-actions {
        display: block;
    }

    /* Add bottom padding for mobile action bar */
    .user-profile {
        padding-bottom: var(--profile-mobile-bar-height);
    }

    /* Tabs */
    .profile-tabs {
        margin-top: 16px;
    }

    .profile-tabs__container {
        padding: 0 12px;
    }

    .profile-tabs__link {
        padding: 14px 16px;
        font-size: 13px;
    }

    .profile-tabs__count {
        min-width: 20px;
        height: 20px;
        font-size: 11px;
    }

    /* Content */
    .profile-content {
        padding: 20px 16px;
    }

    .profile-section__title {
        font-size: 20px;
    }

    /* Edit buttons */
    .profile-hero__edit-cover {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .profile-hero__edit-cover span {
        display: none;
    }

    .profile-hero__edit-avatar {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
}

/* =============================================================================
   Animation / Reveal
   ============================================================================= */

.profile-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.profile-reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
.profile-reveal[data-delay="1"] { transition-delay: 0.1s; }
.profile-reveal[data-delay="2"] { transition-delay: 0.2s; }
.profile-reveal[data-delay="3"] { transition-delay: 0.3s; }
.profile-reveal[data-delay="4"] { transition-delay: 0.4s; }

/* =============================================================================
   Prominent Seller Badge
   ============================================================================= */

.profile-seller-badge--prominent {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #1A6355 0%, #2a8571 100%);
    border: none;
    border-radius: 10px;
    margin: 8px 0 12px 0;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(26, 99, 85, 0.25);
}

.profile-seller-badge--prominent:hover {
    box-shadow: 0 4px 16px rgba(26, 99, 85, 0.35);
    transform: translateY(-2px);
}

.profile-seller-badge--prominent .profile-seller-badge__avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-seller-badge--prominent .profile-seller-badge__label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-seller-badge--prominent .profile-seller-badge__name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.profile-seller-badge--prominent .profile-seller-badge__arrow {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    transition: transform 0.2s ease;
}

.profile-seller-badge--prominent:hover .profile-seller-badge__arrow {
    transform: translateX(3px);
}

/* =============================================================================
   Bio Read More Toggle
   ============================================================================= */

.profile-bio__content {
    display: inline;
}

.profile-bio__text {
    display: inline;
}

.profile-bio__toggle {
    display: inline-block;
    margin-top: 8px;
    padding: 0;
    background: none;
    border: none;
    color: var(--profile-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.profile-bio__toggle:hover {
    color: var(--profile-accent);
}

.profile-bio__toggle-more,
.profile-bio__toggle-less {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.profile-bio__toggle-more::after {
    content: '↓';
    font-size: 12px;
}

.profile-bio__toggle-less::after {
    content: '↑';
    font-size: 12px;
}

/* =============================================================================
   Custom Tab Items (Menu Widgets)
   ============================================================================= */

.profile-tabs__item--custom {
    flex-shrink: 0;
}

/* Style the anchor inside custom widgets to match other tabs */
.profile-tabs__item--custom a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #7d91a3;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.profile-tabs__item--custom a:hover {
    color: var(--profile-primary);
}

.profile-tabs__item--custom a.active {
    color: var(--profile-primary);
    border-bottom-color: var(--profile-primary);
}

/* Handle widgets that render with span or other elements */
.profile-tabs__item--custom > span,
.profile-tabs__item--custom > div {
    display: flex;
}

.profile-tabs__item--custom > span > a,
.profile-tabs__item--custom > div > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #7d91a3;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.profile-tabs__item--custom > span > a:hover,
.profile-tabs__item--custom > div > a:hover {
    color: var(--profile-primary);
}

/* Mobile styles for custom tabs */
@media (max-width: 670px) {
    .profile-tabs__item--custom a,
    .profile-tabs__item--custom > span > a,
    .profile-tabs__item--custom > div > a {
        padding: 14px 16px;
        font-size: 13px;
    }

    .profile-seller-badge--prominent {
        padding: 8px 14px;
        margin: 6px 0 10px 0;
    }

    .profile-seller-badge--prominent .profile-seller-badge__avatar {
        width: 38px;
        height: 38px;
    }

    .profile-seller-badge--prominent .profile-seller-badge__name {
        font-size: 14px;
    }

    .profile-bio__toggle {
        display: block;
        margin-top: 10px;
        text-align: center;
    }
}
