/* CSS Variables - Required for AOTopBar component */
:root {
    --primary-color: #233D6C;
    --secondary-color: #2AA6DE;
    --black-color: #000;
    --white-color: #fff;
    --dark-blue-variant-01: #283981;
    --dark-blue-variant-02: #0C3C60;
    --dark-charcoal: #333;
    --light-gray-variant-01: #E8E8E8;
    --gray-variant-01: #DEDEDE;
    --gray-variant-03: #C7C7C7;
    --font-franklin-gothic: 'Franklin Gothic', sans-serif;
    --font-palatino-linotype: 'Palatino Linotype', sans-serif;
    --font-franklingothic-demi: 'Franklingothic Demi', sans-serif;
    --font-franklin-gothic-medium: 'Franklin Gothic Medium', sans-serif;
    --font-lato: 'Lato', sans-serif;
    --font-lato-light: 'Lato-Light', sans-serif;
    --font-OPTIFranklinGothic-Medium: 'OPTIFranklinGothic-Medium', sans-serif;
    --font-size-tab-header: 1.25rem;
    --font-size-general: 16px;
    --font-size-big-icon: 50px; 
    --font-size-x-large: 40px;
    --font-size-large: 30px;
    --font-size-mobile-large: 18px;
    --font-size-medium: 20px;
    --font-size-small: 14px;
    --font-size-x-small: 12px;
    --font-size-mini: 10.5px;
}

/* Global Styles Modifications */
#eWebTopPaneTable {
    border-bottom: none !important;
}

/* Profile Header Section */
.profile-header-container {
    box-shadow: 1px 1px 6px 3px #e4e9f2;
    padding: 1rem;
    border-radius: 4px;
    background: linear-gradient(271deg, #f7f9fb 0%, #ffffffde 100%);
    width: 100%;
    max-width: 1200px;
    margin: 1rem auto 1rem;
    padding-right: 20px;
    padding-left: 20px;
}

/* Classes to control hero section visibility */
.ao-hero-section-hidden {
    display: none !important;
}

.ao-hero-section-visible {
    display: block !important;
}

/* For parent table elements */
.ao-hero-td-hidden {
    display: none !important;
}

.ao-hero-td-visible {
    display: table-cell !important;
}

.ao-hero-tr-hidden {
    display: none !important;
}

.ao-hero-tr-visible {
    display: table-row !important;
}

.profile-photo {
    position: relative;
}

.profile-photo img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 3px solid var(--gray-variant-01);
}

.profile-photo-placeholder {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: var(--white-color);
    font-family: var(--font-franklingothic-demi);
    font-size: var(--font-size-large);
    font-weight: 700;
    border: 3px solid var(--gray-variant-01);
    flex-shrink: 0;
}

.profile-photo-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--white-color);
    border: 2px solid var(--gray-variant-01);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.profile-photo-edit-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white-color);
}

.profile-photo-edit-btn i {
    font-size: 0.75rem;
    color: var(--dark-charcoal);
}

.profile-photo-edit-btn:hover i {
    color: var(--white-color);
}

.profile-name-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0.25rem;
}

.profile-name {
    font-family: var(--font-franklingothic-demi) !important;
    font-size: var(--font-size-large) !important;
    color: var(--primary-color) !important;
    font-weight: 700;
    text-transform: none;
    margin-bottom: 0;
}

.profile-details {
    font-family: var(--font-franklin-gothic);
    font-size: var(--font-size-small);
    color: var(--dark-charcoal);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-org-row {
    display: flex;
    align-items: center;
    line-height: normal;
    gap: 0.25rem;
}

.profile-details i {
    color: var(--primary-color);
}

.profile-organization,
.profile-title {
    display: inline-block;
}
.profile-organization {
    color: var(--primary-color);
    margin-top: -4px;
}

.profile-separator-dot {
    display: inline-flex;
    align-items: center;
    margin: 0 0.25rem;
}

.profile-separator-dot i {
    color: var(--dark-charcoal);
    font-size: 0.25rem;
    margin-top: 2px;
}

.profile-org-link {
    color: var(--primary-color);
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease;
}

.profile-org-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Edit Profile Button (Pencil Icon) */
.edit-profile-pencil-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 0.4rem;
    background-color: var(--white-color);
    transition: all 0.2s ease;
    width: 25px;
    height: 25px;
    flex-shrink: 0;
}

#edit-profile-link {
    margin-bottom: 2px;
}

.edit-profile-pencil-btn:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
}

.edit-profile-pencil-btn i {
    font-size: 0.9rem;
}

/* Profile Account Links - Top section, right-aligned */
.profile-account-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.profile-account-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 80px;
    height: 60px;
    padding: 0.5rem 0.35rem;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    background-color: var(--white-color);
    text-decoration: none;
    color: var(--dark-charcoal);
    transition: all 0.2s ease;
    position: relative;
}

.profile-account-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
}

.profile-account-link i {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
    flex-shrink: 0;
    height: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-link-label {
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    font-family: var(--font-franklingothic-demi);
    letter-spacing: 0.15px;
    line-height: 1.2;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 0;
    width: 100%;
    max-height: 2.4em;
    overflow: hidden;
    color: inherit;
}

/* Invoice Badge - Red count indicator */
.invoice-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0px 4px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-franklingothic-demi);
    color: var(--white-color);
    background-color: var(--primary-color);
    border: 1px solid var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.profile-diagram {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
}

.profile-diagram i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Profile Info wrapper to contain name/details and edit button */
.profile-info {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.form-check-input[type=checkbox] {
    height: 1rem;
    width: 1rem;
}
.form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* ============================================
   Mobile Account Menu - Hamburger & Drawer
   ============================================ */

/* Mobile Hamburger Menu Button */
.mobile-account-menu-toggle {
    display: none; /* Hidden by default, shown on mobile */
    position: relative;
    width: 44px;
    height: 44px;
    background-color: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.mobile-account-menu-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.mobile-account-menu-toggle:hover::before {
    width: 100%;
    height: 100%;
    opacity: 0;
}

.mobile-account-menu-toggle:hover {
    background-color: var(--dark-blue-variant-01);
    border-color: var(--dark-blue-variant-01);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(35, 61, 108, 0.2);
}

.mobile-account-menu-toggle:active {
    transform: scale(0.92);
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-account-menu-toggle.active {
    background-color: var(--white-color);
    border-color: var(--primary-color);
}

.mobile-account-menu-toggle.active:hover {
    background-color: var(--light-gray-variant-01);
}

.mobile-account-menu-toggle.active .three-dots-icon .dot {
    background-color: var(--primary-color);
}

/* Three Dots Icon (Horizontal) - Modern Design */
.three-dots-icon {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 24px;
    height: 8px;
    position: relative;
    gap: 5px;
}

.three-dots-icon .dot {
    display: block;
    width: 4px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
    position: relative;
}

/* Hover Animation - Dots spread out and glow */
.mobile-account-menu-toggle:hover .three-dots-icon {
    gap: 7px;
}

.mobile-account-menu-toggle:hover .three-dots-icon .dot {
    background-color: var(--white-color);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.mobile-account-menu-toggle:hover .three-dots-icon .dot:nth-child(1) {
    animation: dotFloatLeft 1.2s ease-in-out infinite;
}

.mobile-account-menu-toggle:hover .three-dots-icon .dot:nth-child(2) {
    animation: dotFloatCenter 1.2s ease-in-out infinite 0.2s;
}

.mobile-account-menu-toggle:hover .three-dots-icon .dot:nth-child(3) {
    animation: dotFloatRight 1.2s ease-in-out infinite 0.4s;
}

/* Active State - Dots morph and connect */
.mobile-account-menu-toggle.active .three-dots-icon {
    gap: 2px;
}

.mobile-account-menu-toggle.active .three-dots-icon .dot {
    background-color: var(--primary-color);
    animation: dotMorph 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.mobile-account-menu-toggle.active .three-dots-icon .dot:nth-child(1) {
    animation-delay: 0s;
    transform: translateX(-2px) scale(1.2);
}

.mobile-account-menu-toggle.active .three-dots-icon .dot:nth-child(2) {
    animation-delay: 0.1s;
    transform: scale(1.4);
}

.mobile-account-menu-toggle.active .three-dots-icon .dot:nth-child(3) {
    animation-delay: 0.2s;
    transform: translateX(2px) scale(1.2);
}

/* Modern Animation Keyframes */
@keyframes dotFloatLeft {
    0%, 100% {
        transform: translateY(0) scale(1.3);
    }
    50% {
        transform: translateY(-3px) scale(1.4);
    }
}

@keyframes dotFloatCenter {
    0%, 100% {
        transform: translateY(0) scale(1.3);
    }
    50% {
        transform: translateY(-4px) scale(1.5);
    }
}

@keyframes dotFloatRight {
    0%, 100% {
        transform: translateY(0) scale(1.3);
    }
    50% {
        transform: translateY(-3px) scale(1.4);
    }
}

@keyframes dotMorph {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
        box-shadow: 0 0 12px rgba(35, 61, 108, 0.4);
    }
    100% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 6px rgba(35, 61, 108, 0.3);
    }
}

/* Mobile Account Drawer - Full Screen with Modern Backdrop */
.mobile-account-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    backdrop-filter: blur(0px);
}

.mobile-account-drawer.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    backdrop-filter: blur(4px);
    animation: backdropFadeIn 0.35s ease-out;
}

@keyframes backdropFadeIn {
    0% {
        backdrop-filter: blur(0px);
        background-color: rgba(0, 0, 0, 0);
    }
    100% {
        backdrop-filter: blur(4px);
        background-color: rgba(0, 0, 0, 0.1);
    }
}

/* Drawer Overlay/Backdrop - Not needed for full screen, but kept for structure */
.mobile-account-drawer-overlay {
    display: none;
}

/* Drawer Content - Full Screen with Modern Slide Animation */
.mobile-account-drawer-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(270deg, #f7f9fb 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10001;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.mobile-account-drawer.open .mobile-account-drawer-content {
    transform: translateX(0);
    animation: drawerSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes drawerSlideIn {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Drawer Header - Only Close Button */
.mobile-account-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1.5rem 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-account-drawer-title {
    display: none;
}

.mobile-account-drawer-close {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background-color: transparent;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-account-drawer-close:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    transform: rotate(90deg);
}

.mobile-account-drawer-close i {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-top: 2px;
}

.mobile-account-drawer-close:hover i {
    color: var(--white-color);
}

/* Drawer Links Container - Single Column (Row by Row) */
.mobile-account-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    flex: 1;
}

/* Mobile Account Link Styles - Full Width Row Layout */
.mobile-account-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 60px;
    padding: 1rem 1.25rem;
    background-color: var(--white-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--dark-charcoal);
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    gap: 1rem;
}

.mobile-account-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(35, 61, 108, 0.2);
}

.mobile-account-link:active {
    transform: scale(0.98);
}

.mobile-account-link i {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    color: var(--primary-color);
}

.mobile-account-link:hover i {
    transform: scale(1.05);
    color: var(--white-color);
}

.mobile-account-link-label {
    font-family: var(--font-franklingothic-demi);
    font-size: var(--font-size-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
    text-align: left;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: inherit;
}

/* Mobile Invoice Badge - Larger Size */
.mobile-invoice-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0px 5px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-franklingothic-demi);
    color: var(--white-color);
    background-color: var(--primary-color);
    border: 2px solid var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.mobile-account-link:hover .mobile-invoice-badge {
    background-color: var(--white-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================
   Mobile Responsive Styles
   ============================================ */

@media (max-width: 991.98px) {
    /* Show hamburger button on mobile */
    .mobile-account-menu-toggle {
        display: flex;
    }
    
    /* Hide desktop account links on mobile - use !important to override inline styles */
    .profile-account-links,
    .profile-header-top .profile-account-links {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Hide individual account links on mobile */
    .profile-account-link {
        display: none !important;
    }
    
    /* Adjust profile header top for mobile */
    .profile-header-top {
        position: relative;
        flex-wrap: nowrap;
    }
    
    /* Ensure hamburger button is positioned correctly on the right */
    .mobile-account-menu-toggle {
        margin-left: auto;
        order: 999;
    }
    
    /* Adjust profile container padding on mobile */
    .profile-header-container {
        padding: 1rem 1rem;
    }
    
    /* Ensure left side doesn't grow too much */
    .profile-header-top > .d-flex.align-items-center {
        flex: 0 1 auto;
        min-width: 0;
    }
    
    /* Mobile Font Resizing */
    .profile-name {
        font-size: 1.25rem !important; /* Reduced from 30px to 20px */
        line-height: 1.3;
    }
    
    .profile-details {
        font-size: 0.85rem; /* Reduced from 14px to 12px */
        line-height: 1.4;
    }
    
    .profile-organization,
    .profile-title {
        font-size: 0.85rem;
    }
    
    /* Hide Edit Profile Button on Mobile - it's now in the drawer */
    #edit-profile-link {
        display: none !important;
    }
    
    /* Keep profile name wrapper normal on mobile */
    .profile-name-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 0;
    }
    
    /* Adjust profile info spacing */
    .profile-info {
        gap: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    /* Further mobile adjustments */
    .profile-header-container {
        padding: 0.75rem;
        margin: 0.5rem auto;
    }
    
    /* Smaller font sizes for very small screens */
    .profile-name {
        font-size: 1.125rem !important; /* 18px for very small screens */
    }
    
    .profile-details {
        font-size: 0.8rem; /* 11px */
    }
    
    .profile-organization,
    .profile-title {
        font-size: 0.8rem;
    }
    
    /* Tighter spacing */
    .profile-name-wrapper {
        gap: 0.375rem;
    }
    
    .profile-info {
        gap: 0.375rem;
    }
    
    .mobile-account-drawer-header {
        padding: 1rem 1.25rem;
    }
    
    .mobile-account-drawer-title {
        font-size: var(--font-size-mobile-large);
    }
    
    .mobile-account-drawer-links {
        padding: 1.25rem 1rem;
        gap: 0.625rem;
    }
    
    .mobile-account-link {
        width: 100%;
        min-height: 56px;
        padding: 0.875rem 1rem;
    }
    
    .mobile-account-link i {
        font-size: 1.25rem;
        width: 20px;
    }
    
    .mobile-account-link-label {
        font-size: 0.875rem;
    }
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Smooth scrollbar for drawer */
.mobile-account-drawer-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-account-drawer-content::-webkit-scrollbar-track {
    background: var(--light-gray-variant-01);
}

.mobile-account-drawer-content::-webkit-scrollbar-thumb {
    background: var(--gray-variant-03);
    border-radius: 3px;
}

.mobile-account-drawer-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}