/*
 * LUMINA PROFILE STANDARD v1.0
 * One unified, responsive layout contract for EVERY profile in LUMINA (existing, dynamic, and new).
 * Reference Profile: /mariusz
 *
 * Contract:
 * - Cover: Master 1920x640 (3:1 aspect ratio), fluid responsive height, central Safe Zone (640x640)
 * - Avatar: 1:1 circle, object-fit: cover, object-position: center, uniform LUMINA border & gold glow
 *   - Desktop: 160x160 px (-80px cover overlap)
 *   - Tablet (769px-1024px): 128x128 px (-64px cover overlap)
 *   - Mobile (<=768px): 96x96 px (-48px cover overlap)
 *   - Small Mobile (<=360px): min 88x88 px (-44px cover overlap)
 * - Layout: Cover -> Avatar overlapping cover edge -> Name & details & actions
 * - Safe: No horizontal overflow, zero collisions, accessible fallbacks
 */

html body.lumina-profile-standard {
    --profile-shell-width: 1200px;
    --profile-page-gutter: clamp(12px, 2.4vw, 24px);
    --profile-card-radius: 20px;
    --gold-accent: #d4a94a;
    --gold-glow: rgba(212, 169, 74, 0.35);
    --navy-dark: #070e24;
    --navy-card: #0b1838;
    --navy-border: rgba(255, 255, 255, 0.1);
    overflow-x: clip !important;
}

body.lumina-profile-standard .profile-container {
    box-sizing: border-box !important;
    width: min(100%, var(--profile-shell-width)) !important;
    max-width: var(--profile-shell-width) !important;
    margin-inline: auto !important;
    padding: 0 var(--profile-page-gutter) 88px !important;
    overflow-x: clip !important;
}

body.lumina-profile-standard #profilePublicView {
    width: 100% !important;
    min-width: 0 !important;
}

/* ══════════ 1. PROFILE COVER (STANDARD 3:1) ══════════ */
body.lumina-profile-standard .cover-wrapper,
body.lumina-profile-standard .profile-hero > div:first-child,
body.lumina-profile-standard .lumina-profile-cover {
    box-sizing: border-box !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 540px !important;
    aspect-ratio: 3 / 1 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 0 0 var(--profile-card-radius) var(--profile-card-radius) !important;
    background: #080d1a !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4) !important;
}

body.lumina-profile-standard .cover-photo,
body.lumina-profile-standard .cover-video,
body.lumina-profile-standard .cover-video-iframe,
body.lumina-profile-standard .hero-cover,
body.lumina-profile-standard .lumina-profile-cover img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
}

/* ══════════ 2. PROFILE HEAD CARD & LAYOUT ══════════ */
body.lumina-profile-standard .profile-head-card,
body.lumina-profile-standard .hero-info-bar,
body.lumina-profile-standard .lumina-profile-head-card {
    box-sizing: border-box !important;
    position: relative !important;
    width: calc(100% - 40px) !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 0 24px 24px !important;
    overflow: visible !important;
    border-radius: var(--profile-card-radius) !important;
    z-index: 10 !important;
}

body.lumina-profile-standard .profile-head-top,
body.lumina-profile-standard .profile-head-main {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    gap: 20px !important;
}

/* ══════════ 3. PROFILE AVATAR (1:1, CIRCLE, 160x160 DESKTOP) ══════════ */
body.lumina-profile-standard .avatar-wrap,
body.lumina-profile-standard .hero-avatar-wrap,
body.lumina-profile-standard .head-avatar-wrapper,
body.lumina-profile-standard .profile-avatar-wrap,
body.lumina-profile-standard .lumina-profile-avatar-wrap {
    box-sizing: border-box !important;
    position: relative !important;
    width: 160px !important;
    height: 160px !important;
    min-width: 160px !important;
    min-height: 160px !important;
    flex: 0 0 160px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    margin-top: -80px !important;
    margin-bottom: 0 !important;
    background: #091228 !important;
    border: 4px solid #070e24 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(212, 169, 74, 0.25) !important;
    overflow: visible !important;
    z-index: 15 !important;
}

body.lumina-profile-standard .avatar-img,
body.lumina-profile-standard .hero-avatar-img,
body.lumina-profile-standard .profile-avatar-img,
body.lumina-profile-standard .lumina-profile-avatar {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
}

/* ══════════ 4. USER DETAILS & TYPOGRAPHY ══════════ */
body.lumina-profile-standard .head-user-details,
body.lumina-profile-standard .hero-details {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    text-align: left !important;
    padding-top: 12px !important;
}

body.lumina-profile-standard .head-user-name,
body.lumina-profile-standard .hero-name {
    justify-content: flex-start !important;
    max-width: 100% !important;
    margin: 0 0 8px !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

body.lumina-profile-standard .head-user-tagline,
body.lumina-profile-standard .hero-role,
body.lumina-profile-standard .hero-location {
    justify-content: flex-start !important;
    max-width: 100% !important;
    gap: 7px !important;
}

/* ══════════ 5. ACTION BUTTONS ══════════ */
body.lumina-profile-standard .head-actions,
body.lumina-profile-standard .hero-actions {
    box-sizing: border-box !important;
    display: flex !important;
    flex-flow: row wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 18px 0 0 !important;
    padding: 16px 0 0 !important;
    gap: 9px !important;
    overflow: visible !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.lumina-profile-standard .head-actions > button,
body.lumina-profile-standard .head-actions > a,
body.lumina-profile-standard .hero-actions > button,
body.lumina-profile-standard .hero-actions > a {
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 42px !important;
    max-width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    flex: 0 0 auto !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    color: #fff !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
}

body.lumina-profile-standard .head-actions > button i,
body.lumina-profile-standard .head-actions > a i,
body.lumina-profile-standard .hero-actions > button i,
body.lumina-profile-standard .hero-actions > a i {
    flex: 0 0 auto !important;
    margin: 0 !important;
    font-size: 1rem !important;
    color: currentColor !important;
}

body.lumina-profile-standard .head-actions .btn-text,
body.lumina-profile-standard .head-actions #followBtnText,
body.lumina-profile-standard .head-actions #followCountBadge,
body.lumina-profile-standard .head-actions #heartBtnText,
body.lumina-profile-standard .head-actions #heartCountBadge,
body.lumina-profile-standard .head-actions .btn-divider {
    display: inline !important;
    color: inherit !important;
    font-size: inherit !important;
}

body.lumina-profile-standard .head-actions .btn-action-gear,
body.lumina-profile-standard .head-actions .btn-action-share,
body.lumina-profile-standard .head-actions .btn-action-logout,
body.lumina-profile-standard .head-actions .btn-action-more {
    width: 42px !important;
    padding: 0 !important;
    border-radius: 50% !important;
}

body.lumina-profile-standard .profile-nav-tabs {
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 16px 0 0 !important;
    padding: 8px 0 0 !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin !important;
}

body.lumina-profile-standard .profile-nav-tabs .tab-btn {
    box-sizing: border-box !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    flex: 0 0 auto !important;
    padding: 0 14px !important;
    border-radius: 12px !important;
    font-size: 0.78rem !important;
    color: #94a3b8 !important;
}

body.lumina-profile-standard .profile-nav-tabs .tab-btn i,
body.lumina-profile-standard .profile-nav-tabs .tab-btn .tab-text {
    display: inline !important;
    color: inherit !important;
    font-size: inherit !important;
}

body.lumina-profile-standard .profile-nav-tabs .tab-btn.active {
    color: #facc15 !important;
}

body.lumina-profile-standard .profile-body-grid {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) !important;
    align-items: start !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 20px !important;
    margin-top: 20px !important;
}

body.lumina-profile-standard .founder-3col {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(220px, 280px) !important;
    align-items: start !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 18px !important;
    margin-top: 20px !important;
}

body.lumina-profile-standard .profile-body-grid > *,
body.lumina-profile-standard .founder-3col > *,
body.lumina-profile-standard .center-founder-feed,
body.lumina-profile-standard .left-founder-wing,
body.lumina-profile-standard .right-founder-wing {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.lumina-profile-standard .post-card,
body.lumina-profile-standard .sidebar-card {
    box-sizing: border-box !important;
    max-width: 100% !important;
    border-radius: var(--profile-card-radius) !important;
}

body.lumina-profile-standard :is(button, a, input, textarea, select):focus-visible {
    outline: 3px solid #facc15 !important;
    outline-offset: 3px !important;
}

/* ══════════ 6. TABLET RESPONSIVENESS (769px - 1024px) ══════════ */
@media (min-width: 769px) and (max-width: 1024px) {
    body.lumina-profile-standard .cover-wrapper,
    body.lumina-profile-standard .profile-hero > div:first-child,
    body.lumina-profile-standard .lumina-profile-cover {
        aspect-ratio: 3 / 1 !important;
        min-height: 220px !important;
    }

    body.lumina-profile-standard .avatar-wrap,
    body.lumina-profile-standard .hero-avatar-wrap,
    body.lumina-profile-standard .lumina-profile-avatar-wrap {
        width: 128px !important;
        height: 128px !important;
        min-width: 128px !important;
        min-height: 128px !important;
        flex: 0 0 128px !important;
        margin-top: -64px !important;
    }

    body.lumina-profile-standard .founder-3col {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.lumina-profile-standard .center-founder-feed {
        order: 1 !important;
    }

    body.lumina-profile-standard .left-founder-wing {
        order: 2 !important;
    }

    body.lumina-profile-standard .right-founder-wing {
        order: 3 !important;
    }
}

@media (max-width: 1100px) {
    body.lumina-profile-standard .founder-3col {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.lumina-profile-standard .center-founder-feed {
        order: 1 !important;
    }

    body.lumina-profile-standard .left-founder-wing {
        order: 2 !important;
    }

    body.lumina-profile-standard .right-founder-wing {
        order: 3 !important;
    }
}

/* ══════════ 7. MOBILE RESPONSIVENESS (<= 768px) ══════════ */
@media (max-width: 768px) {
    html body.lumina-profile-standard {
        --profile-page-gutter: 10px;
        --profile-card-radius: 18px;
        overflow-x: clip !important;
        padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.lumina-profile-standard .profile-container {
        padding: 0 var(--profile-page-gutter) calc(88px + env(safe-area-inset-bottom, 0px)) !important;
        overflow-x: clip !important;
    }

    /* Mobile Cover: prioritizes central 640x640 safe-zone without stretching */
    body.lumina-profile-standard .cover-wrapper,
    body.lumina-profile-standard .profile-hero > div:first-child,
    body.lumina-profile-standard .lumina-profile-cover {
        aspect-ratio: 16 / 7 !important;
        min-height: 160px !important;
        max-height: 240px !important;
        border-radius: 0 0 16px 16px !important;
    }

    body.lumina-profile-standard .profile-head-card,
    body.lumina-profile-standard .hero-info-bar,
    body.lumina-profile-standard .lumina-profile-head-card {
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 16px 20px !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 10 !important;
    }

    body.lumina-profile-standard .profile-head-top {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
        padding-bottom: 16px !important;
    }

    body.lumina-profile-standard .profile-head-main {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 12px !important;
        width: 100% !important;
    }

    /* Mobile Avatar: 96x96 px (-48px overlap) */
    body.lumina-profile-standard .avatar-wrap,
    body.lumina-profile-standard .hero-avatar-wrap,
    body.lumina-profile-standard .head-avatar-wrapper,
    body.lumina-profile-standard .profile-avatar-wrap,
    body.lumina-profile-standard .lumina-profile-avatar-wrap {
        width: 96px !important;
        height: 96px !important;
        min-width: 96px !important;
        min-height: 96px !important;
        flex: 0 0 96px !important;
        margin-top: -48px !important;
        position: relative !important;
        z-index: 15 !important;
        overflow: visible !important;
        border-width: 3.5px !important;
    }

    body.lumina-profile-standard .head-user-details,
    body.lumina-profile-standard .hero-details {
        margin-top: 0 !important;
        width: 100% !important;
        text-align: center !important;
        padding-top: 0 !important;
        flex: 1 !important;
        min-width: 0 !important;
    }

    body.lumina-profile-standard .head-user-name,
    body.lumina-profile-standard .hero-name {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        font-size: clamp(1.2rem, 5.5vw, 1.55rem) !important;
        line-height: 1.25 !important;
    }

    body.lumina-profile-standard .head-user-tagline,
    body.lumina-profile-standard .hero-role,
    body.lumina-profile-standard .hero-location {
        justify-content: center !important;
        text-align: center !important;
        font-size: 0.74rem !important;
    }

    body.lumina-profile-standard .head-actions,
    body.lumina-profile-standard .hero-actions {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        width: 100% !important;
        margin-top: 14px !important;
        padding: 14px 2px 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        overscroll-behavior-inline: contain !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 8px !important;
    }

    body.lumina-profile-standard .head-actions::-webkit-scrollbar,
    body.lumina-profile-standard .hero-actions::-webkit-scrollbar,
    body.lumina-profile-standard .profile-nav-tabs::-webkit-scrollbar {
        display: none !important;
    }

    body.lumina-profile-standard .head-actions > button,
    body.lumina-profile-standard .head-actions > a,
    body.lumina-profile-standard .hero-actions > button,
    body.lumina-profile-standard .hero-actions > a {
        min-width: max-content !important;
        padding: 0 14px !important;
    }

    body.lumina-profile-standard .head-actions .btn-action-gear,
    body.lumina-profile-standard .head-actions .btn-action-share,
    body.lumina-profile-standard .head-actions .btn-action-logout,
    body.lumina-profile-standard .head-actions .btn-action-more {
        min-width: 42px !important;
        flex-basis: 42px !important;
        padding: 0 !important;
    }

    body.lumina-profile-standard .profile-nav-tabs {
        margin-top: 12px !important;
        padding-bottom: 4px !important;
    }

    body.lumina-profile-standard .profile-nav-tabs .tab-btn {
        padding: 0 12px !important;
    }

    body.lumina-profile-standard .profile-body-grid,
    body.lumina-profile-standard .founder-3col {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        margin-top: 14px !important;
    }

    body.lumina-profile-standard .profile-body-grid > *,
    body.lumina-profile-standard .founder-3col > *,
    body.lumina-profile-standard .left-founder-wing,
    body.lumina-profile-standard .center-founder-feed,
    body.lumina-profile-standard .right-founder-wing {
        width: 100% !important;
    }

    body.lumina-profile-standard .post-card,
    body.lumina-profile-standard .sidebar-card {
        padding: 14px !important;
        margin-bottom: 12px !important;
    }
}

/* ══════════ 8. SMALL MOBILE SCREENS (<= 360px) ══════════ */
@media (max-width: 360px) {
    body.lumina-profile-standard .avatar-wrap,
    body.lumina-profile-standard .hero-avatar-wrap,
    body.lumina-profile-standard .head-avatar-wrapper,
    body.lumina-profile-standard .profile-avatar-wrap,
    body.lumina-profile-standard .lumina-profile-avatar-wrap {
        width: 88px !important;
        height: 88px !important;
        min-width: 88px !important;
        min-height: 88px !important;
        flex: 0 0 88px !important;
        margin-top: -44px !important;
    }
}

@media (max-width: 390px) {
    body.lumina-profile-standard .profile-container {
        padding-inline: 6px !important;
    }

    body.lumina-profile-standard .profile-head-card,
    body.lumina-profile-standard .hero-info-bar {
        padding-inline: 10px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.lumina-profile-standard *,
    body.lumina-profile-standard *::before,
    body.lumina-profile-standard *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
