/* Mobile Header Specific Styles */
#desktop-header {
    display: none; /* Hide desktop header on mobile */
}

.header-mobile {
    background-color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-mobile .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-toggle {
    font-size: 1.5em;
    cursor: pointer;
    color: var(--dark-color);
}

.nav-mobile {
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen */
    width: 70%;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.4s ease-in-out;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
    z-index: 999;
}

.nav-mobile.active {
    right: 0; /* Slide in */
}

.nav-mobile ul {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.nav-mobile a {
    font-size: 1.2em;
    font-weight: 500;
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray);
    position: relative; /* Needed for absolute positioning of the underline */
    padding-bottom: 15px; /* Increase padding slightly to accommodate underline */
}

.nav-mobile a::after {
    content: '';
    position: absolute;
    width: 0; /* Start with no width */
    height: 2px; /* Underline thickness */
    bottom: 8px; /* Position above the border-bottom */
    /* Adjust left/right based on RTL/LTR, assuming RTL */
    right: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease-out; /* Animation for width change */
}

.nav-mobile a:hover::after {
    width: 100%; /* Expand width on hover */
}

/* Ensure the border-bottom is visible */
.nav-mobile a {
    border-bottom: 1px solid var(--light-gray);
}

.nav-mobile a:hover {
    color: var(--primary-color);
}

.header-icons-mobile {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    padding: 20px;
    border-top: 1px solid var(--light-gray);
    margin-top: auto; /* Push to bottom */
}

.header-icons-mobile i {
    font-size: 1.4em;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.header-icons-mobile i:hover {
    color: var(--primary-color);
}

/* Styles for dropdown menu in mobile nav */
.nav-mobile ul li.has-dropdown {
    /* No specific styles needed here unless you want to add padding/margin */
    /* Keep default margin/padding from nav-mobile li */
}

.nav-mobile ul li .dropdown-menu {
    position: static; /* Appear in normal flow */
    background-color: var(--light-gray); /* Slightly different background for clarity */
    box-shadow: none; /* Remove shadow */
    border-radius: 0; /* Remove border radius */
    min-width: auto; /* Remove fixed width */
    max-height: 0; /* Initially hidden */
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0; /* Adjust padding */
    margin: 0; /* Adjust margin */
    border-top: none; /* Remove border from the menu container */
}

/* Style to show the dropdown when the parent has an 'active' class (controlled by JS) */
.nav-mobile ul li.has-dropdown.active .dropdown-menu {
     max-height: 300px; /* Sufficient height to show all items */
     padding: 10px 0; /* Add vertical padding when open */
}

.nav-mobile ul li .dropdown-menu li {
    margin: 0; /* Remove default margin */
    border-bottom: none; /* Remove border from dropdown items */
}

.nav-mobile ul li .dropdown-menu a {
    padding: 8px 20px; /* Adjust padding */
    font-size: 1em; /* Adjust font size */
    border-bottom: none; /* Remove border from dropdown links */
    text-align: right; /* Ensure text is aligned right for RTL */
}

.nav-mobile ul li .dropdown-menu a:hover {
    background-color: var(--border-color); /* Hover effect */
    color: var(--primary-color);
}

/* Rotate dropdown icon when active */
.nav-mobile ul li.has-dropdown > a i.fa-chevron-down {
    margin-right: 5px; /* Space between text and icon for RTL */
    transition: transform 0.3s ease;
}

.nav-mobile ul li.has-dropdown.active > a i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Overlay for mobile menu */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none; /* Hidden by default */
}

.dashboard-icon {
    color: #333;
    font-size: 1.2rem;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.dashboard-icon:hover {
    color: var(--primary-color);
}
