.sop-global-header {
    background: transparent;
    color: var(--sop-color-white);
    height: 120px;
    font-family: var(--sop-font-main);
    top: 0;
    z-index: 9999;
    box-sizing: border-box;
    container-type: inline-size;
    container-name: sop-header;
    display: flex;
    justify-content: center;
}

.header-content {
    width: 100%;
    max-width: 1600px;
    /* Max width to match main layout */
    padding: 0px 40px;
    /* Original padding for edges */
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    margin: 0 auto;
    box-sizing: border-box;
    height: 100%;
}

.sop-header-left {
    display: flex;
    align-items: center;
}

.sop-header-logo img {
    height: 60px;
    width: auto;
    display: none;
    padding-top: 40px;
    padding-left: 10px;
}

/* Default state: Show white logo (for athletes or generic light-on-dark) */
.sop-header-logo .sop-logo-white {
    display: block;
}

/* Login/Register/Home: Show blue logo */
.sop-login-page .sop-logo-blue,
.sop-register-page .sop-logo-blue,
.sop-home-page .sop-logo-blue {
    display: block;
}

.sop-login-page .sop-logo-white,
.sop-register-page .sop-logo-white,
.sop-home-page .sop-logo-white {
    display: none;
}

/* Provider Light Theme: Show blue logo */
body.sop-provider-theme-light .sop-logo-blue {
    display: block;
}

body.sop-provider-theme-light .sop-logo-white {
    display: none;
}

/* Athlete PERFIL PREVISUALIZACION: White Header + Blue Logo EXCLUSIVELY in profile tab */
body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-global-header {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-logo-blue {
    display: block !important;
}

body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-logo-white {
    display: none !important;
}

body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-global-header .sop-nav-item,
body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-global-header .sop-lang-text,
body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-global-header .sop-user-pill {
    color: #1a1e29 !important;
    border-color: #1a1e29 !important;
}

body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-global-header .sop-dropdown-icon {
    color: #1a1e29 !important;
}

body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-global-header .sop-user-pill:hover {
    background: #1a1e29 !important;
    color: #ffffff !important;
}

/* Athlete Profile Preview: Sidebar Styling */
body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-col-left {
    background: transparent !important;
}

body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-sidebar-menu {
    background: #ffffff !important;
    backdrop-filter: none !important;
}

body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-menu-item,
body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-menu-item span {
    color: #092189 !important;
    opacity: 0.5 !important;
}

body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-menu-item:hover,
body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-menu-item.active {
    opacity: 1 !important;
    color: #092189 !important;
}

body.sop-is-atleta.sop-profile-page.sop-preview-mode .sop-menu-icon {
    filter: brightness(0) saturate(100%) invert(11%) sepia(86%) saturate(6011%) hue-rotate(229deg) brightness(85%) contrast(106%) !important;
}

/* Provider Preview Mode / Detail Page: Force white logo (Default for Athletes too elsewhere) */
body.sop-preview-mode:not(.sop-profile-page) .sop-logo-white,
body.sop-preview-mode:not(.sop-is-atleta) .sop-logo-white {
    display: block !important;
}

body.sop-preview-mode:not(.sop-profile-page) .sop-logo-blue,
body.sop-preview-mode:not(.sop-is-atleta) .sop-logo-blue {
    display: none !important;
}

/* White Header Pages: Dark Text/Icons */
.sop-login-page .sop-global-header .sop-nav-item,
.sop-login-page .sop-global-header .sop-lang-text,
.sop-register-page .sop-global-header .sop-nav-item,
.sop-register-page .sop-global-header .sop-lang-text,
.sop-home-page .sop-global-header .sop-nav-item,
.sop-home-page .sop-global-header .sop-lang-text,
.sop-login-page .sop-global-header .sop-user-pill:not(.sop-pill-register),
.sop-register-page .sop-global-header .sop-user-pill:not(.sop-pill-register),
.sop-home-page .sop-global-header .sop-user-pill:not(.sop-pill-register) {
    color: #092189 !important;
    border-color: #092189 !important;
}

.sop-login-page .sop-global-header .sop-dropdown-icon,
.sop-register-page .sop-global-header .sop-dropdown-icon,
.sop-home-page .sop-global-header .sop-dropdown-icon {
    color: #092189 !important;
}

.sop-login-page .sop-global-header .sop-user-pill:hover,
.sop-register-page .sop-global-header .sop-user-pill:hover,
.sop-home-page .sop-global-header .sop-user-pill:hover {
    background: #092189 !important;
    color: var(--sop-color-white) !important;
}

.sop-header-right {
    display: grid;
    grid-template-rows: 50px auto;
    justify-items: end;
    gap: 0px;
    height: 120px;
}

/* TOP BAR: Language Selector */
.sop-header-top {
    /* Simple 1D alignment = Flexbox is OK */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 40px;
}

.sop-lang-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.sop-lang-text {
    opacity: 1;
    letter-spacing: 1px;
}

.sop-lang-flag {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* BOTTOM BAR: Navigation and User */
.sop-header-bottom {
    display: flex;
    align-items: center;
    gap: 40px;
    height: 30px;
}

.sop-header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.sop-nav-item {
    color: var(--sop-color-white);
    text-decoration: none !important;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: opacity 0.3s;
    opacity: 0.9;
}

.sop-nav-item:hover {
    opacity: 1;
}

.sop-dropdown-icon {
    opacity: 0.5;
    margin-top: 2px;
}

.sop-header-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sop-user-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    line-height: 1;
    min-width: 120px;
}

/* Role-based borders and menu colors */

/* 1. Provider styles first (default for trainer detail pages) */
body.sop-is-provider .sop-global-header .sop-user-pill {
    border: 1px solid #092189 !important;
    color: #092189 !important;
}

body.sop-is-provider .sop-global-header .sop-nav-item,
body.sop-is-provider .sop-global-header .sop-dropdown-icon {
    color: #092189 !important;
}

/* 2. Provider Profile Preview (White menu) */
body.sop-is-provider.sop-profile-page.sop-preview-mode .sop-global-header .sop-nav-item,
body.sop-is-provider.sop-profile-page.sop-preview-mode .sop-global-header .sop-dropdown-icon {
    color: #ffffff !important;
}

body.sop-is-provider.sop-profile-page.sop-preview-mode .sop-global-header .sop-user-pill {
    border: 1px solid #FFFFFF !important;
    color: #ffffff !important;
}

/* 3. Athlete styles last (will win if both classes are present) */
body.sop-is-atleta .sop-global-header .sop-user-pill {
    border: 1px solid #FFFFFF !important;
    color: #ffffff !important;
}

body.sop-is-atleta .sop-global-header .sop-nav-item,
body.sop-is-atleta .sop-global-header .sop-dropdown-icon {
    color: #ffffff !important;
}

.sop-pill-login {
    background: transparent;
    border: 2px solid #092189;
    color: #092189 !important;
}

.sop-pill-login:hover {
    background: rgba(9, 33, 137, 0.05);
    border-color: #061866;
    color: #061866 !important;
}

.sop-pill-register {
    background: linear-gradient(90deg, #669DED, #406AC4, #092189, #092189, #669DED, #669DED, #5889DD, #092189);
    border: none;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(9, 33, 137, 0.3);
}

.sop-pill-register:hover {
    background: linear-gradient(90deg, #578bd6, #375ba8, #071c77, #071c77, #578bd6, #578bd6, #4b75bd, #071c77);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(9, 33, 137, 0.4);
}

/* SMART COMPONENTS: Container Queries as per standards */
@container sop-header (max-width: 1024px) {
    .header-content {
        padding: 15px 30px;
    }

    .sop-header-nav {
        gap: 15px;
    }

    .sop-header-bottom {
        gap: 20px;
    }

    .sop-user-pill {
        padding: 8px 18px;
        font-size: 1rem;
    }
}

/* Restored Sidebar Menu Styles */
.sop-sidebar-menu {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.sop-menu-item {
    margin-bottom: 30px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
    text-decoration: none !important;
    color: var(--sop-color-white) !important;
}

.sop-menu-item:hover {
    opacity: 1;
}

.sop-menu-item.active {
    opacity: 1;
}

.sop-menu-icon {
    filter: brightness(0) invert(1);
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 0.9;
}

.sop-menu-item span {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.sop-dot {
    width: 8px;
    height: 8px;
    background: #ff5c00;
    border-radius: 50%;
    display: inline-block;
    margin-left: 5px;
}