/* ==========================================================================
   NextGen Kerala - High-Performance Master Stylesheet
   Buttery-Smooth 60/120 FPS Rendering, GPU Acceleration & Fluid Transitions
   ========================================================================== */

/* --- Base Body & Fluid Typography --- */
html {
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #050505;
    color: #e5e7eb;
    overflow-x: hidden;
}

/* --- Hardware Acceleration Class --- */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

/* --- Section Performance Optimization (Lazy Rendering) --- */
.perf-section {
    content-visibility: auto;
    contain-intrinsic-size: 1px 750px;
}

/* --- Custom Scrollbar (Page level only) --- */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 7px;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: #09090c; 
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: #ec4899; 
    border-radius: 4px;
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: #db2777;
}

/* --- Utility / Hide Scrollbar --- */
.hide-scroll::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}
.hide-scroll,
.no-scrollbar {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch;
}

/* --- 3D Canvas Background Positioning --- */
.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.65;
    pointer-events: none;
    transform: translateZ(0);
}

/* --- Mobile Menu & Submenu Transitions --- */
.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    opacity: 0;
}

.mobile-submenu.open {
    max-height: 500px;
    opacity: 1;
}

/* --- Navigation Dropdowns (Fluid Hover & Click Toggle) --- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) translateZ(0);
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
    pointer-events: none;
    will-change: transform, opacity;
    background: rgba(10, 10, 16, 0.98) !important;
    backdrop-filter: blur(28px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(236, 72, 153, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    max-width: calc(100vw - 32px);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateZ(0);
    pointer-events: auto;
}

.nav-dropdown:hover .nav-dropdown-icon,
.nav-dropdown.is-open .nav-dropdown-icon {
    transform: rotate(180deg);
}

/* Responsive Mega Menu Positioning for Mini & Standard Desktop */
@media (min-width: 768px) {
    #nav-dropdown-services .nav-dropdown-menu {
        left: auto !important;
        right: 0 !important;
        max-width: min(560px, calc(100vw - 32px)) !important;
    }
    #nav-dropdown-about .nav-dropdown-menu {
        left: auto !important;
        right: 0 !important;
        max-width: min(240px, calc(100vw - 32px)) !important;
    }
}

/* --- Hover Dropdown Desktop --- */
.group:hover .group-hover\:block {
    display: block;
    animation: dropdownFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(8px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* --- Glassmorphic Cards (GPU Accelerated) --- */
.glass-card {
    background: rgba(18, 18, 22, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateZ(0);
    transition: border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.glass-card:hover {
    border-color: rgba(236, 72, 153, 0.45);
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 12px 30px -10px rgba(236, 72, 153, 0.25);
}

/* --- Work & Portfolio Hover --- */
.work-card-hover {
    transform: translateZ(0);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}
.work-card-hover:hover {
    border-color: #ec4899;
    transform: translateY(-5px) translateZ(0);
    box-shadow: 0 14px 30px -8px rgba(236, 72, 153, 0.35);
}

/* --- Glow & Neon Text --- */
.neon-text {
    text-shadow: 0 0 15px rgba(236, 72, 153, 0.6), 0 0 30px rgba(236, 72, 153, 0.3);
}

.neon-green-text {
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

/* --- 3D Interactive Logo Carousel --- */
.logo-carousel-container {
    perspective: 1200px;
    overflow: hidden;
    width: 100%;
    height: 450px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    user-select: none;
    transform: translateZ(0);
}
.logo-carousel-container:active {
    cursor: grabbing;
}
.logo-spinner {
    transform-style: preserve-3d;
    height: 100%;
    width: 100%;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 20px;
    will-change: transform;
}
.logo-item {
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(20, 20, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
    backface-visibility: visible;
    filter: grayscale(100%); 
    will-change: transform;
}
.logo-item:hover {
    background: rgba(30, 30, 35, 1);
    border-color: #ec4899;
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.5);
    filter: grayscale(0%);
    transform: scale(1.12) !important;
    z-index: 50;
}
.logo-item i, .logo-item img {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
}
.logo-item span {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.logo-item:hover span { 
    color: #fff;
}

/* Brand specific icon hover colors */
.logo-item:hover i.brand-html { color: #e34c26; }
.logo-item:hover i.brand-react { color: #61dbfb; }
.logo-item:hover i.brand-wordpress { color: #21759b; }
.logo-item:hover i.brand-google { color: #4285f4; }
.logo-item:hover i.brand-meta { color: #1877f2; }
.logo-item:hover i.brand-bing { color: #00897b; }
.logo-item:hover i.brand-js { color: #f7df1e; }
.logo-item:hover i.brand-css { color: #264de4; }
.logo-item:hover i.brand-shopify { color: #96bf48; }
.logo-item:hover i.brand-woo { color: #96588a; }
.logo-item:hover i.brand-node { color: #339933; }
.logo-item:hover i.brand-python { color: #3776ab; }

/* --- Progress Bar Animation --- */
@keyframes loadProgress {
    from { width: 0; }
}
.progress-bar-fill {
    animation: loadProgress 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Floating Action Buttons --- */
.floating-action-btn {
    transform: translateZ(0);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    will-change: transform;
}
.floating-action-btn:hover {
    transform: translateY(-3px) scale(1.05) translateZ(0);
}

/* --- Toast Alerts --- */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    padding: 14px 20px;
    border-radius: 12px;
    background: rgba(18, 18, 22, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    animation: toastSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(0);
}
@keyframes toastSlideIn {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* --- Service Pricing Cards & Checklists --- */
.price-card {
    border: 1px solid #27272a;
    transform: translateZ(0);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease, box-shadow 0.28s ease;
    will-change: transform;
}
.price-card:hover {
    border-color: #10b981;
    transform: translateY(-4px) translateZ(0);
}
.price-card.popular {
    border: 2px solid #ec4899;
    background: linear-gradient(145deg, rgba(236, 72, 153, 0.12), rgba(10, 10, 10, 0.95));
    transform: scale(1.03) translateZ(0);
    z-index: 10;
    box-shadow: 0 15px 35px -10px rgba(236, 72, 153, 0.3);
}
.price-card.popular:hover {
    transform: scale(1.05) translateY(-4px) translateZ(0);
    box-shadow: 0 20px 40px -10px rgba(236, 72, 153, 0.4);
}

.check-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.6rem;
    color: #d1d5db;
    font-size: 0.875rem;
    line-height: 1.4;
}
.check-list i {
    color: #10b981;
    margin-right: 0.6rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

/* --- Tech Icons Hover Animation --- */
.tech-icon-wrapper i {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}
.tech-icon-wrapper:hover i {
    transform: scale(1.18) translateZ(0);
}

/* --- Modal Backdrop & Animations --- */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.animate-fadeIn {
    animation: fadeInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) translateZ(0);
    }
}

/* --- Testimonial Cards & Scroller --- */
.testimonial-card {
    background: rgba(18, 18, 22, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateZ(0);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease, box-shadow 0.28s ease;
    will-change: transform;
}
.testimonial-card:hover {
    border-color: rgba(236, 72, 153, 0.45);
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 14px 32px -10px rgba(236, 72, 153, 0.25);
}

/* Horizontal Scroller Specific Sizing (Homepage Slider) */
#testimonial-scroll .testimonial-card {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    #testimonial-scroll .testimonial-card {
        flex: 0 0 calc((100% - 3rem) / 3);
        width: calc((100% - 3rem) / 3);
        min-width: calc((100% - 3rem) / 3);
        max-width: calc((100% - 3rem) / 3);
    }
}

@media (min-width: 1024px) {
    #testimonial-scroll .testimonial-card {
        flex: 0 0 calc((100% - 4.5rem) / 4);
        width: calc((100% - 4.5rem) / 4);
        min-width: calc((100% - 4.5rem) / 4);
        max-width: calc((100% - 4.5rem) / 4);
    }
}
