/* Profile Layout - Split Layout Foundation
 * PlayStation Trophy-style split layout
 * Left: Showcase Sidebar (28%)
 * Right: Activity Feed (72%)
 * Mobile: Tab-based switching
 */

/* ============================================
   LAYOUT VARIABLES
   ============================================ */
:root {
    --profile-sidebar-width: 28%;
    --profile-main-width: 72%;
    --profile-gap: 1.5rem;
    --profile-section-spacing: 1.5rem;
}

/* ============================================
   PROFILE MAIN CONTAINER
   ============================================ */
.profile-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============================================
   SPLIT LAYOUT (DESKTOP)
   ============================================ */
.profile-split {
    display: grid;
    grid-template-columns: var(--profile-sidebar-width) var(--profile-main-width);
    gap: var(--profile-gap);
    align-items: start;
}

.profile-sidebar {
    position: sticky;
    top: calc(var(--navbar-height, 60px) + 1rem);
    max-height: calc(100vh - var(--navbar-height, 60px) - 2rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-border-color) transparent;
}

.profile-sidebar::-webkit-scrollbar {
    width: 4px;
}

.profile-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.profile-sidebar::-webkit-scrollbar-thumb {
    background: var(--theme-border-color);
    border-radius: 4px;
}

.profile-main {
    min-width: 0; /* Prevent grid blowout */
}

/* ============================================
   MOBILE TAB SYSTEM
   ============================================ */
.profile-tabs {
    display: none;
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border-color);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1rem;
}

.profile-tabs__list {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-tab {
    flex: 1 1 0; /* Equal width regardless of content */
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--theme-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.profile-tab:hover {
    background: var(--theme-surface-2);
    color: var(--theme-text-primary);
}

.profile-tab--active {
    background: var(--theme-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.profile-tab__icon {
    font-size: 1rem;
}

/* Tab content panels */
.profile-tab-content {
    display: block;
}

.profile-tab-panel {
    display: block;
}

.profile-tab-panel[hidden] {
    display: none;
}

/* ============================================
   SECTION SPACING
   ============================================ */
.profile-section {
    margin-bottom: var(--profile-section-spacing);
}

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

/* Section dividers */
.profile-divider {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--theme-border-color),
        transparent
    );
    margin: var(--profile-section-spacing) 0;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Large tablets and smaller desktops */
@media (max-width: 1199px) {
    :root {
        --profile-sidebar-width: 32%;
        --profile-main-width: 68%;
    }
}

/* Tablets */
@media (max-width: 991px) {
    :root {
        --profile-sidebar-width: 35%;
        --profile-main-width: 65%;
        --profile-gap: 1rem;
    }
}

/* Mobile breakpoint - switch to tabs */
@media (max-width: 767px) {
    .profile-split {
        display: block;
    }

    .profile-tabs {
        display: block;
    }

    .profile-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }

    /* Hide sidebar on mobile when Activity tab is active */
    .profile-tabs--activity-active .profile-sidebar {
        display: none;
    }

    /* Hide main on mobile when Showcase tab is active */
    .profile-tabs--showcase-active .profile-main {
        display: none;
    }

    /* Full width on mobile */
    .profile-sidebar,
    .profile-main {
        width: 100%;
    }
}

/* Small mobile */
@media (max-width: 375px) {
    .profile-container {
        padding: 0 0.5rem;
    }

    .profile-tab {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   HERO SECTION (FULL WIDTH ABOVE SPLIT)
   ============================================ */
.profile-hero-wrapper {
    width: 100%;
    margin-bottom: var(--profile-section-spacing);
}

/* Stats tiles can go below hero or inside sidebar depending on context */
.profile-stats-wrapper {
    width: 100%;
    margin-bottom: var(--profile-section-spacing);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Desktop only visibility */
.profile-desktop-only {
    display: block;
}

@media (max-width: 767px) {
    .profile-desktop-only {
        display: none !important;
    }
}

/* Mobile only visibility */
.profile-mobile-only {
    display: none;
}

@media (max-width: 767px) {
    .profile-mobile-only {
        display: block !important;
    }
}

/* ============================================
   DARK MODE REFINEMENTS
   ============================================ */
[data-bs-theme="dark"] .profile-tabs,
body.dark-mode .profile-tabs {
    background: var(--theme-surface-2);
    border-color: var(--theme-border-color);
}

[data-bs-theme="dark"] .profile-tab:hover,
body.dark-mode .profile-tab:hover {
    background: var(--theme-surface-3);
}

[data-bs-theme="dark"] .profile-sidebar,
body.dark-mode .profile-sidebar {
    scrollbar-color: var(--theme-text-muted) transparent;
}
