/*--------------------------------------------------------------
  Services Mega Menu - Odoo Style
  Tech G Solution Website Enhancement
--------------------------------------------------------------*/

/* ========== Header Navigation ========== */
.header-services-nav {
    display: inline-block;
    margin-left: auto;
    margin-right: 120px; /* Space before hamburger menu */
}

.header-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.header-menu-item {
    position: relative;
}

/* Services Trigger Link & Header Links */
.services-trigger,
.header-link {
    display: block;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
    position: relative;
}

.services-trigger::after,
.header-link::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #FFD45A;
    transition: width 0.3s ease;
}

.services-trigger:hover,
.header-link:hover {
    color: #FFD45A;
}

.services-trigger:hover::after,
.header-link:hover::after {
    width: 60%;
}

/* Adjust trigger color when header background changes */
.change-menu-background .services-trigger,
.change-menu-background .header-link {
    color: rgba(255, 255, 255, 1);
}

/* ========== Mega Menu Container ========== */
.services-mega-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.services-mega-menu.active {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
}

/* Overlay Background */
.mega-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Mega Menu Content Panel */
.mega-menu-content {
    position: absolute;
    top: 100px; /* Below header */
    left: 50%;
    transform: translate(-50%, -20px);
    width: 90%;
    max-width: 1200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 50px 40px 40px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.services-mega-menu.active .mega-menu-content {
    transform: translate(-50%, 0);
}

/* Close Button */
.mega-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #2f2f2f;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.mega-menu-close:hover {
    background: #f1f1f1;
    color: #C5A992;
    transform: rotate(90deg);
}

/* ========== Service Categories ========== */
.service-category {
    margin-bottom: 45px;
}

.service-category:last-of-type {
    margin-bottom: 0;
}

.category-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #2f2f2f;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 3px solid #C5A992;
    display: inline-block;
}

/* Service Grid Layout */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media screen and (max-width: 1200px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== Service Cards ========== */
.service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 35px 25px;
    background: #fff;
    border: 2px solid #f1f1f1;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

/* Hover effect background */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #C5A992 0%, #FFD45A 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.service-card:hover::before {
    opacity: 0.05;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: #C5A992;
    box-shadow: 0 12px 30px rgba(197, 169, 146, 0.2);
}

/* Service Icon */
.service-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #C5A992 0%, #FFD45A 100%);
    border-radius: 50%;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(197, 169, 146, 0.3);
}

.service-icon i.icon {
    font-size: 36px;
    color: #fff;
}

/* Service Name */
.service-name {
    font-size: 1.3em;
    font-weight: 700;
    color: #2f2f2f;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.service-card:hover .service-name {
    color: #C5A992;
}

/* Service Description */
.service-description {
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
    margin: 0;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.service-card:hover .service-description {
    color: #2f2f2f;
}

/* ========== Mega Menu Footer ========== */
.mega-menu-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f1f1f1;
    text-align: center;
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    background: #2f2f2f;
    color: #fff;
    font-size: 1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-view-all:hover {
    background: #C5A992;
    color: #fff;
    transform: translateX(5px);
}

.btn-view-all i.icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.btn-view-all:hover i.icon {
    transform: translateX(5px);
}

/* ========== Responsive Design ========== */

/* Large Tablets and Below (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    .header-services-nav {
        margin-right: 80px;
    }

    .mega-menu-content {
        width: 95%;
        padding: 40px 30px 30px;
    }

    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets (max-width: 768px) */
@media screen and (max-width: 768px) {
    /* Hide desktop header nav, show in hamburger menu instead */
    .header-services-nav {
        display: none;
    }

    /* Mega menu becomes full-screen modal on mobile */
    .mega-menu-content {
        top: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 70px 20px 30px;
        transform: translate(-50%, 0);
    }

    .services-mega-menu.active .mega-menu-content {
        transform: translate(-50%, 0);
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 25px 20px;
    }

    .category-title {
        font-size: 1.1em;
    }
}

/* Mobile Phones (max-width: 480px) */
@media screen and (max-width: 480px) {
    .service-icon {
        width: 60px;
        height: 60px;
    }

    .service-icon i.icon {
        font-size: 28px;
    }

    .service-name {
        font-size: 1.1em;
    }

    .service-description {
        font-size: 0.9em;
    }

    .mega-menu-close {
        top: 15px;
        right: 15px;
        font-size: 24px;
    }
}

/* ========== Animation Enhancements ========== */

/* Staggered animation for service cards */
.services-mega-menu.active .service-card {
    animation: slideInUp 0.4s ease backwards;
}

/* Simplified staggered animation for multiple cards */
.services-mega-menu.active .service-card:nth-child(1) {
    animation-delay: 0.05s;
}

.services-mega-menu.active .service-card:nth-child(2) {
    animation-delay: 0.1s;
}

.services-mega-menu.active .service-card:nth-child(3) {
    animation-delay: 0.15s;
}

.services-mega-menu.active .service-card:nth-child(4) {
    animation-delay: 0.2s;
}

.services-mega-menu.active .service-card:nth-child(5) {
    animation-delay: 0.25s;
}

.services-mega-menu.active .service-card:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scrollbar for content overflow */
.mega-menu-content::-webkit-scrollbar {
    width: 8px;
}

.mega-menu-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.mega-menu-content::-webkit-scrollbar-thumb {
    background: #C5A992;
    border-radius: 10px;
}

.mega-menu-content::-webkit-scrollbar-thumb:hover {
    background: #a68a75;
}

/* ========== Print Styles ========== */
@media print {
    .services-mega-menu {
        display: none !important;
    }
}

/* ========== Back to Top Button ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #C5A992 0%, #FFD45A 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(197, 169, 146, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(197, 169, 146, 0.5);
}

.back-to-top:active {
    transform: translateY(-2px);
}

.back-to-top i {
    font-size: 20px;
}

@media screen and (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}
