/* 
   PEC Unified Design System (Blue Family)
   Consolidated styles for the Professional Hub and Portal
*/

:root {
    /* Primary Blue Family → Brand tokens */
    --p: var(--brand-600);
    --p-dark: var(--brand-800);
    --p-light: var(--brand-50);
    
    /* Semantic Colors → Brand tokens */
    --s: var(--success);
    --w: var(--warning);
    --d: var(--danger);
    
    /* Neutral / UI → Brand tokens */
    --bg-body: var(--gray-50);
    --bg-card: #ffffff;
    --bg-muted: var(--gray-100);
    --text-main: var(--gray-800);
    --text-muted: var(--gray-500);
    --bdr: var(--gray-200);
    
    /* Geometric → Brand tokens */
    --r: var(--radius);
    --shadow: var(--shadow);
    --shadow-lg: var(--shadow-lg);
}

/* Base Global Utilities */
.pec-text-p { color: var(--p) !important; }
.pec-bg-p { background-color: var(--p) !important; color: white !important; }
.pec-gradient { background: linear-gradient(135deg, var(--p) 0%, #3b82f6 100%) !important; }

/* Unified Card */
.pec-card {
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}
.pec-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Hub Sidebar */
.hub-layout {
    display: flex;
    min-height: calc(100vh - 100px);
    background: var(--bg-body);
}

.hub-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--bdr);
    padding: 1.5rem 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-section-title {
    padding: 1.5rem 1.5rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hub-nav-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.hub-nav-link i {
    width: 24px;
    margin-right: 10px;
    font-size: 1.1rem;
}

.hub-nav-link:hover {
    background: var(--p-light);
    color: var(--p);
}

.hub-nav-link.active {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.14) 0%, rgba(14, 165, 233, 0.03) 100%) !important;
    color: var(--p) !important;
    font-weight: 700 !important;
    border-left: 4px solid var(--p) !important;
    box-shadow: inset 0 1px 0 rgba(14, 165, 233, 0.08), inset 0 -1px 0 rgba(14, 165, 233, 0.08);
}

.hub-content {
    flex: 1;
    padding: 2rem 3rem;
}

/* KPI Widgets */
.kpi-card {
    padding: 1.5rem;
}
.kpi-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}
.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-top: 5px;
}

.btn-pec:hover {
    background: var(--p-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-logout {
    border: 1px solid #fee2e2;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 50px;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* Global Modal Styles */
.modal-content.pec-modal {
    border-radius: var(--r);
    border: none;
    box-shadow: var(--shadow-lg);
}
.modal-header.pec-modal-header {
    background: var(--p);
    color: white;
    border-bottom: none;
    border-top-left-radius: var(--r);
    border-top-right-radius: var(--r);
}

@media (max-width: 992px) {
    .hub-layout { flex-direction: column; }
    .hub-sidebar { 
        width: 100% !important; 
        border-right: none !important; 
        border-bottom: 1px solid var(--bdr) !important; 
        padding: 0.75rem 0 !important; 
        overflow-x: auto !important;
    }
    .hub-sidebar .hub-nav-list {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding: 0 1rem !important;
    }
    .hub-nav-link { 
        padding: 0.5rem 1rem !important; 
        border-left: none !important;
        border-bottom: 3px solid transparent !important;
        font-size: 0.88rem !important;
        white-space: nowrap !important;
    }
    .hub-nav-link.active {
        border-bottom-color: var(--p) !important;
    }
    .hub-content {
        padding: 1.25rem 1rem !important;
    }
}

@media (max-width: 576px) {
    .cv-layout {
        padding: 1.25rem 0.85rem !important;
    }
    .kpi-card {
        padding: 1rem !important;
    }
    .btn-header-outline, .btn-header-text {
        padding: 4px 10px !important;
        font-size: 0.78rem !important;
    }
}

/* Profile Management Refinement */
.profile-nav-card {
    background: white;
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    padding: 0.5rem;
}
.profile-nav-card .nav-pills .nav-link {
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.2s;
    color: var(--text-muted);
}
.profile-nav-card .nav-pills .nav-link.active {
    background: var(--p) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.profile-nav-card .nav-pills .nav-link:hover:not(.active) {
    background: var(--p-light);
    color: var(--p);
}

/* Active & Hover Main Menu Item Highlighting */
.main-menu ul li a {
    color: #334155 !important;
    transition: all 0.2s ease-in-out !important;
    border-radius: 20px !important;
    display: inline-block !important;
    line-height: 1.5 !important;
}

header.header-area div.header__container div.header__main div.main-menu nav ul li.active > a,
header.header-area div.header__container div.header__main div.main-menu nav ul li a.active,
html body header.header-area div.main-menu ul li.active > a,
html body header.header-area div.main-menu ul li a.active,
.main-menu ul li.active > a,
.main-menu ul li a.active,
.header__main .main-menu ul li.active > a,
.header__main .main-menu ul li a.active,
.header-area .header__main .main-menu ul li.active > a,
.header-area .header__main .main-menu ul li a.active {
    color: #ffffff !important;
    background: #0ea5e9 !important;
    background-color: #0ea5e9 !important;
    font-weight: 800 !important;
    border-radius: 20px !important;
    padding: 6px 16px !important;
    display: inline-block !important;
    line-height: 1.5 !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4) !important;
}

.main-menu ul li a:hover,
.header__main .main-menu ul li a:hover {
    color: #0284c7 !important;
    background: rgba(14, 165, 233, 0.08) !important;
    border-radius: 20px !important;
}

/* Dropdown item active state */
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active {
    background: #0ea5e9 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}
