/* Main Stylesheet - Abraj Al-Dhahabi
   Cleaned & Refactored
*/

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;700;800;900&display=swap');

/* --- 1. Variables & Reset --- */
:root {
    --gold: #9A8560;
    --gold-light: #C5B396;
    --dark: #1A1A1A;
    --light: #F5F5F0;
    --white: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    font-family: 'Tajawal', sans-serif;
    overflow-x: hidden;
    width: 100%;
    background-color: var(--light);
    color: var(--dark);
    scroll-behavior: smooth;
}

/* --- 2. Scrollbar Customization --- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 5px;
}

/* --- 3. Preloader --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    animation: autoHidePreloader 0.8s ease-in-out 1.5s forwards;
}

@keyframes autoHidePreloader {
    to {
        transform: translateY(-100%);
        pointer-events: none;
    }
}

.loader-logo {
    width: 150px;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    transform: translateY(20px);
    /* Base state */
}

/* Unified class for both loader-line and loader-bar to support all pages */
.loader-line,
.loader-bar {
    width: 0;
    height: 2px;
    background-color: var(--gold);
    margin-top: 20px;
    transition: width 0.5s;
    /* Fallback animation if GSAP fails */
    animation: loadLine 1.5s ease-in-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }

    from {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes loadLine {
    0% {
        width: 0;
    }

    100% {
        width: 150px;
    }
}

/* --- 4. Navigation --- */
nav {
    transition: all 0.3s ease-in-out;
    width: 100%;
    z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 769px) {
    nav {
        /* Default state handled by HTML classes, but this enforces absolute on large screens if needed */
        position: absolute;
        top: 0;
    }
}

@media (max-width: 768px) {
    nav img {
        width: 80px;
    }
}

#mobile-menu {
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

/* --- 5. Floating Actions (WhatsApp) --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background-color: var(--gold);
    color: #FFF;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.whatsapp-float:hover {
    background-color: var(--dark);
    color: var(--gold);
    transform: scale(1.1) rotate(15deg);
}

.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(197, 179, 150, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(197, 179, 150, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(197, 179, 150, 0);
    }
}

/* --- 6. Backgrounds & Hero --- */
.hero-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    z-index: 0;
    overflow: hidden;
}

.hero-img,
.parallax-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-img {
    filter: brightness(0.4);
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.pattern-bg {
    background-image: radial-gradient(#C5B396 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
}

/* --- 7. Cards & 3D Effects --- */
.tilt-card,
.project-card,
.service-card {
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.1s;
    /* Quick response for JS tilt */
}

/* Specific Service Card Hover */
.service-card {
    transition: all 0.3s ease;
    /* Smooth hover state */
    border-bottom: 4px solid transparent;
}

.service-card:hover {
    border-color: var(--gold);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tilt-content,
.overlay {
    transform: translateZ(20px);
}

.project-card:hover .overlay {
    opacity: 1;
    /* Bottom positioning is handled by Tailwind classes in HTML */
}

.project-card img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover img {
    transform: scale(1.1);
}

/* --- 8. Forms & Inputs --- */
.form-input {
    width: 100%;
    background: transparent;
    border-bottom: 2px solid #e5e7eb;
    padding: 1rem 0;
    outline: none;
    transition: all 0.3s;
    color: var(--dark);
}

.form-input:focus {
    border-color: var(--gold);
    padding-right: 10px;
}

textarea.form-input {
    resize: none;
}

/* --- 9. Utilities & Components --- */
iframe {
    filter: grayscale(100%) invert(0%) contrast(1.2);
    transition: filter 0.5s;
}

iframe:hover {
    filter: grayscale(0%);
}

details>summary {
    list-style: none;
}

details>summary::-webkit-details-marker {
    display: none;
}

.filter-btn.active {
    background-color: var(--dark);
    color: white;
    border-color: var(--dark);
}

/* Marquee Animation */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 25s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

/* --- 10. Thank You Page Specials --- */
.check-icon {
    font-size: 5rem;
    color: var(--gold);
    opacity: 0;
    transform: scale(0);
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--gold);
    animation: fall linear forwards;
    opacity: 0;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* --- 11. Scroll-to-Top Button --- */
.scroll-top-btn {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 45px;
    height: 45px;
    background: var(--gold);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 15px rgba(197, 179, 150, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--dark);
    color: var(--gold);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}



/* --- 13. Slide-up Animation --- */
.slide-up {
    transform: translateY(0);
}

/* --- 14. Smooth Image Hover --- */
img {
    transition: filter 0.5s ease;
}

/* --- 15. Selection Color --- */
::selection {
    background: var(--gold);
    color: var(--white);
}