/* ==============================================
   MARKET MAESTRO - PREMIUM BEAUTIFICATION CSS
   Modern UI/UX Effects & Animations
   ============================================== */

/* === 1. SMOOTH SCROLLING === */
html {
    scroll-behavior: smooth;
}

/* === 2. ANIMATED BACKGROUND MESH GRADIENTS === */
body {
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    animation: drift 20s ease-in-out infinite alternate;
}

body::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #1e40af 0%, #0f172a 70%);
    top: -200px;
    left: -200px;
}

body::after {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, #1e3a8a 0%, #0f172a 70%);
    bottom: -300px;
    right: -300px;
    animation-delay: -10s;
    animation-duration: 25s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, 30px) scale(1.1);
    }
    100% {
        transform: translate(-30px, 50px) scale(0.95);
    }
}

/* === 3. PREMIUM BUTTON EFFECTS === */
/* Primary CTA Buttons - "Book a 15-minute audit" */
.bg-accent,
a.bg-accent,
button.bg-accent {
    position: relative;
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulsating Glow Effect */
.bg-accent::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: #FFD700;
    border-radius: inherit;
    filter: blur(12px);
    opacity: 0.4;
    z-index: -1;
    animation: pulse-glow 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Hover State - Enhanced Glow */
.bg-accent:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6),
                0 0 60px rgba(255, 215, 0, 0.3);
}

.bg-accent:hover::before {
    opacity: 0.8;
    filter: blur(20px);
}

/* Active/Focus State */
.bg-accent:active {
    transform: scale(0.98);
}

/* === 4. GLASSMORPHISM EFFECTS === */
/* Glass Navigation Header */
nav.fixed,
nav.bg-white.fixed,
nav.shadow-md.fixed {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

nav.fixed.dark\:bg-gray-800,
nav.dark\:bg-gray-800.fixed {
    background: rgba(31, 41, 55, 0.98) !important;
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Glass Dropdown Menus */
[id$="-menu"] {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.92)) !important;
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15),
                0 2px 8px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Force dropdown links to have dark text */
[id$="-menu"] a {
    color: #212121 !important;
    transition: all 0.2s ease;
}

[id$="-menu"] a:hover {
    color: #212121 !important;
    background: rgba(255, 215, 0, 0.15) !important;
    border-left: 3px solid #FFD700;
    padding-left: calc(1rem - 3px) !important;
}

.dark [id$="-menu"] {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(31, 41, 55, 0.92)) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 2px 8px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dark [id$="-menu"] a {
    color: #ffffff !important;
}

.dark [id$="-menu"] a:hover {
    background: rgba(255, 215, 0, 0.2) !important;
    border-left: 3px solid #FFD700;
}

/* Dropdown Animation - Slide Down & Fade */
[id$="-menu"] {
    animation: slideDownFade 0.3s ease-out;
    transform-origin: top centre;
}

@keyframes slideDownFade {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fix first dropdown item alignment */
[id$="-menu"] a:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

[id$="-menu"] a:last-child,
[id$="-menu"] > div:last-child a {
    border-radius: 0 0 0.5rem 0.5rem;
}

/* === 5. CARD HOVER EFFECTS === */
/* Sector & Service Cards - Border Beam Effect */
/* Only target cards inside sections, not navigation or other elements */
section .bg-gray-100,
section .dark\:bg-gray-900,
section .bg-gray-900\/50,
section div.bg-white:not(nav):not(header) {
    position: relative;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Specific overflow for cards that need it, but preserve numbered badges */
#maestro-method .bg-gray-900\/50 {
    overflow: visible;
}

/* Inner Glow on Hover */
section .bg-gray-100:hover,
section .dark\:bg-gray-900:hover,
section .bg-gray-900\/50:hover,
section div.bg-white:hover {
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.15),
                0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Border Beam Effect */
section .bg-gray-100::after,
section .dark\:bg-gray-900::after,
section .bg-gray-900\/50::after,
section div.bg-white::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 215, 0, 0.4) 50%, 
        transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, 
                   linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, 
          linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none; /* Don't block clicks! */
}

section .bg-gray-100:hover::after,
section .dark\:bg-gray-900:hover::after,
section .bg-gray-900\/50:hover::after,
section div.bg-white:hover::after {
    opacity: 1;
}

/* === 6. SCROLL REVEAL ANIMATIONS === */
/* Elements fade in and slide up on scroll */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto; /* Ensure elements remain clickable */
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Stagger delays for multiple elements */
.scroll-reveal:nth-child(1) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.3s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.4s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.5s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.6s; }

/* === 7. ENHANCED TRANSITIONS === */
/* Smooth all interactive elements */
a, button, .transition {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card scale effects */
.hover\:scale-\[1\.02\]:hover {
    transform: scale(1.02);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === 8. MOBILE OPTIMIZATION === */
/* Reduce intensive effects on mobile for performance */
@media (max-width: 768px) {
    body::before,
    body::after {
        filter: blur(80px);
        opacity: 0.08;
    }
    
    .bg-accent::before {
        filter: blur(8px);
        animation: none;
    }
    
    nav.fixed {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    
    [id$="-menu"] {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* === 9. PERFORMANCE & ACCESSIBILITY === */
/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* === 10. ADDITIONAL PREMIUM TOUCHES === */
/* Subtle shadow depth on cards */
.shadow-lg,
.shadow-xl,
.shadow-2xl {
    transition: box-shadow 0.3s ease;
}

.shadow-lg:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.shadow-xl:hover {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.shadow-2xl:hover {
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* Smooth nav link hover */
nav a {
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #FFD700;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* === 11. HERO SECTION ENHANCEMENT === */
header.relative {
    isolation: isolate;
}

/* Add subtle animation to hero content */
header h1,
header p,
header .flex {
    animation: fadeInUp 1s ease-out backwards;
}

header h1 {
    animation-delay: 0.2s;
}

header p {
    animation-delay: 0.4s;
}

header .flex {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === 13. HEADER RADIAL GRADIENT GLOW === */
.bg-gradient-radial {
    background: radial-gradient(circle at center top, var(--tw-gradient-stops));
}






