﻿/** * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * User Profile Navigation Styles
 * Modern avatar system with gradient initials and premium dropdown styling.
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --profile-avatar-size: 38px;
    --profile-avatar-bg: linear-gradient(135deg, #237465 0%, #1a574c 100%);
    --profile-avatar-ring: linear-gradient(135deg, #237465 0%, #c9a430 100%);
    --profile-text: #1a1a2e;
    --profile-text-muted: #64748b;
    --profile-accent: #237465;
    --profile-accent-light: rgba(35, 116, 101, 0.08);
    --profile-border: rgba(0, 0, 0, 0.06);
    --profile-danger: #dc3545;
    --profile-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* ========================================
   User Avatar Component
   ======================================== */
.navbar-avatar {
    position: relative;
    width: var(--profile-avatar-size);
    height: var(--profile-avatar-size);
    border-radius: 50%;
    overflow: visible;
    cursor: pointer;
    transition: transform var(--profile-transition);
}

.navbar-avatar:hover {
    transform: scale(1.08);
}

/* Initials Display */
.navbar-avatar__initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--profile-avatar-bg);
    color: #ffffff;
    font-family: 'Josefin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 
        0 2px 8px rgba(35, 116, 101, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: 
        box-shadow var(--profile-transition),
        background var(--profile-transition);
}

.navbar-avatar:hover .navbar-avatar__initials {
    background: linear-gradient(135deg, #1f8d78 0%, #165a4e 100%);
    box-shadow: 
        0 4px 16px rgba(35, 116, 101, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Gradient Ring Effect on Hover */
.navbar-avatar::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--profile-avatar-ring);
    z-index: -1;
    opacity: 0;
    transition: opacity var(--profile-transition);
}

.navbar-avatar:hover::before {
    opacity: 1;
}

/* Online Status Indicator (optional) */
.navbar-avatar__status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Photo Avatar (if available) */
.navbar-avatar__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}


/* ========================================
   Dropdown Container Positioning
   ======================================== */
.nav-item.dropdown.has-megamenu.no-arrow {
    position: relative;
    overflow: visible;
}

.navbar .nav-item.dropdown.has-megamenu.no-arrow,
.navbar-nav .nav-item.dropdown.has-megamenu.no-arrow {
    overflow: visible;
}

/* Remove default link styling for avatar */
.nav-item.dropdown.has-megamenu.no-arrow > .nav-link {
    padding: 0;
    background: none !important;
    border-radius: 50%;
}

.nav-item.dropdown.has-megamenu.no-arrow > .nav-link:hover {
    background: none !important;
}


/* ========================================
   Mobile Dropdown Menu (<1600px)
   ======================================== */
.nav-item.dropdown.has-megamenu.no-arrow .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    margin-top: 12px;
    z-index: 1100;
    min-width: 320px;
    max-width: 90vw;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--profile-border);
    border-radius: 16px;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.02),
        0 12px 24px rgba(0, 0, 0, 0.06),
        0 24px 48px rgba(0, 0, 0, 0.04);
}


/* ========================================
   Desktop Mega Menu (>=1600px)
   ======================================== */
@media (min-width: 1600px) {
    .nav-item.dropdown.has-megamenu.no-arrow .megamenu-improved-container {
        left: auto !important;
        right: 0 !important;
        transform: translateX(0) translateY(-10px);
        width: min(92vw, 900px);
        max-width: calc(100vw - 48px);
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        overflow-x: hidden;
        margin-top: 12px;
        padding: 24px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--profile-border);
        border-radius: 20px;
        box-shadow: 
            0 4px 6px rgba(0, 0, 0, 0.02),
            0 12px 24px rgba(0, 0, 0, 0.06),
            0 24px 48px rgba(0, 0, 0, 0.04);
    }

    .nav-item.dropdown.has-megamenu.no-arrow .megamenu-improved-container.show {
        transform: translateX(0) translateY(0);
    }

    .nav-item.dropdown.has-megamenu.no-arrow .megamenu-improved-content.three-columns {
        grid-template-columns: 1fr 1px 1fr 1px 1fr;
        gap: 0;
    }

    .nav-item.dropdown.has-megamenu.no-arrow .megamenu-improved-content.four-columns {
        grid-template-columns: 1fr 1px 1fr 1px 1fr 1px 1fr;
        gap: 0;
    }
}

.nav-item.dropdown.has-megamenu.no-arrow .megamenu-improved-container {
    position: absolute;
    top: 100%;
    z-index: 1100;
}


/* ========================================
   Menu Column Styling
   ======================================== */
.megamenu-improved-content .menu-column {
    padding: 0 20px;
}

.megamenu-improved-content .column-header {
    font-family: 'Josefin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--profile-text-muted);
    margin-bottom: 16px;
    padding-left: 14px;
}

.megamenu-improved-content .menu-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}


/* ========================================
   Menu Item Styling
   ======================================== */
.megamenu-improved-content .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--profile-text);
    font-family: 'Josefin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: 
        background var(--profile-transition),
        transform var(--profile-transition);
}

.megamenu-improved-content .menu-item:hover {
    background: var(--profile-accent-light);
    text-decoration: none;
    transform: translateX(3px);
}

.megamenu-improved-content .menu-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    font-size: 15px;
    color: var(--profile-accent);
    flex-shrink: 0;
    transition: 
        background var(--profile-transition),
        color var(--profile-transition),
        transform var(--profile-transition);
}

.megamenu-improved-content .menu-item:hover .menu-item-icon {
    background: var(--profile-accent);
    color: #ffffff;
    transform: scale(1.05);
}

.megamenu-improved-content .menu-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.megamenu-improved-content .menu-item-title {
    font-weight: 500;
    color: var(--profile-text);
    transition: color var(--profile-transition);
}

.megamenu-improved-content .menu-item:hover .menu-item-title {
    color: var(--profile-accent);
}

.megamenu-improved-content .menu-item-description {
    font-size: 12px;
    color: var(--profile-text-muted);
    font-weight: 400;
}


/* ========================================
   Divider Styling
   ======================================== */
.megamenu-improved-content .divider {
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--profile-border) 20%, var(--profile-border) 80%, transparent);
    margin: 0 12px;
    align-self: stretch;
}


/* ========================================
   Logout / Danger Items
   ======================================== */
.nav-item.dropdown.has-megamenu.no-arrow .menu-item.text-danger {
    color: var(--profile-danger) !important;
}

.nav-item.dropdown.has-megamenu.no-arrow .menu-item.text-danger:hover {
    background: rgba(220, 53, 69, 0.08);
    color: var(--profile-danger) !important;
}

.nav-item.dropdown.has-megamenu.no-arrow .menu-item.text-danger .menu-item-icon {
    color: var(--profile-danger);
}

.nav-item.dropdown.has-megamenu.no-arrow .menu-item.text-danger:hover .menu-item-icon {
    background: var(--profile-danger);
    color: #ffffff;
}

/* Non-interactive items (user info display) */
.megamenu-improved-content .menu-item[style*="cursor: default"]:hover {
    background: transparent;
    transform: none;
}


/* ========================================
   Mobile Accordion Sections
   ======================================== */
.nav-item.dropdown.has-megamenu.no-arrow .mobile-megamenu-section {
    background: #ffffff;
    border: 1px solid var(--profile-border);
    border-radius: 14px;
    margin-bottom: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.nav-item.dropdown.has-megamenu.no-arrow .mobile-megamenu-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 18px;
    background: transparent;
    border: none;
    font-family: 'Josefin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--profile-text);
    text-align: left;
    cursor: pointer;
    transition: background var(--profile-transition);
}

.nav-item.dropdown.has-megamenu.no-arrow .mobile-megamenu-header:hover {
    background: var(--profile-accent-light);
}

.nav-item.dropdown.has-megamenu.no-arrow .mobile-megamenu-header .icon {
    width: 20px;
    margin-right: 12px;
    color: var(--profile-accent);
    text-align: center;
}

.nav-item.dropdown.has-megamenu.no-arrow .mobile-megamenu-header .chevron {
    margin-left: auto;
    font-size: 12px;
    color: var(--profile-text-muted);
    transition: transform var(--profile-transition);
}

.nav-item.dropdown.has-megamenu.no-arrow .mobile-megamenu-header.collapsed .chevron {
    transform: rotate(-90deg);
}

.nav-item.dropdown.has-megamenu.no-arrow .mobile-megamenu-list {
    padding: 0 8px 8px;
}

.nav-item.dropdown.has-megamenu.no-arrow .mobile-megamenu-list .list-group-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    text-decoration: none;
    color: inherit;
    transition: background var(--profile-transition);
}

.nav-item.dropdown.has-megamenu.no-arrow .mobile-megamenu-list .list-group-item:hover {
    background: var(--profile-accent-light);
    text-decoration: none;
}

.nav-item.dropdown.has-megamenu.no-arrow .mobile-megamenu-list .list-group-item .icon {
    width: 20px;
    color: var(--profile-accent);
    text-align: center;
    flex-shrink: 0;
}


/* ========================================
   Responsive Show/Hide
   ======================================== */
@media (max-width: 1599px) {
    .nav-item.dropdown.has-megamenu.no-arrow .megamenu-improved-container {
        display: none !important;
    }
}

@media (min-width: 1600px) {
    .nav-item.dropdown.has-megamenu.no-arrow .dropdown-menu {
        display: none !important;
    }
}


/* ========================================
   Premium Megamenu Right Alignment (>=1600px)
   ======================================== */
/* Profile megamenu - align right to prevent overflow */
.nav-item.has-megamenu.no-arrow .megamenu-premium-container {
    left: auto;
    right: 0;
    transform: translateY(-8px);
}

.nav-item.has-megamenu.no-arrow .megamenu-premium-container.show {
    transform: translateY(0);
}

/* Ensure no arrow on profile dropdown */
.nav-item.no-arrow .nav-link.dropdown-toggle::after {
    display: none !important;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .nav-item.dropdown.has-megamenu.no-arrow,
    .navbar-avatar {
        display: none !important;
    }
}
