/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.preloader-content {
    text-align: center;
}

.preloader-logo {
    width: 80px;
    /* Optional: Keep a subtle logo pulse for the loader only if desired, otherwise remove animation property */
    animation: pulse-logo 2s infinite;
}

@keyframes pulse-logo {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Cursor Canvas */
#cursorCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    /* Behind content but valid for click events if we handle them on window */
}

/* Typing Cursor */
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Service Card Icon Animations */

/* Base Wrapper */
.icon-wrapper {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 1. Web Development (Typing Code) */
.browser-window {
    width: 60px;
    height: 45px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.browser-window::before {
    /* Header */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--primary);
    opacity: 0.3;
}

.code-lines span {
    display: block;
    height: 2px;
    background: var(--primary);
    margin: 6px 4px;
    opacity: 0;
    width: 0;
    animation: typeLines 2s infinite;
}

.code-lines span:nth-child(1) {
    width: 40%;
    animation-delay: 0s;
}

.code-lines span:nth-child(2) {
    width: 70%;
    animation-delay: 0.3s;
}

.code-lines span:nth-child(3) {
    width: 50%;
    animation-delay: 0.6s;
}

@keyframes typeLines {
    0% {
        width: 0;
        opacity: 1;
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }

    /* Keep visible until restart */
}

/* 2. Mobile Apps (Floating Phone) */
.phone-frame {
    width: 30px;
    height: 55px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    position: relative;
    animation: floatPhone 3s ease-in-out infinite;
}

.app-bubbles .bubble {
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    position: absolute;
    opacity: 0;
}

.app-bubbles .bubble:nth-child(1) {
    top: 20%;
    left: 20%;
    animation: popIn 2s infinite 0s;
}

.app-bubbles .bubble:nth-child(2) {
    top: 40%;
    right: 20%;
    animation: popIn 2s infinite 0.5s;
}

.app-bubbles .bubble:nth-child(3) {
    bottom: 20%;
    left: 30%;
    animation: popIn 2s infinite 1s;
}

@keyframes floatPhone {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* 3. IoT (Connected Nodes) */
.node {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
}

.center-node {
    width: 12px;
    height: 12px;
    z-index: 2;
}

.satellite-node {
    background: var(--secondary);
    animation: revolve 4s linear infinite;
}

.s1 {
    top: 10px;
    left: 35px;
}

.s2 {
    top: 60px;
    left: 15px;
    animation-delay: -1s;
}

.s3 {
    top: 60px;
    left: 55px;
    animation-delay: -2s;
}

.connection {
    position: absolute;
    background: var(--primary);
    height: 1px;
    transform-origin: 0 0;
    opacity: 0.5;
}

@keyframes revolve {
    0% {
        transform: rotate(0deg) translateX(25px) rotate(0deg);
    }

    100% {
        transform: rotate(360deg) translateX(25px) rotate(-360deg);
    }
}

/* 4. UI/UX (Layers) */
.layer {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary);
    background: rgba(255, 255, 255, 0.05);
    position: absolute;
    border-radius: 6px;
    transform: rotateX(60deg) rotateZ(-45deg);
    transition: transform 0.3s;
}

.l1 {
    top: 10px;
    z-index: 3;
    animation: floatLayer 3s infinite 0s;
}

.l2 {
    top: 25px;
    z-index: 2;
    animation: floatLayer 3s infinite 0.2s;
    opacity: 0.7;
}

.l3 {
    top: 40px;
    z-index: 1;
    animation: floatLayer 3s infinite 0.4s;
    opacity: 0.4;
}

.pointer-cursor {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid var(--secondary);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: rotate(-30deg);
    animation: moveCursor 3s infinite;
    z-index: 4;
}

@keyframes floatLayer {

    0%,
    100% {
        transform: rotateX(60deg) rotateZ(-45deg) translateZ(0);
    }

    50% {
        transform: rotateX(60deg) rotateZ(-45deg) translateZ(10px);
    }
}

@keyframes moveCursor {
    0% {
        top: 60%;
        left: 60%;
    }

    50% {
        top: 30%;
        left: 30%;
    }

    100% {
        top: 60%;
        left: 60%;
    }
}

/* 5. SDM (Growth Chart) */
.chart-bar {
    width: 10px;
    background: var(--primary);
    position: absolute;
    bottom: 0;
    border-radius: 2px 2px 0 0;
    transform-origin: bottom;
}

.b1 {
    height: 20px;
    left: 15px;
    animation: growBar 2s infinite;
}

.b2 {
    height: 35px;
    left: 30px;
    animation: growBar 2s infinite 0.2s;
}

.b3 {
    height: 50px;
    left: 45px;
    animation: growBar 2s infinite 0.4s;
}

/* Growth arrow removed per user request */

@keyframes growBar {
    0% {
        transform: scaleY(0.2);
    }

    50% {
        transform: scaleY(1);
    }

    100% {
        transform: scaleY(0.2);
    }
}

/* 6. Consult (Chat Bubbles) */
.chat-bubble {
    width: 25px;
    height: 20px;
    border-radius: 6px;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-bubble::before {
    content: '...';
    font-size: 10px;
    line-height: 0;
    color: #fff;
}

.left {
    background: var(--primary);
    top: 20px;
    left: 10px;
    animation: bubbleFloat 3s infinite;
}

.right {
    background: var(--secondary);
    top: 40px;
    right: 10px;
    animation: bubbleFloat 3s infinite 1.5s;
}

.gear-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    border-top: 2px solid transparent;
    position: absolute;
    top: 5px;
    right: 5px;
    animation: spin 2s linear infinite;
    opacity: 0.5;
}

@keyframes bubbleFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Premium CTA Shine Animation */
.cta-shine {
    position: relative;
    overflow: hidden;
}

.cta-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: shine 4s ease-in-out infinite;
    pointer-events: none;
    /* Ensure clicks pass through */
}

@keyframes shine {
    0% {
        left: -100%;
    }

    15% {
        left: 200%;
    }

    /* Fast sweep */
    100% {
        left: 200%;
    }

    /* Pause */
}

/* Contact Form Enhancements */

/* 1. Input Focus Glow */
.form-group input:focus,
.form-group textarea:focus {
    box-shadow: 0 0 15px rgba(248, 181, 34, 0.3);
    /* Smooth golden glow */
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

/* 2. Flying Paper Plane */
.btn-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Space between text and icon */
    overflow: hidden;
    /* Hide plane when it flies out */
}

.plane-icon {
    transition: transform 0.4s ease;
}

.btn-send:hover .plane-icon {
    animation: readyToFly 0.6s ease-in-out infinite alternate;
}

@keyframes readyToFly {
    0% {
        transform: translate(0, 0) rotate(0);
    }

    100% {
        transform: translate(3px, -3px) rotate(-10deg);
    }
}

/* WhatsApp Floating Button - Themed & Orbiting */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    /* Theme Colors: Gold Gradient */
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #1a1a1a;
    /* Dark icon for contrast on gold */
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(248, 181, 34, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(248, 181, 34, 0.6);
}

/* Orbit Ring */
.whatsapp-float::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 1px dashed rgba(248, 181, 34, 0.3);
    border-radius: 50%;
    animation: orbitSpin 10s linear infinite;
    pointer-events: none;
}

/* Orbiting Planet */
.whatsapp-float::after {
    content: '';
    position: absolute;
    /* Increase size to ensure planet is not clipped */
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 50%;
    /* 
       Orbit radius logic:
       Button radius = 30px (60/2)
       Orbit distance from button = 10px
       Orbit radius = 30 + 10 = 40px
       ::after box radius = 50px (100/2)
       Planet distance from edge = 50 - 40 = 10px
       So position planet at top center: 50% horizontal, 10px vertical
    */
    background: radial-gradient(circle at 50% 10px, var(--primary) 4px, transparent 5px);
    animation: orbitSpin 4s linear infinite;
    pointer-events: none;
    /* Optional: Remove box-shadow or adjust it if it conflicts, keeping specific orbit effect simpler */
}

@keyframes orbitSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}