body {
    font-family: "Vazirmatn", sans-serif;
    --bg-gradient: radial-gradient(circle at center, #ffffff 0%, #f0f4ff 50%, #e6f0ff 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow-x: hidden;
    color: #333;
}

/* Navbar */
.navbar-custom {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    padding: 5px 25px;
    margin: 10px 0;
    display: flex; /* Ensure flex properties are applied */
    justify-content: center; /* Center items horizontally */
    align-items: center; /* Center items vertically */
}

.nav-link {
    color: #555 !important;
    padding: 8px 5px !important;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}
.nav-link:hover {
    color: #000 !important;
}

.nav-link.active {
    background: #ebeeff;
    border-radius: 20px;
    color: #000 !important;
    font-weight: bold;
}

/* Hamburger Menu Styles */
.navbar-toggler {
    border: none;
    font-size: 1.5rem;
    color: #555;
    padding: 0.5rem 0.75rem; /* Better padding */
}
.navbar-toggler:focus {
    box-shadow: none;
}

/* Mobile Menu Dropdown */
.mobile-menu-dropdown {
    position: absolute;
    top: 100%; /* Position below navbar */
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 0 0 30px 30px;
    border: 1px solid var(--glass-border);
    border-top: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    z-index: 1020; /* Below mega menu but above content */
    padding: 15px;
    max-height: 0; /* Initially hidden */
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Show mobile menu when toggled */
.mobile-menu-dropdown.show {
    max-height: 500px; /* Adjust as needed */
    padding: 15px;
}

.mobile-menu-dropdown .nav-link {
    padding: 10px 15px !important;
    border-bottom: 1px solid var(--glass-border);
}
.mobile-menu-dropdown .nav-link:last-child {
    border-bottom: none;
}
.mobile-menu-dropdown .btn-register-mobile {
    width: 100%; /* Make mobile register button full width */
    text-align: center;
    margin-top: 10px;
    border-radius: 25px; /* More rounded */
}

/* Hide desktop nav and register button on mobile */
@media (max-width: 992px) {
    .desktop-nav { display: none; }
    .mobile-nav-trigger { display: block; } /* Show hamburger icon */
}
/* Show desktop nav on large screens */
@media (min-width: 992px) {
    .mobile-nav-trigger { display: none; }
    .desktop-nav { display: flex; } /* Use flex for alignment */
}


/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    padding: 25px;
    transition: 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
}

/* Pipeline */
.pipeline-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.rotating-wrapper {
    width: 500px;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#rotatingImage {
    width: 100%;
    backface-visibility: hidden;
}

.pipeline-text {
    position: absolute;
    text-align: center;
    font-weight: 800;
    font-size: 1.4rem;
    max-width: 200px;
    color: #222;
    pointer-events: none;
    z-index: 2;
}

/* Button */
.btn-order {
    background: #000;
    color: #fff;
    border-radius: 50px;
    padding: 10px 30px;
    border: none;
    font-size: 0.9rem;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}
.btn-order:hover {
    background: #333;
}

.btn-register {
    background: #4CAF50;
    color: #fff;
    border-radius: 50px;
    padding: 10px 25px;
    border: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}
.btn-register:hover {
    background: #45a049;
}


/* Services */
.custom-services {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.service-item {
    font-size: 0.85rem;
    color: #444;
    cursor: pointer;
    transition: 0.3s ease;
}

.service-item i {
    font-size: 20px;
    display: block;
    margin-bottom: 6px;
    color: #000;
}

.service-item:hover {
    transform: translateY(-3px);
    color: #000;
}

/* Mega Menu Specific Styles */
.mega-menu-item {
    position: static;
}

.mega-menu {
    position: absolute;
    width: 100%;
    max-width: 100%;
    left: 0;
    top: 100%; /* Position below the navbar */
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 0 0 30px 30px;
    border: 1px solid var(--glass-border);
    border-top: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1050; /* Ensures it is on top of everything */
    overflow: hidden;
    padding: 20px; /* Added padding for content inside */
}

/* Show mega menu when dropdown is active */
.mega-menu-item .dropdown-menu.show.mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Ensure it appears smoothly */
}

/* Ensure mega menu is always displayed when hovered */
.mega-menu-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
}

.mega-menu h6 {
    font-size: 1rem;
    color: #333;
    border-bottom: 2px solid #e0e7ff;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.mega-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-submenu li {
    margin-bottom: 10px;
}

.mega-submenu li a {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease, transform 0.2s ease;
    display: block;
}

.mega-submenu li a:hover {
    color: #000;
    font-weight: 500;
    transform: translateX(-4px);
}

/* Adjustments for RTL */
.rtl .mega-menu .row > div {
    padding-left: var(--bs-gutter-x, 1.5rem);
    padding-right: var(--bs-gutter-x, 1.5rem);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .navbar-custom {
        justify-content: space-between; /* Space out logo, toggler */
    }
    .mega-menu {
        width: calc(100% - 20px); /* Full width minus horizontal padding */
        left: 10px;
        border-radius: 0 0 20px 20px;
        padding: 20px;
        max-height: 70vh;
        overflow-y: auto;
    }
    .mega-menu .row {
        display: flex;
        flex-direction: column;
    }
    .mega-menu .row > div {
        margin-bottom: 20px;
    }
    .mega-menu h6 {
        font-size: 0.9rem;
    }
    .mega-submenu li a {
        font-size: 0.85rem;
    }
    /* Adjust pipeline container height for mobile */
    .pipeline-container {
        height: 400px;
    }
    .rotating-wrapper {
        width: 300px;
        height: 300px;
    }
    .pipeline-text {
        font-size: 1.2rem;
        max-width: 150px;
    }
}

/* Ensure mega menu's positioning is correct */
.mega-menu-item .dropdown-toggle::after {
    display: none; /* Hide default arrow */
}
.header-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}

.header-left,
.header-right {
    width: 200px; /* عرض ثابت برای تراز دقیق */
    display: flex;
    align-items: center;
}

.header-left {
    justify-content: flex-start;
}

.header-right {
    justify-content: flex-end;
}

.navbar-custom.desktop-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
/* Sticky Header */
header {
    position: sticky;
    top: 0;
    z-index: 2000;
}

/* افکت هنگام اسکرول */
header.scrolled .glass-card{
    backdrop-filter: blur(25px);
    background: rgba(255,255,255,0.85);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.mobile-menu{

    max-height:0;
    overflow:hidden;
    transition:all .35s ease;

    margin-top:10px;
    border-top:1px solid rgba(0,0,0,0.05);

}

.mobile-menu.show{

    max-height:500px;
    padding-top:15px;

}

.mobile-menu .nav-link{

    display:block;
    padding:10px 0 !important;
    font-size:.95rem;

}
/* ===== Mega Menu ===== */

.mega-dropdown {
    position: static;
}

.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    border-radius: 0 0 25px 25px;
    border: 1px solid rgba(255,255,255,0.6);
    padding: 25px;
    display: none;
    z-index: 2000;
}

.mega-dropdown:hover .mega-menu {
    display: block;
}

.mega-menu h6 {
    font-size: .95rem;
    font-weight: bold;
    margin-bottom: 12px;
}

.mega-menu a {
    display: block;
    font-size: .85rem;
    color: #555;
    text-decoration: none;
    margin-bottom: 6px;
}

.mega-menu a:hover {
    color: #000;
}

/* موبایل */

@media (max-width:992px){

    .mega-menu{
        position: static;
        display: none;
        box-shadow:none;
        border:none;
        padding:10px 0;
    }

    .mega-dropdown.active .mega-menu{
        display:block;
    }

}
.dropdown-menu {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.6);
}

.dropdown-item {
    font-size: .85rem;
}

.dropdown-item:hover {
    background: #f0f4ff;
}
.mobile-dropdown .mobile-trigger{
    display:flex;
    justify-content:space-between;
    align-items:center;
    cursor:pointer;
}

.mobile-submenu{
    display:none;
    padding:8px 15px;
    border-right:2px solid rgba(0,0,0,0.08);
    margin-right:8px;
}

.mobile-submenu a{
    display:block;
    text-decoration:none;
    color:#555;
    font-size:.9rem;
    padding:7px 0;
}

.mobile-submenu a:hover{
    color:#000;
}

.mobile-dropdown.active .mobile-submenu{
    display:block;
}

.submenu-icon{
    font-size:.8rem;
    transition:.3s;
}

.mobile-dropdown.active .submenu-icon{
    transform:rotate(180deg);
}
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(.97);
    transition: all .25s cubic-bezier(.22,.61,.36,1);
    display: block;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.mobile-submenu{
    max-height:0;
    overflow:hidden;
    opacity:0;
    transform:translateY(-5px);
    padding:0 15px;
    border-right:2px solid rgba(0,0,0,0.08);
    margin-right:8px;

    transition:
            max-height .35s ease,
            opacity .25s ease,
            transform .25s ease,
            padding .25s ease;
}

.mobile-submenu a{
    display:block;
    text-decoration:none;
    color:#555;
    font-size:.9rem;
    padding:7px 0;
}

.mobile-submenu a:hover{
    color:#000;
}

.mobile-dropdown.active .mobile-submenu{
    max-height:300px;
    opacity:1;
    transform:translateY(0);
    padding:8px 15px;
}

.submenu-icon{
    font-size:.8rem;
    transition:transform .3s ease;
}

.mobile-dropdown.active .submenu-icon{
    transform:rotate(180deg);
}