/* Header Styles */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(13, 17, 23, 0.85); /* Dark background with transparency */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced gap for smaller menus */
    position: absolute;
    right: 50%;
    transform: translateX(50%);
}

.header-nav a, .dropdown-toggle {
    color: var(--gray);
    text-decoration: none;
    font-size: 15px; /* Slightly smaller font */
    padding: 8px 12px; /* Adjusted padding */
    border-radius: 8px;
    transition: color 0.3s ease, background-color 0.3s ease;
    font-weight: 500;
}

.header-nav a:hover, .dropdown-toggle:hover {
    color: var(--primary-color);
    background-color: var(--primary-color-light);
}

/* Dropdown specific styles */
.dropdown {
    position: relative;
}

.mega-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    z-index: 1001;
    width: max-content;
    gap: 40px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dropdown:hover .mega-menu {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.mega-menu-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mega-menu-grid h4 {
    font-size: 13px; /* Smaller than the links */
    font-weight: 600;
    color: var(--gray); /* Grayed-out color */
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-menu-grid a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 15px;
    padding: 5px 0;
    transition: color 0.2s ease;
}


.logo svg {
    display: block;
}

header nav a:hover {
    color: var(--primary-color);
    background-color: var(--primary-color-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions a {
    color: var(--gray);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 8px;
}

.header-actions a:hover {
    color: var(--heading-color);
}

.header-actions .cta-button {
    background-color: var(--primary-color);
    color: var(--heading-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: transform 0.2s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 174, 239, 0.2);
}

.header-actions .cta-button:hover {
    background-color: #0095c7; /* A slightly lighter blue for hover */
    color: var(--heading-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 174, 239, 0.3);
}

.dropdown-toggle .fa-chevron-down {
    font-size: 12px;
    margin-right: 5px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

/* Sidebar Dropdown */
.sidebar-dropdown-content {
    display: none;
    padding-right: 15px;
    border-right: 2px solid var(--border-color);
    margin-right: 10px;
    padding-top: 10px;
    margin-top: 10px;
}

.sidebar-dropdown.active > .sidebar-dropdown-content {
    display: block;
}

.sidebar-dropdown-toggle .fa-chevron-down {
    transition: transform 0.3s ease;
    font-size: 12px;
    margin-right: 8px;
}

.sidebar-dropdown.active > .sidebar-dropdown-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

.sidebar-dropdown-toggle .fa-chevron-left {
    margin-left: 12px;
    font-size: 0.9rem;
    color: var(--gray);
}

/* Responsive Design */
.mobile-hamburger {
    display: none; /* Hidden by default on desktop */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    direction: ltr;
}

.sidebar-logo-img {
    width: 120px;
    height: 30px;
}

#sidebar-close-icon,
#secondary-sidebar-close-icon {
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    transition: color 0.3s ease;
}

#hamburger-icon {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    position: relative;
    padding: 0.5rem;
}

body.sidebar-open {
    overflow: hidden;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

#mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: 70%;
    max-width: 320px;
    height: 100%;
    background-color: var(--light-gray);
    box-shadow: -10px 0px 30px -15px rgba(0, 0, 0, 0.3);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 25px;
    gap: 15px;
    visibility: hidden;
    transition: transform 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

#mobile-sidebar.active {
    transform: translateX(0);
    visibility: visible;
}

#secondary-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: 70%;
    max-width: 320px;
    height: 100%;
    background-color: var(--light-gray);
    box-shadow: -10px 0px 30px -15px rgba(0, 0, 0, 0.3);
    z-index: 1003; /* Higher than primary sidebar */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 25px;
    gap: 15px;
    visibility: hidden;
    transition: transform 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

#secondary-sidebar.active {
    transform: translateX(0);
    visibility: visible;
}

#secondary-sidebar .sidebar-title {
    color: var(--heading-color);
    margin: 0;
}


#sidebar-close-icon:hover,
#secondary-sidebar-close-icon:hover {
    color: var(--heading-color);
}

.sidebar-nav nav a {
    color: var(--heading-color);
    font-size: 1.2rem;
    font-weight: 500;
    padding: 15px 20px;
    text-decoration: none;
    display: block;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.sidebar-nav nav a:hover {
    background-color: var(--primary-color-light);
}

.sidebar-cta {
    margin-top: auto;
    background-color: var(--primary-color);
    color: var(--heading-color);
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    width: 80%;
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 80px;
}

.sidebar-cta:hover {
    background-color: #0095c7;
}

@media (max-width: 992px) {
    header .container {
        justify-content: flex-start; /* Align items to the right in RTL */
        gap: 0px;
    }
    .logo { order: 2; }
    .mobile-hamburger { order: 1; }
    .header-nav, .header-actions {
        display: none;
    }
    .mobile-hamburger {
        display: block;
    }
}
@media (max-width: 768px) {
    header .container {
        align-items: center;
    }
}