* {
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0891b2, #2563eb);
}

/* Hero Section Animations */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 15%;
    animation-delay: -5s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    bottom: 30%;
    left: 20%;
    animation-delay: -10s;
}

.shape-4 {
    width: 120px;
    height: 120px;
    top: 10%;
    right: 30%;
    animation-delay: -15s;
}

.shape-5 {
    width: 200px;
    height: 200px;
    bottom: 10%;
    right: 10%;
    animation-delay: -7s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.5;
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(20px) rotate(180deg);
        opacity: 0.3;
    }
    75% {
        transform: translateY(-10px) rotate(270deg);
        opacity: 0.6;
    }
}

/* Typing Animation */
.typing-cursor {
    animation: blink 1s infinite;
    color: #06b6d4;
    font-weight: bold;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Pulse Animation */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(6, 182, 212, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
    }
}

/* Navigation Animations */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 100%;
}

/* Slide Animations */
.slide-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.slide-up.animate {
    opacity: 1;
    transform: translateY(0);
}

.slide-left {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.slide-right {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-right.animate {
    opacity: 1;
    transform: translateX(0);
}

/* About Section Animations */
.about-item {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease;
}

.about-item.animate {
    opacity: 1;
    transform: translateX(0);
}

.about-item:nth-child(1) { transition-delay: 0.2s; }
.about-item:nth-child(2) { transition-delay: 0.4s; }
.about-item:nth-child(3) { transition-delay: 0.6s; }

/* Counter Animation */
.counter {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Services Section */
.services-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    animation: bgMove 20s ease-in-out infinite;
}

@keyframes bgMove {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(1deg); }
    50% { transform: scale(1.05) rotate(-1deg); }
    75% { transform: scale(1.08) rotate(0.5deg); }
}

/* Service Cards */
.service-card {
    perspective: 1000px;
    height: 300px;
}

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

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

.service-card-front, .service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.service-card-back {
    transform: rotateY(180deg);
    background: rgba(0, 0, 0, 0.3);
}

/* Product Cards */
.product-card {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.product-card.animate {
    opacity: 1;
    transform: translateY(0);
}

.product-card:nth-child(1) { transition-delay: 0.1s; }
.product-card:nth-child(2) { transition-delay: 0.2s; }
.product-card:nth-child(3) { transition-delay: 0.3s; }
.product-card:nth-child(4) { 
    transition-delay: 0.4s;
}

/* Enhanced Xiaomi card visibility */
.product-card:nth-child(4) div {
    box-shadow: 0 10px 40px rgba(34, 197, 94, 0.2);
}

.product-card:nth-child(4):hover div {
    box-shadow: 0 20px 60px rgba(34, 197, 94, 0.4);
    transform: translateY(-10px) scale(1.02);
}

/* Contact Section */
.contact-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, rgba(6, 182, 212, 0.05) 0%, transparent 25%),
        linear-gradient(-45deg, rgba(139, 92, 246, 0.05) 0%, transparent 25%),
        linear-gradient(135deg, rgba(236, 72, 153, 0.05) 0%, transparent 25%);
    animation: contactBg 25s ease-in-out infinite;
}

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

.contact-item {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.contact-item.animate {
    opacity: 1;
    transform: translateX(0);
}

.contact-item:nth-child(1) { transition-delay: 0.1s; }
.contact-item:nth-child(2) { transition-delay: 0.2s; }
.contact-item:nth-child(3) { transition-delay: 0.3s; }
.contact-item:nth-child(4) { transition-delay: 0.4s; }

/* Back to Top Button */
#back-to-top {
    transition: all 0.3s ease;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Advanced Hover Effects */
.service-card:hover {
    transform: translateY(-10px);
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
}

/* Gradient Text Effects */
.gradient-text {
    background: linear-gradient(135deg, #06b6d4, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 3s ease-in-out infinite;
}

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

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

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

/* Mobile Optimizations */
@media (max-width: 768px) {
    .floating-shapes .shape {
        width: 50px;
        height: 50px;
    }
    
    .service-card {
        height: auto;
    }
    
    .service-card-inner {
        position: relative;
        transform: none;
    }
    
    .service-card-front, .service-card-back {
        position: relative;
        transform: none;
        backface-visibility: visible;
    }
    
    .service-card-back {
        display: none;
    }
    
    .service-card:hover .service-card-back {
        display: block;
    }
    
    .service-card:hover .service-card-front {
        display: none;
    }
}

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

/* Custom Animations for Hero Elements */
#hero-title.animate {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

#hero-subtitle.animate {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

#hero-description.animate {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

#hero-buttons.animate {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.8s;
}

/* Enhanced Button Hover Effects */
button:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Form Styling */
input:focus, textarea:focus {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

/* Improved Responsive Design */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
    
    .text-6xl {
        font-size: 3rem;
    }
    
    .text-5xl {
        font-size: 2.5rem;
    }
} 