/* Client Area Navigation - Enhanced Premium Sidebar */
.clientarea-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    font-family: metropolisregular, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 8px 40px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

/* Main content offset to account for sidebar */
body.has-sidebar .maincontent {
    margin-left: 260px;
}

/* Container wrapper - dynamic padding based on scroll */
.clientarea-nav .wrapper {
    padding-bottom: 20px;
    padding-top: clamp(0px, calc(200px - var(--sidebar-scroll, 0px)), 200px);
    /* No transition for instant response to scroll */
}

/* ========================================
   USER PROFILE SECTION
   ======================================== */

.clientarea-nav__profile {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.clientarea-nav__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #67a552 0%, #5a8f47 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    font-family: metropolissemi_bold;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(103, 165, 82, 0.2);
    letter-spacing: 0.5px;
}

.clientarea-nav__user-info {
    flex: 1;
    min-width: 0;
}

.clientarea-nav__user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clientarea-nav__logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.clientarea-nav__logout:hover {
    color: #ef4444;
    text-decoration: none;
    transform: translateX(2px);
}

.clientarea-nav__logout i {
    font-size: 11px;
}

/* ========================================
   NAVIGATION LIST
   ======================================== */

/* Main navigation list */
.clientarea-nav > .wrapper > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Navigation items */
.clientarea-nav > .wrapper > ul > li {
    position: relative;
    margin: 0;
}

/* Navigation links - Enhanced */
.clientarea-nav > .wrapper > ul > li > a {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: #374151;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    font-family: metropolisregular;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    border-left: 4px solid transparent;
    border-radius: 0 6px 6px 0;
    margin: 0 8px 0 0;
}

/* Icons for navigation items - Font Awesome Solid Icons */
.clientarea-nav span[class^="nav-"] {
    display: flex;
    align-items: center;
    font-family: metropolisregular;
    position: relative;
}

.clientarea-nav span[class^="nav-"]:before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 12px;
    font-size: 15px;
    color: #6b7280;
    opacity: 0.85;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
}

/* Font Awesome Solid Icon definitions */
.clientarea-nav .nav-home:before {
    content: "\f015"; /* fa-home */
}

.clientarea-nav .nav-services:before {
    content: "\f233"; /* fa-server */
}

.clientarea-nav .nav-billing:before {
    content: "\f09d"; /* fa-credit-card */
}

.clientarea-nav .nav-support:before {
    content: "\f1cd"; /* fa-life-ring */
}

.clientarea-nav .nav-affiliates:before {
    content: "\f007"; /* fa-user */
}

.clientarea-nav .nav-domains:before {
    content: "\f0ac"; /* fa-globe */
}

/* ========================================
   HOVER & ACTIVE STATES - ENHANCED
   ======================================== */

/* Premium hover effect */
.clientarea-nav > .wrapper > ul > li > a:hover {
    color: #111827;
    border-left-color: #67a552;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.clientarea-nav > .wrapper > ul > li > a:hover span[class^="nav-"]:before {
    opacity: 1;
    color: #67a552;
    transform: scale(1.1);
}

/* Enhanced active state */
.clientarea-nav > .wrapper > ul > li.active > a {
    background: linear-gradient(90deg, rgba(103, 165, 82, 0.15) 0%, rgba(103, 165, 82, 0.05) 100%);
    color: #67a552;
    font-weight: 700;
    border-left-color: #67a552;
    box-shadow: 0 2px 12px rgba(103, 165, 82, 0.15);
    letter-spacing: 0.3px;
}

.clientarea-nav > .wrapper > ul > li.active > a span[class^="nav-"]:before {
    opacity: 1;
    color: #67a552;
    transform: scale(1.05);
}

/* ========================================
   DROPDOWN STYLES - ENHANCED
   ======================================== */

.clientarea-nav .dropdown {
    position: relative;
}

/* Hide the default caret */
.clientarea-nav .dropdown-toggle::after,
.clientarea-nav .caret {
    display: none !important;
}

/* Animated chevron indicator */
.clientarea-nav .dropdown-toggle {
    position: relative;
}

.clientarea-nav .dropdown-toggle:after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
    width: 8px;
    height: 8px;
    border-right: 2px solid #9ca3af;
    border-bottom: 2px solid #9ca3af;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block !important;
}

.clientarea-nav .dropdown.open .dropdown-toggle:after {
    transform: translateY(-50%) rotate(45deg);
    border-color: #67a552;
}

/* Dropdown menu - Smooth animation */
.clientarea-nav .dropdown-menu {
    position: static;
    display: none;
    background: #f9fafb;
    border: none;
    border-radius: 0 0 8px 8px;
    padding: 8px 0;
    margin: 0;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.03);
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.clientarea-nav .dropdown.open > .dropdown-menu {
    display: block;
    max-height: 500px;
    opacity: 1;
}

/* Dropdown items - Enhanced */
.clientarea-nav .dropdown-menu li {
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
}

.clientarea-nav .dropdown-menu li a {
    display: block;
    padding: 8px 10px 8px 40px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    font-family: metropolisregular;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    position: relative;
}

.clientarea-nav .dropdown-menu li a:before {
    content: '›';
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #d1d5db;
    font-size: 18px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.clientarea-nav .dropdown-menu li a:hover {
    background: #ffffff;
    color: #67a552;
    border-left-color: #67a552;
    padding-left: 44px;
}

.clientarea-nav .dropdown-menu li a:hover:before {
    color: #67a552;
    left: 28px;
}

/* ========================================
   VISUAL SEPARATORS
   ======================================== */

/* Separators removed for more compact design */

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 991px) {
    .clientarea-nav {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 8px 40px rgba(0, 0, 0, 0.08);
    }

    body.has-sidebar .maincontent {
        margin-left: 0;
    }

    .clientarea-nav .wrapper {
        padding: 10px 0 !important; /* Fixed padding on mobile */
        transition: none;
    }

    .clientarea-nav__profile {
        margin-bottom: 10px;
    }

    .clientarea-nav > .wrapper > ul > li > a:hover {
        transform: none;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.clientarea-nav a:focus {
    outline: 2px solid #67a552;
    outline-offset: 2px;
}

.clientarea-nav a:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

.clientarea-nav::-webkit-scrollbar {
    width: 6px;
}

.clientarea-nav::-webkit-scrollbar-track {
    background: #f9fafb;
}

.clientarea-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d1d5db 0%, #9ca3af 100%);
    border-radius: 3px;
}

.clientarea-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .clientarea-nav {
        display: none;
    }
}
