/* Custom animations and styles for SDB website */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Base styles */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Smooth animations */
* {
    transition: all 0.3s ease;
}

/* Custom hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom button animations */
.btn-primary {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.btn-primary::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;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Loading animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

body.loaded .fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delay */
.fade-in:nth-child(1) { transition-delay: 0.1s; }
.fade-in:nth-child(2) { transition-delay: 0.2s; }
.fade-in:nth-child(3) { transition-delay: 0.3s; }
.fade-in:nth-child(4) { transition-delay: 0.4s; }

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #1e40af;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

/* Hero section enhancements */
#home {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    position: relative;
    overflow: hidden;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

/* Navigation enhancements */
nav {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Form enhancements */
input:focus, textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.2);
}

/* Card hover effects */
.service-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.service-card:hover {
    border-color: #3b82f6;
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Icon animations */
.fa, .fas, .fab {
    transition: all 0.3s ease;
}

.service-card:hover .fa,
.service-card:hover .fas {
    transform: scale(1.1);
    color: #3b82f6;
}

/* Stats counter animations */
.stat-counter {
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .text-5xl {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .text-4xl {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .text-3xl {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .text-8xl {
        font-size: 4rem;
    }
    
    .hover-lift:hover {
        transform: none;
        box-shadow: none;
    }
    
    #home {
        background-attachment: scroll;
    }
    
    /* Arabic RTL Mobile Optimizations */
    [dir="rtl"] .space-x-reverse > * + * {
        margin-right: 0.5rem;
        margin-left: 0;
    }
    
    [dir="rtl"] .grid.rtl-grid {
        direction: rtl;
    }
    
    /* Mobile navigation improvements for Arabic */
    #mobile-menu {
        direction: rtl;
    }
    
    #mobile-menu a {
        text-align: right;
        padding-right: 1rem;
        padding-left: 1rem;
    }
    
    /* Arabic text mobile sizing */
    .font-arabic {
        font-size: 0.95em;
        line-height: 1.7;
    }
    
    /* Hero section mobile Arabic optimizations */
    #home h1 {
        font-size: 1.875rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    #home p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    /* Button sizing for mobile Arabic */
    .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Card content spacing for Arabic mobile */
    .bg-white.p-6 {
        padding: 1rem;
    }
    
    .bg-white.p-8 {
        padding: 1.5rem;
    }
    
    /* Stats section mobile Arabic */
    .stat-counter {
        font-size: 2.5rem;
    }
    
    /* Arabic text alignment for mobile cards */
    [dir="rtl"] .flex.items-center.justify-end {
        text-align: right;
    }
    
    /* Mobile grid improvements for Arabic content */
    [dir="rtl"] .grid.gap-6,
    [dir="rtl"] .grid.gap-8 {
        gap: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1f2937;
        --text-primary: #f9fafb;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}

/* Accessibility enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
a:focus, button:focus, input:focus, textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: #ffffff;
    }
    
    .text-gray-600 {
        color: #000000;
    }
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Service cards specific styling */
.service-card h3 {
    color: #1e40af;
    transition: color 0.3s ease;
}

.service-card:hover h3 {
    color: #3b82f6;
}

/* Footer enhancements */
footer {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.backdrop-blur {
    backdrop-filter: blur(10px);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}