/* Mobile Navigation Styles */
.mobile-nav-toggle {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
    z-index: 2000;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 25px;
}

/* Hamburger Icon */
.hamburger-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger-line:nth-child(1) {
    top: 0;
}

.hamburger-line:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-line:nth-child(3) {
    bottom: 0;
}

/* X Animation */
.mobile-nav-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.mobile-nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* Mobile Menu - Reduced top padding */
.mobile-nav {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background-color: var(--secondary-color);
    z-index: 1999;
    padding: 10px 15px 40px; /* Reduced from 80px to 20px */
    overflow-y: auto;
    transition: all 0.4s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.mobile-nav.active {
    left: 0;
}

/* Close Button Style */
.mobile-nav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    z-index: 10;
}

.mobile-nav-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

/* Mobile Menu Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Items */
.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 10px;
}

.mobile-nav-links li {
    margin-bottom: 20px;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
    transition-delay: calc(0.05s * var(--item-index));
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.mobile-nav.active .mobile-nav-links li {
    opacity: 1;
    transform: translateX(0);
}

.mobile-nav-links li a {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.mobile-nav-links li a:hover,
.mobile-nav-links li a.active {
    color: var(--primary-color);
}

.mobile-nav-links li a i {
    margin-right: 15px;
    font-size: 20px;
    min-width: 25px;
    display: inline-flex;
    justify-content: center;
}

/* Mobile Dropdown Items */
.mobile-nav-links li.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-nav-links li.mobile-more-item {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100%;
}

.mobile-nav-links li.mobile-more-item a {
    margin-right: 10px;
}

.mobile-nav-links span.menu-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Dropdown Toggle */
.mobile-dropdown-toggle {
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 14px;
    padding: 0;
    margin-left: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
    min-width: 24px;
    flex-shrink: 0;
}

.mobile-dropdown-toggle i {
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-dropdown-toggle.active i {
    transform: rotate(180deg);
}

/* Mobile Dropdown Menu - Fixed to collapse by default */
.mobile-dropdown {
    padding-left: 40px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 5px;
    width: 100%;
    display: block;
    position: relative;
    left: 0;
}

.mobile-dropdown.active {
    max-height: 300px; /* Large enough to accommodate dropdown items */
}

.mobile-dropdown li {
    margin-bottom: 15px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
}

.mobile-dropdown.active li {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(0.05s * var(--subitem-index));
}

.mobile-dropdown li:last-child {
    margin-bottom: 5px;
}

/* Social Icons in Mobile Menu */
.mobile-nav-social {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    transition-delay: 0.4s;
    align-items: center;
    justify-content: center;
}

.mobile-nav.active .mobile-nav-social {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.mobile-nav-social a:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    transform: translateY(-3px);
}

/* Show mobile nav toggle on smaller screens */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
    }
}

/* Adjust for smaller phones */
@media (max-width: 400px) {
    .mobile-nav {
        width: 280px;
        left: -280px;
    }
}

/* Prevent scrolling when mobile menu is open */
body.menu-open {
    overflow: hidden;
}