/* Custom CSS for Meshari Law Firm Website */

/* Arabic Font Optimization */
body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.8;
}

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

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading Performance - Skeleton screens could be added */
img {
    image-rendering: crisp-edges;
}

/* Lazy Loading Optimization */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Mobile Menu Smooth Transition */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 500px;
}

/* WhatsApp Button Pulse Animation */
.whatsapp-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Focus States for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #C9A84C;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    nav,
    footer,
    .whatsapp-btn {
        display: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    body {
        border: 3px solid;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom Scrollbar (Webkit browsers) */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #C9A84C;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8893e;
}

/* Selection Color */
::selection {
    background-color: #C9A84C;
    color: #000119;
}

/* Form Validation Styles */
input:invalid,
textarea:invalid {
    border-color: #ef4444;
}

input:valid,
textarea:valid {
    border-color: #10b981;
}

/* Loading Spinner (if needed for forms) */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #C9A84C;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.75rem;
    }
    h3 {
        font-size: 1.5rem;
    }
}

/* Core Web Vitals Optimization */
/* Avoid layout shifts */
img,
video {
    max-width: 100%;
    height: auto;
}

/* Prevent CLS for lazy loaded images */
.img-placeholder {
    background-color: #f0f0f0;
    min-height: 200px;
}
