/* Advanced Animations and Effects */

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    font-family: 'Cairo', sans-serif;
}

.loading-logo {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spin 2s linear infinite;
}

.loading-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.3));
}

@keyframes spin {
    0% { 
        transform: rotate(0deg) scale(1);
    }
    50% { 
        transform: rotate(180deg) scale(1.1);
    }
    100% { 
        transform: rotate(360deg) scale(1);
    }
}

.loading-text h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    font-family: 'Cairo', sans-serif;
}

.loading-text p {
    font-size: 1rem;
    color: var(--light-dark);
    font-weight: 500;
    margin: 0;
    font-family: 'Cairo', sans-serif;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    width: 0%;
    animation: loading-progress 3s ease-in-out infinite;
}

@keyframes loading-progress {
    0% { 
        width: 0%; 
        transform: translateX(-100%);
    }
    50% { 
        width: 100%; 
        transform: translateX(0%);
    }
    100% { 
        width: 100%; 
        transform: translateX(100%);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Floating Animation for Service Cards */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Particle Background Effect */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 215, 0, 0.6);
    border-radius: 50%;
    animation: particle-float 15s infinite linear;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Glitch Effect for Hero Title */
.glitch {
    position: relative;
    color: #1a1a1a;
    font-size: 3.5rem;
    font-weight: 700;
    text-transform: uppercase;
    animation: glitch 2s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: #FFD700;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: #FFA500;
    z-index: -2;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(-1px, -1px); }
    60% { transform: translate(1px, 1px); }
    80% { transform: translate(1px, -1px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(1px, -1px); }
    40% { transform: translate(1px, 1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(-1px, 1px); }
}

/* Morphing Button Effect */
.morph-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.morph-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.morph-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #1a1a1a;
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #1a1a1a; }
}

/* Parallax Layers */
.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
}

.parallax-back {
    transform: translateZ(-1px) scale(2);
}

.parallax-mid {
    transform: translateZ(-0.5px) scale(1.5);
}

/* 3D Card Effect */
.card-3d {
    perspective: 1000px;
}

.card-3d-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-3d:hover .card-3d-inner {
    transform: rotateY(180deg);
}

.card-3d-front,
.card-3d-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
}

.card-3d-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Neon Glow Effect */
.neon-glow {
    text-shadow: 
        0 0 5px #FFD700,
        0 0 10px #FFD700,
        0 0 15px #FFD700,
        0 0 20px #FFD700;
    animation: neon-flicker 2s infinite alternate;
}

@keyframes neon-flicker {
    0%, 100% {
        text-shadow: 
            0 0 5px #FFD700,
            0 0 10px #FFD700,
            0 0 15px #FFD700,
            0 0 20px #FFD700;
    }
    50% {
        text-shadow: 
            0 0 2px #FFD700,
            0 0 5px #FFD700,
            0 0 8px #FFD700,
            0 0 12px #FFD700;
    }
}

/* Liquid Button Effect */
.liquid-btn {
    position: relative;
    overflow: hidden;
    border: none;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #1a1a1a;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.liquid-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.liquid-btn:hover::before {
    left: 100%;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    z-index: 1001;
    transition: width 0.1s ease;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Animation */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(30px);
    animation: staggerFadeIn 0.6s ease forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Magnetic Effect */
.magnetic {
    transition: transform 0.3s ease;
}

.magnetic:hover {
    transform: scale(1.05);
}

/* Glass Morphism Effect */
.glass-morphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Bounce Animation */
.bounce-in {
    animation: bounceIn 1s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In Animations */
.slide-in-left {
    animation: slideInLeft 0.8s ease;
}

.slide-in-right {
    animation: slideInRight 0.8s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Adjustments for Advanced Effects */
@media (max-width: 768px) {
    .glitch {
        font-size: 2.5rem;
    }
    
    .particle {
        display: none; /* Hide particles on mobile for performance */
    }
    
    .card-3d:hover .card-3d-inner {
        transform: none; /* Disable 3D effect on mobile */
    }
}
/* Enhanced Loading Screen Effects */

/* Pulsing effect for loading logo */
.loading-logo {
    position: relative;
}

.loading-logo::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    animation: pulse-ring 2s ease-out infinite;
}

.loading-logo::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    animation: pulse-ring 2s ease-out infinite 1s;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Loading text animation */
.loading-text h3 {
    animation: fadeInUp 1s ease 0.5s both;
}

.loading-text p {
    animation: fadeInUp 1s ease 0.7s both;
}

/* Breathing animation for the container */
.loading-container {
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Loading dots animation */
.loading-text p::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Shimmer effect for progress bar */
.loading-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .loading-logo {
        width: 60px;
        height: 60px;
    }
    
    .loading-text h3 {
        font-size: 1.5rem;
    }
    
    .loading-text p {
        font-size: 0.9rem;
    }
    
    .loading-progress {
        width: 150px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .loading-logo {
        animation: none;
    }
    
    .loading-logo::before,
    .loading-logo::after {
        animation: none;
        display: none;
    }
    
    .loading-container {
        animation: none;
    }
    
    .progress-bar {
        animation: loading-progress-simple 3s linear infinite;
    }
    
    @keyframes loading-progress-simple {
        0% { width: 0%; }
        100% { width: 100%; }
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .loading-screen {
        background: white;
        border: 2px solid black;
    }
    
    .loading-text h3 {
        color: black;
    }
    
    .loading-text p {
        color: #333;
    }
    
    .loading-progress {
        background: #ccc;
        border: 1px solid black;
    }
    
    .progress-bar {
        background: black;
    }
}
/* Force Cairo font for loading screen */
.loading-screen,
.loading-screen * {
    font-family: 'Cairo', sans-serif !important;
}

.loading-screen h3,
.loading-screen p,
.loading-screen span,
.loading-screen div {
    font-family: 'Cairo', sans-serif !important;
}

/* Ensure font weights match the main site */
.loading-text h3 {
    font-weight: 700 !important;
    font-family: 'Cairo', sans-serif !important;
}

.loading-text p {
    font-weight: 500 !important;
    font-family: 'Cairo', sans-serif !important;
}