/*
 * Profile Styles
 * Profile page and related components
 */

/* Profile Page */
.profile-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.profile-header-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 50px;
    background: #0A0A0A;
    padding: 20px 28px;
    border-radius: 16px;
    gap: 0;
}

.profile-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.profile-header-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar-large {
    position: relative;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    --progress: 54;
}

.profile-avatar-large::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        conic-gradient(from 270deg at 50% 50%,
            #ff4d4d calc(var(--progress) * 1%),
            #ff4d4d calc(var(--progress) * 1%),
            #3a3a4a calc(var(--progress) * 1%),
            #3a3a4a 100%);
    transform: rotate(-90deg);
    z-index: 1;
}

.profile-avatar-large::after {
    content: '';
    position: absolute;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    border-radius: 50%;
    background: #1a1d23;
    z-index: 2;
}

.profile-avatar-large img {
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    border-radius: 50%;
    object-fit: cover;
    border: none;
    position: relative;
    z-index: 3;
}

.profile-avatar-initial {
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    position: relative;
    z-index: 3;
    font-family: 'Poppins', sans-serif;
}

.profile-online-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border: 3px solid #1a1d23;
    border-radius: 50%;
    z-index: 4;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.profile-edit-badge {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff0000;
    color: white;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 500;
    z-index: 4;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-name-row h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: white;
    white-space: nowrap;
}

.profile-name-row .verified-icon {
    flex-shrink: 0;
}

.profile-star-badge {
    font-size: 16px;
    flex-shrink: 0;
}

/* Action Buttons */
.profile-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-profile-action {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-profile-action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-profile-action svg {
    flex-shrink: 0;
    opacity: 0.85;
}

/* More Menu */
.profile-more-menu-wrapper {
    position: relative;
}

.btn-profile-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-profile-more:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.profile-more-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #2a2d35;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 0;
    min-width: 130px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
}

.profile-more-dropdown.show {
    display: block;
}

.profile-more-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #d1d5db;
    font-size: 14px;
    padding: 10px 18px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Poppins', sans-serif;
}

.profile-more-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Stats Bar */
.profile-stats-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding-top: 0;
    padding-left: 110px;
    width: 100%;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 14px;
}

.profile-stat .stat-number {
    font-size: 15px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.profile-stat .stat-label {
    font-size: 11px;
    color: #8b8f96;
    white-space: nowrap;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-stats-row {
    display: flex;
    gap: 24px;
}

.profile-header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.profile-header-right {
    display: flex;
    gap: 12px;
}

.btn-verify {
    background: transparent;
    border: 1px solid #444;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
}

.btn-verify:hover {
    border-color: #666;
    background: rgba(255, 255, 255, 0.05);
}

.btn-complete-profile {
    background: transparent;
    border: 1px solid #444;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
}

.btn-complete-profile:hover {
    border-color: #666;
    background: rgba(255, 255, 255, 0.05);
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 50px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.profile-tab {
    background: transparent;
    border: 1px solid #333;
    color: #9ca3af;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    transition: all 0.2s;
}

.profile-tab:hover {
    border-color: #555;
    color: white;
}

.profile-tab.active {
    background: #ff0000;
    border-color: #ff0000;
    color: white;
}

/* Profile Content Layout */
.profile-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* Profile Sidebar */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #FFFFFF0A;
    padding: 24px;
    border-radius: 16px;
}

.profile-card {
    background: transparent;
    padding: 0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.card-title.text-red {
    color: #ff4d4d;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #d1d5db;
    font-size: 13px;
}

.contact-item svg {
    color: #9ca3af;
    flex-shrink: 0;
}

.about-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about-item {
    display: flex;
    font-size: 13px;
}

.about-label {
    color: #9ca3af;
    min-width: auto;
    margin-right: 6px;
}

.about-value {
    color: white;
}

.description-text {
    color: #d1d5db;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

.see-more {
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.plan-card-sidebar {
    background: linear-gradient(229.44deg, rgba(255, 0, 0, 0.2) 3.21%, rgba(255, 0, 0, 0.136) 14.33%, rgba(255, 0, 0, 0.08) 32.1%, rgba(255, 0, 0, 0.02) 73.44%, rgba(255, 0, 0, 0) 95.66%);
    border: 1px solid #3a0d0d;
    border-radius: 16px;
    padding: 20px;
    margin-top: 10px;
}

.plan-label-sidebar {
    color: #ff4d4d;
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 10px 0;
}

.plan-name-sidebar {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

/* Profile Main Content */
.profile-main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: calc(1200px - 355px);
}

.content-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 18px;
}

.section-title-profile {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title-profile span {
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.empty-content-box {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-content-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #444;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
}

.add-content-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #666;
}

/* Profile Page Responsive */
@media (max-width: 900px) {
    .profile-content {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        order: 2;
    }

    .profile-main-content {
        order: 1;
        width: 90dvw !important;
    }

    .gallery-albums-grid,
    .gallery-media-grid {
        width: 90%;
    }

    .friends-search-container {
        width: max-content;
    }
}

@media (max-width: 600px) {
    .profile-page {
        padding: 16px;
    }

    .profile-header-section {
        padding: 16px;
        margin-bottom: 24px;
        border-radius: 12px;
    }

    .profile-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .profile-header-user {
        gap: 14px;
    }

    .profile-avatar-large {
        width: 70px;
        height: 70px;
    }

    .profile-name-row {
        flex-wrap: wrap;
    }

    .profile-name-row h1 {
        font-size: 18px;
    }

    .profile-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .btn-profile-action {
        flex: 1;
        justify-content: center;
        padding: 8px 12px;
        font-size: 12px;
    }

    .profile-stats-bar {
        padding-left: 0;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: flex-start;
        margin-top: 12px;
    }

    .profile-stat {
        padding: 4px 10px;
    }

    .profile-stat .stat-number {
        font-size: 14px;
    }

    .profile-stat .stat-label {
        font-size: 10px;
    }

    .profile-tabs {
        gap: 6px;
        margin-bottom: 24px;
    }

    .profile-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Gallery Albums */
.gallery-albums {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.album-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
    transition: transform 0.3s ease;
}

.album-card:hover {
    transform: translateY(-4px);
}

.album-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.album-info {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
}

.album-name {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
}

.album-count {
    color: #9ca3af;
    font-size: 12px;
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
    transition: transform 0.3s ease;
}

.media-item:hover {
    transform: translateY(-4px);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-item:hover .media-overlay {
    opacity: 1;
}

.media-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-play-icon svg {
    color: white;
    margin-left: 4px;
}

/* Friends Grid */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    row-gap: 74px;
    padding-top: 40px;
}

@media (max-width: 1200px) {
    .friends-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .friends-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .friends-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

.friend-card {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    margin-top: 30px;
}

.friend-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.friend-avatar-container {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.friend-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #1a1a1a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.friend-status-dot {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 16px;
    height: 16px;
    background: #22c55e;
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.friend-card-content {
    width: 100%;
    text-align: left;
    margin-top: 64px;
}

.friend-name {
    font-size: 20px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.friend-handle {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.friend-status {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 16px;
}

.friend-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.friend-action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.friend-action-btn.primary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.friend-action-btn.primary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.friend-action-btn.secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
}

.friend-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Follow Tab */
.follow-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
}

.follow-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.follow-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.follow-subtab {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid #333;
    background: transparent;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.follow-subtab:hover {
    border-color: #555;
    color: white;
}

.follow-subtab.active {
    background: #ff0000;
    border-color: #ff0000;
    color: white;
}

.follow-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.follow-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
}

.follow-user-info {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    flex-direction: column;
}

.follow-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.follow-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.follow-user-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.follow-user-handle {
    color: #9ca3af;
    font-size: 13px;
}

.follow-actions {
    display: flex;
    gap: 8px;
}

.follow-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 900px) {
    .follow-content {
        grid-template-columns: 1fr;
    }

    .follow-sidebar {
        order: 2;
    }
}

/* Carousel Scroll Fix */
.custom-carousel-track {
    overflow-x: auto !important;
    display: flex;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.custom-carousel-track::-webkit-scrollbar {
    display: none;
}

@media (max-width: 900px) {
    .profile-page .carousel-window {
        overflow: visible !important;
        /* Allow track to handle scroll surface */
        /* width: 100%; */
        /* margin-right: -30px; */
        padding-right: 0;
    }

    .custom-carousel-track {
        transform: none !important;
        /* Disable JS transform on mobile */
        width: 100%;
        gap: 16px;
        padding-right: 20px;
        display: flex;
        /* Ensure flex */
        flex-wrap: nowrap;
        /* Prevent wrapping */
    }

    .custom-carousel-track>* {
        min-width: 85%;
        flex: 0 0 85%;
        max-width: 85%;
    }

    .carousel-container-profile .carousel-btn {
        display: flex !important;
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        z-index: 100;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        pointer-events: auto !important;
        position: absolute;
        background: rgba(0, 0, 0, 0.6);
    }

    .carousel-container-profile .carousel-prev {
        left: 5px !important;
    }

    .carousel-container-profile .carousel-next {
        right: 5px !important;
    }
}

/* More Dropdown Styles */
.profile-more-dropdown-wrapper {
    position: relative;
    display: none;
    margin-left: auto;
}

.more-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
    margin-top: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.more-dropdown-menu.show {
    display: flex;
    animation: fadeInDropdown 0.2s ease-out;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-tab-item {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-tab-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.dropdown-tab-item.active {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
    font-weight: 600;
}

.more-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1a1a1a;
    border-color: #333;
}

.more-btn.active {
    background: #ff4d4d;
    border-color: #ff4d4d;
    color: white;
}

@media (max-width: 900px) {
    .desktop-only-tab {
        display: none !important;
    }

    .profile-more-dropdown-wrapper {
        display: block;
    }

    .profile-tabs {
        overflow-x: visible !important;
        padding-right: 0;
    }
}