/* 
    Created on : 17 Dec 2025, 10:04:00
    Author     : David Baker Director
*/

/* ----------------------------------------------------------------------- */
/* Header and Navigation Styles                                          */
/* ----------------------------------------------------------------------- */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1001;
    width: 100%;
    background: white;
    border-radius: 12px;
    border-bottom: 2px solid #c0c0c0;
    box-shadow: 0 3px 20px rgba(0, 0, 0, 0.10);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-link img {
    height: 50px;
    width: auto;
    transition: transform 0.3s;
}

.logo-link:hover img {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu > li {
    position: relative;
    margin: 0 15px;
}

.nav-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 12px;
    display: block;
    border-radius: 4px;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
    background-color: #f7f9fc;
}

/* DESKTOP DROPDOWNS - ORIGINAL CODE (KEEP THIS) */
.nav-menu ul {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 8px 0;
    margin: 4px 0 0 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 2000;
}

.nav-menu li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu ul li {
    margin: 0;
}

.nav-menu ul .nav-link {
    padding: 10px 20px;
    font-size: 14px;
    color: #2c3e50;
    transition: var(--transition);
}

.nav-menu ul .nav-link:hover {
    background-color: var(--primary);
    color: white;
    padding-left: 25px;
}

.nav-button {
    color: #2c3e50 !important;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
    background: transparent !important;
}

.nav-button:hover {
    color: #4361dd !important;
    background-color: #f7f9fc !important;
}

.user-details {
    text-align: left;
    font-size: 14px;
    color: #2c3e50;
    line-height: 1.4;
    margin-left: 20px;
}

.user-details span {
    font-weight: 400;
    color: var(--primary);
}

@media (max-width: 992px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-menu {
        width: 100%;
        margin-top: 15px;
        flex-wrap: wrap;
    }
    
    .nav-menu > li {
        margin: 5px 10px 5px 0;
    }
    
    .user-details {
        margin-top: 15px;
        text-align: left;
    }
}

/* ======================================================
   MOBILE NAVIGATION (HAMBURGER)
====================================================== */
#nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 22px;
    position: relative;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: #2c3e50;
    transition: 0.3s ease;
}

.nav-toggle-label span {
    top: 50%;
    transform: translateY(-50%);
}

.nav-toggle-label span::before {
    top: -8px;
}

.nav-toggle-label span::after {
    top: 8px;
}

/* ------------------------------------------------------
   MOBILE OVERRIDES
------------------------------------------------------ */
@media (max-width: 768px) {
    /* Hide user details on mobile */
    .user-details {
        display: none !important;
    }

    /* Layout */
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .nav-toggle-label {
        display: block;
    }

    /* Menu container */
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        display: none;
        border-top: 1px solid #eee;
        box-shadow: 0 8px 20px rgba(0,0,0,0.12);
        z-index: 999;
        max-height: 80vh;
        overflow-y: auto;
    }

    .nav-menu > li {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid #eee;
    }

    .nav-link,
    .nav-button {
        padding: 14px 16px;
        width: 100%;
        text-align: left;
    }

    /* Show menu when checked */
    #nav-toggle:checked ~ .nav-menu {
        display: flex;
    }

    /* MOBILE: Reset all desktop hover styles */
    .nav-menu ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
        display: none; /* Hide submenus by default on mobile */
        background: #f9fafc;
        border-left: 3px solid var(--primary);
        border-radius: 0;
    }

    /* Disable hover on mobile */
    .nav-menu li:hover > ul {
        display: none;
    }

    /* Add dropdown arrow for mobile parent items */
    .nav-menu li.menu-item-has-children > a::after {
        content: "▾";
        float: right;
        font-size: 0.8rem;
        opacity: 0.6;
        transition: transform 0.3s ease;
    }

    /* Rotate arrow when submenu is open */
    .nav-menu li.menu-item-has-children > a.submenu-open::after {
        transform: rotate(180deg);
    }

    /* Style mobile submenu items */
    .nav-menu ul .nav-link {
        padding-left: 30px;
        font-size: 14px;
        border-bottom: 1px solid #eaeaea;
    }

    .nav-menu ul li:last-child .nav-link {
        border-bottom: none;
    }
}

/* Keep desktop styles intact */
@media (min-width: 769px) {
    /* Ensure hover works on desktop */
    .nav-menu li:hover > ul {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    /* Hide mobile dropdown arrows on desktop */
    .nav-menu li.menu-item-has-children > a::after {
        display: none;
    }
}

/* ------------------------------------------------------
   LOCKED (PRO-ONLY) NAV ITEMS
------------------------------------------------------ */

/* Base locked nav item */
.nav-menu li.locked {
    opacity: 1; /* keep layout crisp */
}

/* Locked link text */
.nav-menu li.locked .nav-link {
    color: #9aa3ad;
    cursor: default;
    background: transparent;
}

/* Disable hover highlight */
.nav-menu li.locked .nav-link:hover {
    color: #9aa3ad;
    background: transparent;
}

/* Lock icon */
.nav-menu li.locked i {
    margin-left: 6px;
    font-size: 0.85em;
    color: #b0b8c2;
}

/* Upgrade link */
.nav-menu li.locked .upgrade-link {
    margin-left: 8px;
    font-size: 0.85em;
    font-weight: 500;
    color: #ff7a00;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

.locked-item {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.75;
}

.locked-label {
    cursor: default;
    color: #6c7a89;
}

.locked-label i {
    margin-left: 5px;
    color: #999;
}

.upgrade-link {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #4361ee;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.upgrade-link:hover {
    background: #3650cc;
}


/* Mobile consistency */
@media (max-width: 768px) {
    .nav-menu li.locked {
        background: #f9fafc;
    }

    .nav-menu li.locked .nav-link {
        padding: 14px 16px;
    }
}
