/* ===========================
   ANIMATIONS
   =========================== */

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

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

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

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

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 102, 204, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 102, 204, 0.8);
    }
}

@keyframes rotate3d {
    from {
        transform: rotateX(0) rotateY(0) rotateZ(0);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

@keyframes wave {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(1200px);
    }
}

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

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

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

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

@keyframes wobble {
    0%, 100% {
        transform: translateX(0);
    }
    15% {
        transform: translateX(-5px) rotate(-1deg);
    }
    30% {
        transform: translateX(5px) rotate(1deg);
    }
    45% {
        transform: translateX(-5px) rotate(-1deg);
    }
    60% {
        transform: translateX(3px) rotate(0.5deg);
    }
    75% {
        transform: translateX(-2px) rotate(-0.5deg);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===========================
   ANIMATION CLASSES
   =========================== */

.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-15px);
}

.card-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.card-fade-in:nth-child(1) {
    animation-delay: 0s;
}

.card-fade-in:nth-child(2) {
    animation-delay: 0.1s;
}

.card-fade-in:nth-child(3) {
    animation-delay: 0.2s;
}

.card-fade-in:nth-child(4) {
    animation-delay: 0.3s;
}

.card-fade-in:nth-child(5) {
    animation-delay: 0.4s;
}

.card-fade-in:nth-child(6) {
    animation-delay: 0.5s;
}

/* ===========================
   3D PERSPECTIVE EFFECTS
   =========================== */

.perspective {
    perspective: 1000px;
}

.flip-card {
    background-color: transparent;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover {
    transform: rotateY(180deg);
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-card-back {
    background-color: var(--primary-color);
    color: white;
    transform: rotateY(180deg);
}

/* ===========================
   SCROLL ANIMATIONS
   =========================== */

.scroll-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.scroll-slide-in {
    opacity: 0;
    animation: slideInUp 0.8s ease-out forwards;
}

/* ===========================
   BUTTON ANIMATIONS
   =========================== */

.btn-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.btn-glow {
    animation: glow 2s ease-in-out infinite;
}

/* ===========================
   TEXT ANIMATIONS
   =========================== */

.text-shimmer {
    background: linear-gradient(90deg, #000 0%, #fff 50%, #000 100%);
    background-size: 200% auto;
    color: #000;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

.text-gradient {
    background: linear-gradient(90deg, #0066cc, #00d4ff, #ff6b35);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

/* ===========================
   ELEMENT ANIMATIONS
   =========================== */

.element-bounce {
    animation: bounce 2s ease-in-out infinite;
}

.element-float {
    animation: float 3s ease-in-out infinite;
}

.element-rotate {
    animation: rotate3d 20s linear infinite;
}

.element-wobble {
    animation: wobble 1s ease-in-out;
}

.element-flip {
    animation: flip 6s linear infinite;
}

/* ===========================
   LOADING ANIMATIONS
   =========================== */

.spinner {
    border: 4px solid rgba(0, 102, 204, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: rotate3d 1s linear infinite;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 102, 204, 0.2);
    border-top: 2px solid var(--primary-color);
}

.spinner-large {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(0, 102, 204, 0.2);
    border-top: 5px solid var(--primary-color);
}

/* ===========================
   STAGGER ANIMATIONS
   =========================== */

.stagger-item {
    animation: slideInUp 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-item:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-item:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-item:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* ===========================
   TRANSITION HELPERS
   =========================== */

.transition-fast {
    transition: all 0.15s ease;
}

.transition-base {
    transition: all 0.3s ease;
}

.transition-slow {
    transition: all 0.6s ease;
}

/* ===========================
   HOVER EFFECTS
   =========================== */

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.hover-color {
    transition: color 0.3s ease;
}

.hover-color:hover {
    color: var(--primary-color);
}

.hover-bright {
    transition: filter 0.3s ease;
}

.hover-bright:hover {
    filter: brightness(1.1);
}

/* ===========================
   RESPONSIVE ANIMATIONS
   =========================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .hero-title {
        animation: slideInDown 0.8s ease-out;
    }

    .hero-subtitle {
        animation: slideInUp 0.8s ease-out 0.2s both;
    }

    .cta-buttons {
        animation: slideInUp 0.8s ease-out 0.4s both;
    }

    .section-title {
        animation: slideInUp 0.6s ease-out;
    }

    .service-card,
    .about-card,
    .industry-card {
        animation: slideInUp 0.6s ease-out;
    }
}

/* ===========================
   FORM ANIMATIONS
   =========================== */

.form-group {
    animation: slideInUp 0.5s ease-out backwards;
}

.form-group:nth-child(1) {
    animation-delay: 0.1s;
}

.form-group:nth-child(2) {
    animation-delay: 0.2s;
}

.form-group:nth-child(3) {
    animation-delay: 0.3s;
}

.form-group:nth-child(4) {
    animation-delay: 0.4s;
}

.form-group:nth-child(5) {
    animation-delay: 0.5s;
}

.form-submit {
    animation: slideInUp 0.5s ease-out 0.6s backwards;
}

/* ===========================
   SUCCESS/ERROR ANIMATIONS
   =========================== */

.success-message {
    animation: slideInDown 0.5s ease-out;
}

.error-message {
    animation: wobble 0.5s ease-out;
}

/* ===========================
   PARALLAX EFFECT
   =========================== */

.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ===========================
   GRADIENT ANIMATIONS
   =========================== */

.gradient-animated {
    background: linear-gradient(-45deg, #0066cc, #00d4ff, #ff6b35, #0066cc);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

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

/* ===========================
   ADVANCED 3D TRANSFORMS
   =========================== */

.cube-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.cube-3d:hover {
    transform: rotateX(20deg) rotateY(20deg);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.neon-glow {
    text-shadow: 0 0 10px rgba(0, 102, 204, 0.5),
                 0 0 20px rgba(0, 212, 255, 0.5);
    animation: glow 2s ease-in-out infinite;
}
