/* =============================================
   ANIMATIONS, 3D EFFECTS & GLASS MORPHISM
   ============================================= */

/* ----- KEYFRAME ANIMATIONS ----- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotate3d {
    0% {
        transform: perspective(1000px) rotateY(0deg);
    }
    100% {
        transform: perspective(1000px) rotateY(360deg);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(252, 129, 14, 0.4);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 20px rgba(252, 129, 14, 0);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(252, 129, 14, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(252, 129, 14, 0.8);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes morph {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

@keyframes tilt3d {
    0%, 100% { transform: perspective(1000px) rotateX(5deg) rotateY(-5deg); }
    50% { transform: perspective(1000px) rotateX(-5deg) rotateY(5deg); }
}

/* ----- SCROLL REVEAL ANIMATIONS ----- */
.reveal {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-up {
    transform: translateY(40px);
}

.reveal-up.reveal-active {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.8s ease-out forwards;
}

.reveal-left {
    transform: translateX(-50px);
}

.reveal-left.reveal-active {
    opacity: 1;
    transform: translateX(0);
    animation: fadeInLeft 0.8s ease-out forwards;
}

.reveal-right {
    transform: translateX(50px);
}

.reveal-right.reveal-active {
    opacity: 1;
    transform: translateX(0);
    animation: fadeInRight 0.8s ease-out forwards;
}

.reveal-scale {
    transform: scale(0.85);
}

.reveal-scale.reveal-active {
    opacity: 1;
    transform: scale(1);
    animation: scaleIn 0.8s ease-out forwards;
}

.reveal-fade {
    opacity: 0;
}

.reveal-fade.reveal-active {
    opacity: 1;
    animation: fadeIn 1.2s ease-out forwards;
}

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* ----- 3D EFFECTS ----- */
.perspective {
    perspective: 1200px;
    transform-style: preserve-3d;
}

/* Hero image - 3D rotating circle */
.hero-img-circle {
    animation: float 4s ease-in-out infinite, glow 3s ease-in-out infinite;
    transform-style: preserve-3d;
    position: relative;
}

.hero-img-circle::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #FC810E, transparent, #FC810E, transparent, #FC810E);
    z-index: -1;
    opacity: 0.5;
    filter: blur(20px);
    animation: spinSlow 8s linear infinite;
}

.hero-img-circle:hover {
    transform: perspective(1200px) rotateY(15deg) rotateX(8deg) scale(1.05);
    transition: transform 0.6s ease;
}

/* Metal cards - 3D tilt */
.metal-card,
.scrap-card-img,
.service-circle {
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s ease;
}

.metal-card:hover {
    transform: perspective(1000px) rotateY(12deg) rotateX(8deg) translateZ(30px) scale(1.05);
    box-shadow: 0 30px 60px rgba(252, 129, 14, 0.3),
                0 0 0 1px rgba(252, 129, 14, 0.2);
}

.scrap-card-img:hover {
    transform: perspective(1000px) rotateY(-12deg) rotateX(8deg) translateZ(40px) scale(1.08);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.service-circle:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(-10deg) translateZ(40px) scale(1.08);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* 3D Buttons */
.btn-primary {
    transform-style: preserve-3d;
    position: relative;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-4px) translateZ(20px);
    box-shadow: 0 15px 30px rgba(252, 129, 14, 0.4),
                0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(-1px) translateZ(10px);
}

/* Logo 3D effect */
.logo img {
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.logo img:hover {
    transform: perspective(800px) rotateY(15deg) scale(1.05);
}

/* Card icon with 3D effect */
.card-icon {
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

.scrap-card:hover .card-icon {
    transform: translateX(-50%) translateZ(30px) rotateY(360deg);
}

/* About image 3D */
.about-image img {
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.about-image img:hover {
    transform: perspective(1200px) rotateY(-12deg) rotateX(5deg) translateZ(30px);
}

/* Testimonial cards 3D lift */
.testimonial-card {
    transform-style: preserve-3d;
    transition: all 0.4s ease;
}

.testimonial-card:hover {
    transform: perspective(1000px) translateZ(30px) rotateX(2deg) rotateY(-3deg) translateY(-8px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.12);
}

/* ----- GLASS MORPHISM EFFECTS ----- */
.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

.glass-dark {
    background: rgba(13, 27, 77, 0.35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-light {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header glass */
.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Contact form glass effect */
.contact-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3),
                inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.contact-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(252,129,14,0.3), transparent, rgba(252,129,14,0.3));
    z-index: -1;
    opacity: 0.5;
}

/* Testimonial card glass */
.testimonial-card {
    background: rgba(249, 250, 251, 0.85);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Service circle glass overlay */
.service-circle::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    border-radius: 50%;
    pointer-events: none;
}

/* Footer glass */
.footer {
    background: linear-gradient(180deg, rgba(13,27,77,0.95) 0%, rgba(13,27,77,1) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ----- SPECIAL ANIMATIONS ----- */
/* Section titles underline grow */
.section-title::after,
.section-title-white::after {
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.6s ease;
}

.section-title.reveal-active::after,
.section-title-white.reveal-active::after {
    transform: scaleX(1);
}

/* Hero title gradient animation */
.hero-content h1 {
    background: linear-gradient(135deg, #1a2238 0%, #1a2238 50%, #FC810E 50%, #FC810E 100%);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease-in-out infinite;
}

.hero-content h1 span.primary-color {
    background: linear-gradient(135deg, #FC810E 0%, #e5730c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Stars twinkle */
.star {
    display: inline-block;
    animation: scaleIn 0.5s ease forwards;
}

.stars .star:nth-child(1) { animation-delay: 0.1s; }
.stars .star:nth-child(2) { animation-delay: 0.2s; }
.stars .star:nth-child(3) { animation-delay: 0.3s; }
.stars .star:nth-child(4) { animation-delay: 0.4s; }
.stars .star:nth-child(5) { animation-delay: 0.5s; }

/* Avatar pulse on testimonial hover */
.testimonial-card:hover .avatar {
    animation: pulse 1s ease-in-out;
}

/* Morphing background blob */
.hero::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(252,129,14,0.1), transparent 70%);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morph 8s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

/* Loading shimmer effect on images */
.scrap-card-img img,
.metal-card img,
.service-circle img,
.hero-img-circle img {
    transition: transform 0.5s ease;
}

.scrap-card:hover .scrap-card-img img,
.metal-card:hover img,
.service-circle:hover img {
    transform: scale(1.1);
}

/* Nav link underline effect */
.nav a {
    position: relative;
    padding-bottom: 4px;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav a:hover::after {
    width: 100%;
}

/* Input focus glass effect */
.contact-form input,
.contact-form textarea {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 4px rgba(252, 129, 14, 0.15);
    transform: translateZ(10px);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FC810E, #e5730c);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #e5730c, #d4650a);
}

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

/* Trust badges with glow */
.badge {
    transition: all 0.3s ease;
    cursor: pointer;
}

.badge:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(252, 129, 14, 0.3);
}

/* Animated gradient text */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Phone link hover */
.phone {
    transition: all 0.3s ease;
}

.phone:hover {
    transform: translateX(3px);
}

.phone:hover svg {
    transform: rotate(15deg);
    transition: transform 0.3s ease;
}

/* Footer link hover 3D */
.footer-col a {
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-col a:hover {
    transform: translateX(5px) translateZ(10px);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
