/* Custom styles for MGM Mechanical Services */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a1628;
}
::-webkit-scrollbar-thumb {
    background: #D4AF37;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #E5C158;
}

/* Selection color */
::selection {
    background: rgba(212, 175, 55, 0.3);
    color: #fff;
}

/* Animation keyframes */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(12deg); }
    50% { transform: translateY(-20px) rotate(12deg); }
}

@keyframes float-delayed {
    0%, 100% { transform: translateY(0) rotate(-12deg); }
    50% { transform: translateY(-15px) rotate(-12deg); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 5s ease-in-out infinite;
    animation-delay: 1s;
}

/* Navbar transitions */
#navbar.scrolled {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Service card hover glow */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: radial-gradient(ellipse at top left, rgba(212, 175, 55, 0.05), transparent 60%);
    pointer-events: none;
}

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

/* Mobile menu transitions */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

/* Hamburger animation */
#menu-icon.active #bar1 {
    transform: translateY(4px) rotate(45deg);
}
#menu-icon.active #bar2 {
    opacity: 0;
    transform: scaleX(0);
}
#menu-icon.active #bar3 {
    transform: translateY(-4px) rotate(-45deg);
}

/* Mobile link animation */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* Reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }

.reveal-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Input autofill override */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #0a1628 inset !important;
    -webkit-text-fill-color: #fff !important;
}

/* Focus visible */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .font-serif {
        line-height: 1.1;
    }
}
