/* Techasoft Revamped Submenu/Mega-Menu Stylesheet */

/* Desktop Styles */
@media (min-width: 768px) {
    /* Main Dropdown Container */
    .second-navbar .dropdown-menu.new-tech,
    .second-navbar .dropdown-menu.new-service {
        display: none;
        position: absolute;
        width: 74vw !important;
        left: 13vw !important;
        top: 100% !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 16px !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03) !important;
        padding: 12px 20px !important;
        margin-top: 10px !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 9999 !important;
        line-height: 1.5 !important;
    }

    /* Override dynamic Product List Menu width restriction if present */
    .second-navbar .dropdown-menu.new-tech.product__list {
        width: 74vw !important;
        left: 13vw !important;
    }

    /* Show on Hover */
    .second-navbar .dropdown:hover>.dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    /* Submenu Row & Column Spacing */
    .sub-menu-row {
        display: flex;
        flex-wrap: wrap;
        margin-right: -15px;
        margin-left: -15px;
    }

    .sub-menu-left {
        flex: 0 0 75%;
        max-width: 75%;
        padding-right: 15px;
        padding-left: 15px;
        border-right: 1px solid #f1f5f9;
    }

    .sub-menu-right {
        flex: 0 0 25%;
        max-width: 25%;
        padding-left: 25px;
        display: flex;
        flex-direction: column;
    }

    /* Grid layout for Product cards inside left side */
    .product-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    /* Product Cards */
    .product-card-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: #f8fafc;
        border: 1px solid #f1f5f9;
        border-radius: 12px;
        text-decoration: none !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .product-card-item:hover {
        background: #ffffff;
        border-color: #0150a9;
        box-shadow: 0 10px 20px rgba(1, 80, 169, 0.08);
        transform: translateY(-2px);
    }

    .product-card-img {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #ffffff;
        border-radius: 8px;
        padding: 6px;
        border: 1px solid #e2e8f0;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }

    .product-card-item:hover .product-card-img {
        transform: scale(1.05);
    }

    .product-card-img img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .product-card-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex-grow: 1;
        overflow: hidden;
    }

    .product-card-name {
        font-family: 'Montserrat', sans-serif;
        font-size: 12.5px;
        font-weight: 600;
        color: #1e293b;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        transition: color 0.2s ease;
    }

    .product-card-item:hover .product-card-name {
        color: #0150a9;
    }

    /* View All Product Card */
    .product-card-item.view-all-card {
        border-style: dashed;
        border-color: #cbd5e1;
        background: transparent;
        justify-content: center;
    }

    .product-card-item.view-all-card:hover {
        border-color: #0150a9;
        background: #f0f7ff;
    }

    .product-card-icon {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f1f5f9;
        border-radius: 8px;
        color: #64748b;
        font-size: 16px;
        transition: all 0.2s ease;
    }

    .product-card-item.view-all-card:hover .product-card-icon {
        background: #0150a9;
        color: #ffffff;
        transform: translateX(3px);
    }

    /* Featured right panel */
    .menu-featured-card {
        display: flex;
        flex-direction: column;
        height: 100%;
        padding: 24px;
        border-radius: 12px;
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        color: #ffffff;
        position: relative;
        overflow: hidden;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }

    .menu-featured-card::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 150px;
        height: 150px;
        background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
        border-radius: 50%;
        pointer-events: none;
    }

    .featured-badge {
        font-family: 'Montserrat', sans-serif;
        font-size: 8.5px;
        font-weight: 700;
        letter-spacing: 0.8px;
        background: #d97706;
        color: #ffffff;
        padding: 3px 8px;
        border-radius: 4px;
        text-transform: uppercase;
        width: fit-content;
        margin-bottom: 14px;
    }

    .featured-badge.purple-badge {
        background: #6366f1;
    }

    .featured-badge.blue-badge {
        background: #2563eb;
    }

    .featured-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 15px;
        font-weight: 700;
        margin-bottom: 8px;
        color: #ffffff;
    }

    .featured-desc {
        font-size: 11px;
        line-height: 1.5;
        color: #94a3b8;
        margin-bottom: 20px;
    }

    .featured-link {
        font-family: 'Montserrat', sans-serif;
        font-size: 11.5px;
        font-weight: 600;
        color: #38bdf8;
        text-decoration: none !important;
        margin-top: auto;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: color 0.2s ease;
    }

    .featured-link:hover {
        color: #7dd3fc;
    }

    .featured-link i {
        font-size: 10px;
        transition: transform 0.2s ease;
    }

    .featured-link:hover i {
        transform: translateX(4px);
    }

    .featured-links-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .featured-link-item {
        font-family: 'Montserrat', sans-serif;
        font-size: 11.5px;
        font-weight: 600;
        color: #475569 !important;
        text-decoration: none !important;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.2s ease;
        padding: 6px 0;
        border-bottom: 1px dashed #e2e8f0;
    }

    .featured-link-item:last-child {
        border-bottom: none;
    }

    .featured-link-item:hover {
        color: #0150a9 !important;
        transform: translateX(4px);
    }

    .featured-link-item i {
        color: #0150a9;
        font-size: 12px;
    }

    .second-navbar .dropdown-menu .menu-featured-card .featured-link-item {
        font-family: 'Montserrat', sans-serif !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        color: rgba(255, 255, 255, 0.85) !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        transition: all 0.2s ease !important;
        padding: 6px 0 !important;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.15) !important;
    }

    .second-navbar .dropdown-menu .menu-featured-card .featured-link-item:last-child {
        border-bottom: none !important;
    }

    .second-navbar .dropdown-menu .menu-featured-card .featured-link-item:hover {
        color: #ffffff !important;
        transform: translateX(4px) !important;
        background-color: transparent !important;
    }

    .second-navbar .dropdown-menu .menu-featured-card .featured-link-item i {
        color: #38bdf8 !important;
        font-size: 12px !important;
    }

    .second-navbar .dropdown-menu .mega-menu-column {
        margin-bottom: 8px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }

    .mega-menu-section-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 13px !important;
        font-weight: 700;
        color: #0f172a;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 6px;
        padding-bottom: 2px;
        border-bottom: 2px solid #0150a9;
        display: flex;
        align-items: center;
        gap: 8px;
        width: fit-content;
    }

    .mega-menu-section-title i {
        color: #0150a9;
        font-size: 13px;
    }

    .mega-menu-section-title.mt-4 {
        margin-top: 8px !important;
    }

    /* Submenu Vertical Link List */
    .mega-menu-list {
        list-style: none !important;
        padding-left: 0 !important;
        margin: 0 !important;
    }

    .mega-menu-list .nav-item {
        padding: 0 !important;
        margin: 0 !important;
    }

    .second-navbar .dropdown-menu .mega-menu-list .nav-link {
        font-size: 12.5px !important;
        color: #475569 !important;
        padding: 2px 0 !important;
        display: flex !important;
        align-items: center !important;
        transition: all 0.2s ease !important;
        background: transparent !important;
        border: none !important;
        text-transform: none !important;
    }

    .second-navbar .dropdown-menu .mega-menu-list .nav-link:hover {
        color: #0150a9 !important;
        transform: translateX(4px) !important;
        font-weight: 600 !important;
    }

    /* Badges for Submenu Items */
    .menu-badge {
        font-size: 8px;
        font-weight: 700;
        padding: 1px 4px;
        border-radius: 3px;
        text-transform: uppercase;
        margin-left: 6px;
        display: inline-block;
        line-height: 1.1;
    }

    .menu-badge.badge-new {
        background-color: #ef4444;
        color: #ffffff;
    }

    .menu-badge.badge-ai {
        background-color: #8b5cf6;
        color: #ffffff;
    }

    .menu-badge.badge-hot {
        background-color: #f97316;
        color: #ffffff;
    }
}

/* Mobile & Tablet Styles (Collapse/Accordion behaviour) */
@media (max-width: 991px) {
    /* Reset layout columns */
    .sub-menu-row {
        display: block !important;
    }

    .sub-menu-left {
        width: 100% !important;
        max-width: 100% !important;
        border-right: none !important;
        padding: 0 !important;
    }

    .sub-menu-right {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .menu-featured-card {
        display: block !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .menu-featured-card .featured-badge,
    .menu-featured-card .featured-title,
    .menu-featured-card .featured-desc,
    .menu-featured-card > .featured-link {
        display: none !important;
    }

    .featured-links-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
        margin-top: 15px !important;
    }

    .featured-link-item {
        font-family: 'Montserrat', sans-serif !important;
        font-size: 12px !important;
        color: #cbd5e1 !important;
        padding: 8px 10px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
        background: transparent !important;
    }

    .featured-link-item:last-child {
        border-bottom: none !important;
    }

    .featured-link-item:hover {
        color: #529ff1 !important;
        background-color: rgba(255, 255, 255, 0.05) !important;
        transform: translateX(4px) !important;
    }

    .featured-link-item i {
        color: #529ff1 !important;
        font-size: 12px !important;
    }


    /* Adjust dynamic Products list */
    .second-navbar .dropdown-menu.new-tech.product__list,
    .second-navbar .dropdown-menu.new-tech,
    .second-navbar .dropdown-menu.new-service {
        width: 100% !important;
        left: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        padding: 10px 15px !important;
    }

    /* Product Grid lists in accordion style on mobile */
    .product-grid {
        display: block !important;
    }

    .product-card-item {
        display: flex !important;
        background: transparent !important;
        border: none !important;
        padding: 8px 10px !important;
        border-radius: 0 !important;
    }

    .product-card-img {
        display: none !important; /* Hide logo images on mobile to save space */
    }

    .product-card-name {
        font-size: 13px !important;
        color: #334155 !important;
        font-weight: 500 !important;
        white-space: normal !important;
    }

    .product-card-item:hover .product-card-name {
        color: #0150a9 !important;
    }

    .product-card-item.view-all-card {
        justify-content: flex-start !important;
    }

    .product-card-icon {
        display: none !important;
    }

    /* Tech & Services Mobile Styles */
    .mega-menu-column {
        margin-bottom: 16px;
    }

    .second-navbar .dropdown-menu .mega-menu-section-title {
        font-size: 11.5px !important;
        font-weight: 700 !important;
        color: #f1f5f9 !important;
        margin-bottom: 8px !important;
        padding-bottom: 2px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .second-navbar .dropdown-menu .mega-menu-list .nav-link {
        font-size: 12px !important;
        color: #cbd5e1 !important;
        padding: 6px 10px !important;
    }

    .second-navbar .dropdown-menu .mega-menu-list .nav-link:hover {
        color: #529ff1 !important;
        background-color: rgba(255, 255, 255, 0.05) !important;
    }

    .menu-badge {
        font-size: 8px;
        padding: 1px 4px;
        border-radius: 3px;
        margin-left: 6px;
    }
}

/* ============================================================
   TECHNOLOGY MEGA-MENU — ENHANCED DESIGN (desktop only)
   ============================================================ */
@media (min-width: 768px) {

    /* Top branding bar */
    .dropdown-menu.new-tech .tech-menu-topbar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding-bottom: 12px;
        margin-bottom: 10px;
        border-bottom: 1px solid #e2e8f0;
    }

    .tech-topbar-icon {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #0150a9 0%, #2563eb 100%);
        border-radius: 7px;
        color: #ffffff;
        font-size: 12px;
        flex-shrink: 0;
    }

    .tech-topbar-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 13px;
        font-weight: 700;
        color: #0f172a;
        letter-spacing: -0.1px;
    }

    .tech-topbar-count {
        font-family: 'Montserrat', sans-serif;
        font-size: 9.5px;
        font-weight: 700;
        color: #0150a9;
        background: #eff6ff;
        border: 1px solid #bfdbfe;
        padding: 2px 9px;
        border-radius: 20px;
        letter-spacing: 0.2px;
    }

    /* Section title icon pill backgrounds */
    .dropdown-menu.new-tech .mega-menu-section-title i {
        width: 22px;
        height: 22px;
        min-width: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #eff6ff;
        border-radius: 5px;
        font-size: 10.5px !important;
        color: #0150a9 !important;
    }

    /* Category colour — UI Design (violet) */
    .dropdown-menu.new-tech .mega-menu-section-title.ti-violet i {
        background: #f5f3ff !important;
        color: #7c3aed !important;
    }
    .dropdown-menu.new-tech .mega-menu-section-title.ti-violet {
        border-bottom-color: #7c3aed !important;
    }

    /* Category colour — Cloud (cyan) */
    .dropdown-menu.new-tech .mega-menu-section-title.ti-cyan i {
        background: #ecfeff !important;
        color: #0891b2 !important;
    }
    .dropdown-menu.new-tech .mega-menu-section-title.ti-cyan {
        border-bottom-color: #0891b2 !important;
    }

    /* Category colour — Data & Analytics (emerald) */
    .dropdown-menu.new-tech .mega-menu-section-title.ti-emerald i {
        background: #ecfdf5 !important;
        color: #059669 !important;
    }
    .dropdown-menu.new-tech .mega-menu-section-title.ti-emerald {
        border-bottom-color: #059669 !important;
    }

    /* Category colour — Web Servers (amber) */
    .dropdown-menu.new-tech .mega-menu-section-title.ti-amber i {
        background: #fffbeb !important;
        color: #d97706 !important;
    }
    .dropdown-menu.new-tech .mega-menu-section-title.ti-amber {
        border-bottom-color: #d97706 !important;
    }

    /* Category colour — Testing (red) */
    .dropdown-menu.new-tech .mega-menu-section-title.ti-red i {
        background: #fef2f2 !important;
        color: #dc2626 !important;
    }
    .dropdown-menu.new-tech .mega-menu-section-title.ti-red {
        border-bottom-color: #dc2626 !important;
    }

    /* Category colour — Software Process (slate) */
    .dropdown-menu.new-tech .mega-menu-section-title.ti-slate i {
        background: #f1f5f9 !important;
        color: #475569 !important;
    }
    .dropdown-menu.new-tech .mega-menu-section-title.ti-slate {
        border-bottom-color: #94a3b8 !important;
    }

    /* AI stack chip tags */
    .ai-tech-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        margin-bottom: 14px;
    }

    .ai-chip {
        font-family: 'Montserrat', sans-serif;
        font-size: 9px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.65);
        background: rgba(255, 255, 255, 0.07);
        border: 1px solid rgba(255, 255, 255, 0.12);
        padding: 3px 8px;
        border-radius: 20px;
        letter-spacing: 0.2px;
        transition: all 0.2s ease;
    }

    .ai-chip:hover {
        background: rgba(56, 189, 248, 0.15);
        border-color: rgba(56, 189, 248, 0.3);
        color: #7dd3fc;
    }

    /* AI panel deeper gradient */
    .dropdown-menu.new-tech .menu-featured-card {
        background: linear-gradient(155deg, #0c1a2e 0%, #0f2d4e 50%, #091929 100%) !important;
    }

    /* Tri-colour accent line at panel bottom */
    .dropdown-menu.new-tech .menu-featured-card::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #0150a9, #38bdf8, #6366f1);
        border-radius: 0 0 12px 12px;
    }
}

/* ============================================================
   SERVICES MEGA-MENU — ENHANCED DESIGN (desktop only)
   ============================================================ */
@media (min-width: 768px) {

    /* Top branding bar */
    .dropdown-menu.new-service .svc-menu-topbar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding-bottom: 12px;
        margin-bottom: 10px;
        border-bottom: 1px solid #e2e8f0;
    }

    .svc-topbar-icon {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
        border-radius: 7px;
        color: #ffffff;
        font-size: 12px;
        flex-shrink: 0;
    }

    .svc-topbar-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 13px;
        font-weight: 700;
        color: #0f172a;
        letter-spacing: -0.1px;
    }

    .svc-topbar-count {
        font-family: 'Montserrat', sans-serif;
        font-size: 9.5px;
        font-weight: 700;
        color: #6d28d9;
        background: #f5f3ff;
        border: 1px solid #ddd6fe;
        padding: 2px 9px;
        border-radius: 20px;
        letter-spacing: 0.2px;
    }

    /* Section title icon pill — services default (blue) */
    .dropdown-menu.new-service .mega-menu-section-title i {
        width: 22px;
        height: 22px;
        min-width: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #eff6ff;
        border-radius: 5px;
        font-size: 10.5px !important;
        color: #0150a9 !important;
    }

    /* Development — blue (brand default, explicit) */
    .dropdown-menu.new-service .mega-menu-section-title.si-blue i {
        background: #eff6ff !important;
        color: #0150a9 !important;
    }
    .dropdown-menu.new-service .mega-menu-section-title.si-blue {
        border-bottom-color: #0150a9 !important;
    }

    /* Online Marketing — orange */
    .dropdown-menu.new-service .mega-menu-section-title.si-orange i {
        background: #fff7ed !important;
        color: #ea580c !important;
    }
    .dropdown-menu.new-service .mega-menu-section-title.si-orange {
        border-bottom-color: #ea580c !important;
    }

    /* Consultant — indigo */
    .dropdown-menu.new-service .mega-menu-section-title.si-indigo i {
        background: #eef2ff !important;
        color: #4f46e5 !important;
    }
    .dropdown-menu.new-service .mega-menu-section-title.si-indigo {
        border-bottom-color: #4f46e5 !important;
    }

    /* Mobile Apps — teal */
    .dropdown-menu.new-service .mega-menu-section-title.si-teal i {
        background: #f0fdfa !important;
        color: #0d9488 !important;
    }
    .dropdown-menu.new-service .mega-menu-section-title.si-teal {
        border-bottom-color: #0d9488 !important;
    }

    /* Creative Design — pink */
    .dropdown-menu.new-service .mega-menu-section-title.si-pink i {
        background: #fdf2f8 !important;
        color: #db2777 !important;
    }
    .dropdown-menu.new-service .mega-menu-section-title.si-pink {
        border-bottom-color: #db2777 !important;
    }

    /* Latest Tech — purple */
    .dropdown-menu.new-service .mega-menu-section-title.si-purple i {
        background: #f5f3ff !important;
        color: #7c3aed !important;
    }
    .dropdown-menu.new-service .mega-menu-section-title.si-purple {
        border-bottom-color: #7c3aed !important;
    }

    /* Software Products — deep blue */
    .dropdown-menu.new-service .mega-menu-section-title.si-deep-blue i {
        background: #eff6ff !important;
        color: #1d4ed8 !important;
    }
    .dropdown-menu.new-service .mega-menu-section-title.si-deep-blue {
        border-bottom-color: #1d4ed8 !important;
    }

    /* Testing — red */
    .dropdown-menu.new-service .mega-menu-section-title.si-red i {
        background: #fef2f2 !important;
        color: #dc2626 !important;
    }
    .dropdown-menu.new-service .mega-menu-section-title.si-red {
        border-bottom-color: #dc2626 !important;
    }

    /* Services panel gradient (purple-dark) */
    .dropdown-menu.new-service .menu-featured-card {
        background: linear-gradient(155deg, #1a0533 0%, #2d1057 50%, #160428 100%) !important;
    }

    /* Bottom tri-colour accent — purple/pink */
    .dropdown-menu.new-service .menu-featured-card::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #6d28d9, #a855f7, #ec4899);
        border-radius: 0 0 12px 12px;
    }
}
