/* Custom Styles */

/* Loading Screen */
#loadingScreen {
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loadingScreen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-logo {
    animation: logoPulse 1.5s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 1s ease-in;
}

.fade-in-delay {
    animation: fadeIn 1s ease-in 0.3s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navbar Scroll Effect */
.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Active Nav Link */
.nav-link.active {
    color: #DC2626;
    font-weight: 600;
}

/* Gallery Image Hover Effect */
.gallery-item {
    transition: transform 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #DC2626;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #B91C1C;
}

/* Button Hover Effects */
.btn-primary {
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.3);
}

/* Section Transitions */
section {
    transition: opacity 0.3s ease;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Image Lazy Loading */
img {
    transition: opacity 0.3s;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Form Input Focus */
input:focus,
textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

/* Card Hover Effects */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
}

/* Mobile Menu Animation */
#mobileMenu {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #DC2626, #004E89);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gallery Video Styling - Instagram Reels Style */
video {
    border-radius: 0;
}

/* Hide all video controls */
video::-webkit-media-controls-panel {
    display: none !important;
}

video::-webkit-media-controls-play-button {
    display: none !important;
}

video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

video::-webkit-media-controls {
    display: none !important;
}

/* Hide controls for all browsers */
video {
    pointer-events: auto;
}

video:fullscreen {
    object-fit: contain;
    background-color: black;
}

video::-webkit-media-controls-enclosure {
    display: none !important;
}

/* Gallery Image Hover Enhancements */
.gallery-item img {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.15);
}

/* RTL Support for Arabic */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Fix margin utilities for RTL - only swap when needed */
[dir="rtl"] .mr-2 {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .mr-3 {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] .mr-4 {
    margin-right: 0;
    margin-left: 1rem;
}

[dir="rtl"] .ml-2 {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .ml-3 {
    margin-left: 0;
    margin-right: 0.75rem;
}

[dir="rtl"] .ml-4 {
    margin-left: 0;
    margin-right: 1rem;
}

/* Don't override space-x utilities - they use gap which works fine in RTL */
/* Keep spacing utilities working normally */

[dir="rtl"] .text-left {
    text-align: right;
}

[dir="rtl"] .text-right {
    text-align: left;
}

/* Ensure flex containers maintain spacing in RTL */
/* Fix for space-x utilities in RTL - they add margin-left which needs to be margin-right */
[dir="rtl"] .space-x-2 > * + * {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

[dir="rtl"] .space-x-4 > * + * {
    margin-left: 0 !important;
    margin-right: 1rem !important;
}

[dir="rtl"] .space-x-6 > * + * {
    margin-left: 0 !important;
    margin-right: 1.5rem !important;
}

[dir="rtl"] .space-x-8 > * + * {
    margin-left: 0 !important;
    margin-right: 2rem !important;
}

/* Language Select Dropdown Styling */
#langSelect,
#langSelectMobile {
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

#langSelect option,
#langSelectMobile option {
    background-color: #DC2626;
    color: white;
    padding: 0.5rem;
}

/* RTL support for language select */
[dir="rtl"] #langSelect,
[dir="rtl"] #langSelectMobile {
    background-position: left 0.75rem center !important;
    padding-left: 2.5rem !important;
    padding-right: 1rem !important;
}