@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

body.font-sans {
    font-family: 'Inter', sans-serif;
}

body.font-arabic {
    font-family: 'Cairo', sans-serif;
}

/* Helper Class to ensure hidden works regardless of Tailwind load status */
.hidden {
    display: none;
}

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

/* Custom Animation Utility */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-fade-in-down {
    animation: fadeInDown 0.3s ease-out;
}

/* --- Loader CSS --- */
#loader-wrapper {
    position: fixed;
    inset: 0; /* Ensures top, left, right, bottom are 0 */
    width: 100%;
    height: 100%;
    background-color: #0c4a6e; /* secondary-900 */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

#loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    z-index: -1; /* Move behind content */
}

/* Fast Car Container */
.loader-fast-car {
    position: relative;
    width: 150px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The Car SVG */
.car-svg {
    width: 100%;
    height: auto;
    color: #f97316; /* primary-500 */
    filter: drop-shadow(0 0 10px rgba(249, 115, 22, 0.4));
    animation: shake 0.1s infinite;
    z-index: 2;
}

/* Speed Lines */
.speed-lines {
    position: absolute;
    top: 50%;
    left: -50px;
    right: -50px;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

.speed-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    height: 2px;
    border-radius: 2px;
    animation: wind 0.6s linear infinite;
}

/* Generate multiple speed lines with different positions/delays via nth-child logic in CSS isn't great, 
   so we use generic classes or just specific styling here for the 3 lines in HTML */
.speed-line:nth-child(1) { top: 20%; width: 100px; animation-delay: 0s; animation-duration: 0.4s; }
.speed-line:nth-child(2) { top: 40%; width: 60px; animation-delay: 0.1s; animation-duration: 0.3s; }
.speed-line:nth-child(3) { top: 60%; width: 150px; animation-delay: 0.2s; animation-duration: 0.5s; }
.speed-line:nth-child(4) { top: 80%; width: 80px; animation-delay: 0s; animation-duration: 0.4s; }

/* Text */
.loader-text {
    margin-top: 20px;
    color: white;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-style: italic;
    animation: pulse 1s infinite;
}

/* Keyframes */
@keyframes shake {
    0% { transform: translateY(0px); }
    50% { transform: translateY(1px); }
    100% { transform: translateY(0px); }
}

@keyframes wind {
    0% { transform: translateX(100px); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateX(-200px); opacity: 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}