/* Main Stylesheet - Clear Cut Glass
   Cleaned & Refactored
*/

/* Google Fonts loaded via <link> in HTML for performance */


/* --- 1. Variables & Reset --- */
:root {
    --gold: #3E7CB1;        /* steel blue accent */
    --gold-light: #5B9BC8;  /* hover / light accent */
    --gold-fill: #3A75A8;   /* solid fill behind white text (4.9:1) */
    --gold-text: #2E6A9E;   /* accent text on light backgrounds (5.7:1) */
    --ice: #A7D3F0;
    --dark: #0B1B2B;        /* deep navy */
    --light: #F4F7FA;
    --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 (Disabled for Instant LCP/FCP Performance) --- */
#preloader {
    display: none !important;
}

.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-fill);
    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(62, 124, 177, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(62, 124, 177, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(62, 124, 177, 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(#5B9BC8 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-fill);
    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(62, 124, 177, 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-fill);
    color: var(--white);
}

/* --- 16. Premium UI - Phase 3 Additions --- */

/* Premium Glassmorphism for Navbar */
nav {
    background: rgba(11, 27, 43, 0.94) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Glassmorphism utility classes */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-dark {
    background: rgba(11, 27, 43, 0.6);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Micro-animations */
a, button {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

a:active, button:active {
    transform: scale(0.95);
}

/* Button Glow Effect */
.bg-gold:hover, .btn-glow:hover {
    box-shadow: 0 0 25px rgba(62, 124, 177, 0.6) !important;
    transform: translateY(-2px);
}

/* Premium Text Gradients */
.text-gradient-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--ice) 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smooth Reveal Line Animation */
.reveal-text {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.reveal-text::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--gold);
    transform-origin: left;
    animation: revealBlock 1s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes revealBlock {
    0% { transform: scaleX(1); transform-origin: right; }
    100% { transform: scaleX(0); transform-origin: right; }
}

/* --- 17. Mobile Bottom Action Bar (شريط الموبايل السفلي التفاعلي) --- */
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(11, 27, 43, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(91, 155, 200, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.5);
}

.mobile-bar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 68px;
    min-height: 48px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    transition: transform 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-bar-btn:active {
    transform: scale(0.92);
}

.mobile-bar-btn.call-btn {
    color: #FFFFFF;
}

.mobile-bar-btn.call-btn i {
    font-size: 20px;
    color: #FFFFFF;
}

.mobile-bar-btn.whatsapp-btn {
    color: #25D366;
}

.mobile-bar-btn.whatsapp-btn i {
    font-size: 24px;
    color: #25D366;
}

.mobile-bar-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #3A75A8 0%, #2E6A9E 100%);
    color: #FFFFFF !important;
    font-size: 14px;
    font-weight: 800;
    padding: 10px 22px;
    border-radius: 9999px;
    text-decoration: none;
    min-height: 48px;
    box-shadow: 0 4px 18px rgba(62, 124, 177, 0.45);
    transition: transform 0.2s ease, filter 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-bar-pill:active {
    transform: scale(0.95);
    filter: brightness(0.95);
}

.mobile-bar-pill i {
    font-size: 16px;
    color: #FFFFFF;
}

/* Accessibility & Responsive adjustments */
@media (max-width: 767px) {
    body {
        padding-bottom: 72px !important;
    }
    .desktop-float-buttons {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .mobile-bottom-bar {
        display: none !important;
    }
}

/* Article pages on mobile: tighten the gap under the navbar (was pt-48 + mt-10 = 232px) */
@media (max-width: 767px) {
    main.pt-48.mt-10:has(> article) {
        padding-top: 6rem;
        margin-top: 0;
    }
}

/* =====================================================================
   18. Clear Cut brand layer — navy + steel blue (WCAG AA)
   ===================================================================== */

/* Accent text colour follows the nearest surface via an inherited variable:
   light surfaces -> #2E6A9E (5.7:1 on white), dark surfaces -> #5B9BC8 (5.8:1 on #0B1B2B).
   The nearest ancestor that sets --accent-text wins, so nesting works both ways. */
:root,
.bg-white, .bg-light, .bg-gray-50, .bg-gray-100 {
    --accent-text: #2E6A9E;
}
.bg-dark, [class*="bg-dark/"], .bg-gray-900, .bg-gray-800, .bg-black,
nav, footer, #mobile-menu, .hero-cleared,
.hover\:bg-dark:hover {
    --accent-text: #5B9BC8;
}
html .text-gold,
html .hover\:text-gold:hover,
html .group:hover .group-hover\:text-gold,
html .prose-a\:text-gold a {
    color: var(--accent-text, #2E6A9E);
}

/* Text sitting on a solid steel-blue fill is white (4.9:1), never navy (3.7:1) */
.bg-gold.text-dark, .bg-gold .text-dark,
.hover\:bg-gold:hover.hover\:text-dark:hover,
.group:hover .group-hover\:bg-gold.group-hover\:text-dark {
    color: #FFFFFF;
}
/* ...except where the button turns white on hover */
.bg-gold.text-dark.hover\:bg-white:hover {
    color: var(--dark);
}

/* =====================================================================
   19. Home hero (index.html)
   ===================================================================== */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(to top, rgba(11, 27, 43, 0.85) 0%, rgba(11, 27, 43, 0.55) 45%, rgba(11, 27, 43, 0) 100%),
        linear-gradient(to left, rgba(11, 27, 43, 0.85) 0%, rgba(11, 27, 43, 0) 75%);
}
.hero-cleared .hero-img {
    filter: brightness(0.75) saturate(0.9);
}

/* Thin diagonal "cut" line across the hero */
.hero-cut {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    top: -10%;
    left: 58%;
    width: 1px;
    height: 130%;
    background: linear-gradient(to bottom, rgba(167, 211, 240, 0) 0%, rgba(167, 211, 240, 0.55) 35%, rgba(167, 211, 240, 0.25) 70%, rgba(167, 211, 240, 0) 100%);
    transform: rotate(24deg);
    transform-origin: top center;
    box-shadow: 0 0 12px rgba(91, 155, 200, 0.35);
}
.hero-cut::after {
    content: '';
    position: absolute;
    top: 0;
    left: 14px;
    width: 1px;
    height: 100%;
    background: inherit;
    opacity: 0.35;
}
@media (max-width: 767px) {
    .hero-cut { left: 70%; opacity: 0.6; }
}

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid rgba(167, 211, 240, 0.45);
    background: rgba(11, 27, 43, 0.7);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--ice);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero-btn-primary {
    background: var(--gold-fill);
    color: #FFFFFF;
    border: 1px solid var(--gold-fill);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(62, 124, 177, 0.35);
}
.hero-btn-primary:hover {
    background: #2E6A9E;
    border-color: #2E6A9E;
    transform: translateY(-2px);
}
.hero-btn-secondary {
    background: transparent;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 6px;
}
.hero-btn-secondary:hover {
    background: #FFFFFF;
    color: var(--dark);
}

/* Glass stats strip */
.hero-stats {
    background: rgba(11, 27, 43, 0.35);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid #5B9BC8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hero-stats {
    --accent-text: var(--ice);
}
.hero-stats p {
    color: #D5E3EF;
}
