/* Custom 3D Effects and Animations */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    scroll-behavior: smooth;
}

/* 3D Card Flip Effect */
.service-card {
    perspective: 1000px;
    height: 320px;
}

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

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

.service-card[data-3d-rotate="x"]:hover .card-inner {
    transform: rotateX(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.service-card[data-3d-rotate="x"] .card-back {
    transform: rotateX(180deg);
}

/* 3D Text Effect */
.text-3d {
    text-shadow: 
        0 1px 0 #ccc,
        0 2px 0 #c9c9c9,
        0 3px 0 #bbb,
        0 4px 0 #b9b9b9,
        0 5px 0 #aaa,
        0 6px 1px rgba(0,0,0,.1),
        0 0 5px rgba(0,0,0,.1),
        0 1px 3px rgba(0,0,0,.3),
        0 3px 5px rgba(0,0,0,.2),
        0 5px 10px rgba(0,0,0,.25),
        0 10px 10px rgba(0,0,0,.2),
        0 20px 20px rgba(0,0,0,.15);
}

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

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

/* 3D Button Effect */
.btn-3d {
    position: relative;
    display: inline-block;
    padding: 12px 24px;
    color: white;
    background: linear-gradient(145deg, #dc2626, #b91c1c);
    border: none;
    border-radius: 12px;
    box-shadow: 
        0 6px 0 #7f1d1d,
        0 8px 20px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.btn-3d:hover {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #7f1d1d,
        0 4px 20px rgba(0,0,0,0.3);
}

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

/* Glowing Border Effect */
.glow-border {
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.glow-border::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    bottom: -2px;
    left: -2px;
    background: linear-gradient(45deg, #dc2626, #000000, #dc2626);
    border-radius: inherit;
    z-index: -1;
    animation: glow 2s linear infinite;
}

@keyframes glow {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* 3D Rotating Cube Loader */
.cube-loader {
    width: 60px;
    height: 60px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 3s infinite linear;
}

.cube-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #dc2626, #000000);
    border: 2px solid rgba(255,255,255,0.1);
}

@keyframes rotateCube {
    0% { transform: rotateX(0) rotateY(0); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .service-card {
        height: 280px;
    }
    
    .service-card:hover .card-inner {
        transform: none;
    }
    
    .service-card .card-back {
        display: none;
    }
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #dc2626, #000000);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #b91c1c, #333333);
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(45deg, #dc2626, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Page Transition Animation */
@keyframes pageTransitionIn {
    from {
        opacity: 0;
        transform: translateY(50px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.page-transition {
    animation: pageTransitionIn 0.8s ease-out;
}