/* Custom Styles for Wadadli Marketing */

/* Performance Optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(168, 85, 247, 0.6);
    }
}

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

/* Service Cards Hover Effect */
.service-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.2);
}

.service-card:hover::before {
    opacity: 1;
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    border: 3px solid rgba(168, 85, 247, 0.3);
    border-top-color: #a855f7;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

/* Form Focus States */
input:focus,
textarea:focus,
select:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

/* Custom Checkbox */
input[type="checkbox"]:checked {
    background-color: #a855f7;
    border-color: #a855f7;
}

/* Error States */
.error input,
.error textarea,
.error select {
    border-color: #ef4444;
}

.error-message {
    display: block;
    margin-top: 0.25rem;
}

/* Success Message */
.success-message {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* Error Message */
.error-message-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Smooth Scroll Padding for Fixed Header */
section {
    scroll-margin-top: 80px;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 2rem;
    }
}

/* Performance: Reduce Motion for Users Who Prefer It */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Gradient Background Animation */
.gradient-bg {
    background: linear-gradient(-45deg, #6366f1, #a855f7, #ec4899, #8b5cf6);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* Stats Animation on Scroll */
.stat-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Button Ripple Effect */
button {
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::after {
    width: 300px;
    height: 300px;
}

/* Accessibility: Focus Visible */
*:focus-visible {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
}

/* Selection Color */
::selection {
    background-color: rgba(168, 85, 247, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background-color: rgba(168, 85, 247, 0.3);
    color: #ffffff;
}

/* Scrollbar Styling for Webkit Browsers */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #a855f7, #ec4899);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9333ea, #db2777);
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy Loading Placeholder */
.lazy-load {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    #contact {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .service-card {
        break-inside: avoid;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .service-card {
        border-width: 2px;
    }
    
    button {
        border: 2px solid currentColor;
    }
}

/* Dark Mode Enhancements (Already Dark by Default) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* Text Rendering Optimization */
body {
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
}

/* Will-change for Performance */
.service-card,
button {
    will-change: transform;
}

/* GPU Acceleration */
.service-card,
button,
.gradient-bg {
    transform: translateZ(0);
    backface-visibility: hidden;
}
