/* ===== Global Styles ===== */
:root {
    --primary-color: #1a4a4a;
    --primary-dark: #0f3535;
    --primary-light: #2a6a6a;
    --secondary-color: #d4a853;
    --text-dark: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --light-bg: #f8f9fa;
    --section-padding: 100px 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== Preloader ===== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.preloader-logo {
    width: 120px;
    height: auto;
    filter: brightness(0) invert(1);
    animation: pulse 1.5s ease-in-out infinite;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

body {
    font-family: 'Tajawal', sans-serif;
    color: var(--text-dark);
    line-height: 1.8;
    overflow-x: hidden;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.4;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 30px;
    position: relative;
}

/* ===== Buttons ===== */
.btn-primary {
    background-color: #000;
    border-color: #000;
    padding: 12px 35px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #333;
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 12px 35px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.btn-custom {
    min-width: 150px;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    background-color: transparent;
    transition: all 0.3s ease;
}

.header.scrolled {
    background-color: var(--white);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar {
    padding: 25px 0;
}

.navbar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-brand {
    order: 1;
}

.navbar-toggler {
    order: 2;
}

.logo-text {
    font-size: 2.8rem;
    font-weight: 300;
    color: var(--white);
    transition: color 0.3s ease;
    letter-spacing: 4px;
}

.logo-img {
    height: 45px;
    width: auto;
    transition: all 0.3s ease;
    filter: brightness(1);
}

.header.scrolled .logo-img {
    filter: brightness(0);
}

.header.scrolled .logo-text {
    color: var(--primary-color);
}

.nav-link {
    color: var(--white);
    font-weight: 500;
    padding: 8px 20px !important;
    transition: all 0.3s ease;
}

.header.scrolled .nav-link {
    color: var(--text-dark);
}

.nav-link:hover {
    color: var(--secondary-color);
}

.navbar-toggler {
    border: none;
    padding: 10px;
    width: 45px;
    height: 36px;
    position: relative;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.toggler-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--white);
    transition: all 0.3s ease;
}

.header.scrolled .toggler-line {
    background-color: var(--primary-color);
}

/* Navbar collapse */
.navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

.navbar-collapse .nav-link {
    color: var(--text-dark);
}

.navbar-collapse .nav-link:hover {
    color: var(--primary-color);
}

/* ===== Hero Section ===== */
#heroCarousel {
    position: relative;
}

#heroCarousel .carousel-item {
    height: 100vh;
    min-height: 700px;
}

.hero-section {
    height: 100vh;
    min-height: 700px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-slide-1 {
    background: url('imgs/hero.webp') center center/cover no-repeat;
}

.hero-slide-2 {
    background: url('imgs/hero2.webp') center center/cover no-repeat;
}

#heroCarousel .carousel-control-prev,
#heroCarousel .carousel-control-next {
    width: 60px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 10;
}

#heroCarousel .carousel-control-prev:hover,
#heroCarousel .carousel-control-next:hover {
    opacity: 1;
}

#heroCarousel .carousel-indicators {
    margin-bottom: 30px;
    z-index: 10;
}

#heroCarousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    transition: background-color 0.3s ease;
}

#heroCarousel .carousel-indicators button.active {
    background-color: var(--white);
}

/* Hero Slide 2 - Button at bottom */
.hero-content-2 {
    padding-top: 120px;
    padding-bottom: 20px;
}

.hero-content-2 .hero-title-img {
    margin-bottom: 0;
}

.hero-btn-bottom {
    margin-bottom: 60px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 30, 30, 0.65);
    pointer-events: none;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80px;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30L30 0z' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: repeat-y;
    background-size: 60px 60px;
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    padding-top: 60px;
}

.hero-title-img {
    margin-bottom: 40px;
}

.hero-title-img img {
    max-width: 550px;
    height: auto;
    filter: brightness(0) invert(1);
}

.btn-hero {
    padding: 16px 50px;
    font-size: 1.15rem;
    font-weight: 500;
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-hero:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ===== About Section ===== */
.about-section {
    padding: var(--section-padding);
    background-color: var(--light-bg);
}

.about-section .section-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 40px;
}

.about-text {
    color: #888888;
    font-size: 1.05rem;
    margin-bottom: 25px;
    line-height: 2;
}

.btn-about {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 35px;
    border: 2px solid var(--text-dark);
    border-radius: 30px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1rem;
    background-color: transparent;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-about i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-about:hover {
    background-color: var(--text-dark);
    color: var(--white);
}

.btn-about:hover i {
    transform: translateX(-5px);
}

/* ===== Showcase Section ===== */
.showcase-section {
    width: 100%;
    overflow: hidden;
}

.showcase-image-wrapper {
    width: 100%;
    line-height: 0;
}

.showcase-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ===== Services Section ===== */
.services-section {
    padding: 80px 0 60px;
    background-color: var(--light-bg);
}

/* Section Header */
.section-header {
    margin-bottom: 60px;
}

.section-title-text {
    font-size: 2.8rem;
    font-weight: 300;
    color: var(--text-dark);
    margin-bottom: 20px;
    letter-spacing: 8px;
}

.section-title-underline {
    width: 80px;
    height: 1px;
    background-color: var(--text-dark);
    margin: 0 auto;
}

/* Service Block */
.service-block {
    margin-bottom: 60px;
}

.service-block:last-child {
    margin-bottom: 0;
}

/* Service Row - Title and Image side by side */
.service-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

/* Title Column */
.service-title-col {
    flex: 0 0 auto;
}

/* Stacked Title - Each word on new line */
.service-title-stacked {
    display: flex;
    flex-direction: column;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
    margin: 0;
    text-align: right;
}

.service-title-stacked span {
    display: block;
}

/* Service Title SVG Images */
.service-title-svg {
    display: flex;
    align-items: center;
}

.service-title-svg img {
    max-width: 180px;
    height: auto;
}

.service-block.reverse .service-title-svg {
    justify-content: flex-end;
}

.service-title-inline-img {
    justify-content: center;
    margin-bottom: 15px;
}

.service-title-inline-img img {
    max-width: 280px;
}

/* Image Column */
.service-img-col {
    flex: 0 0 auto;
    width: 200px;
}

.service-img-col img {
    width: 100%;
    height: auto;
    display: block;
}

/* Reverse layout - title alignment for left side */
.service-block.reverse .service-title-stacked {
    text-align: left;
}

/* Service Content - Description and Button */
.service-content {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    padding: 0 20px;
}

.service-desc {
    color: #777;
    font-size: 0.95rem;
    line-height: 2;
    margin-bottom: 20px;
}

.service-desc strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Service Button */
.btn-service {
    display: inline-block;
    padding: 10px 35px;
    border: 1px solid var(--text-dark);
    border-radius: 25px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
    background-color: transparent;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-service:hover {
    background-color: var(--text-dark);
    color: var(--white);
}

/* Service Full Width (4th service) */
.service-block.service-full .service-full-img {
    max-width: 350px;
    margin: 0 auto 25px;
}

.service-block.service-full .service-full-img img {
    width: 100%;
    height: auto;
    display: block;
}

.service-title-inline {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    text-align: center;
}

/* Responsive Services */
@media (max-width: 575.98px) {
    .services-section {
        padding: 60px 0 40px;
    }

    .section-title-text {
        font-size: 2.2rem;
        letter-spacing: 6px;
    }

    .service-row {
        gap: 15px;
    }

    .service-title-stacked {
        font-size: 1.6rem;
    }

    .service-title-svg img {
        max-width: 120px;
    }

    .service-title-inline-img img {
        max-width: 200px;
    }

    .service-img-col {
        width: 160px;
    }

    .service-desc {
        font-size: 0.9rem;
    }

    .service-title-inline {
        font-size: 1.4rem;
    }
}

/* Section Title SVG (used in about, clients, contact) */
.section-title-svg {
    margin-bottom: 40px;
}

.section-title-svg img {
    max-width: 400px;
    height: auto;
}

@media (max-width: 767.98px) {
    .section-title-svg img {
        max-width: 250px;
    }
}

/* ===== Clients Section ===== */
.clients-section {
    padding: var(--section-padding);
    background-color: var(--white);
    overflow: hidden;
}

.clients-subtitle {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 40px;
}

/* Clients Logos Infinite Scroll */
.logos-wrapper {
    overflow: hidden;
    padding: 30px 0;
    background: var(--white);
    direction: ltr;
}

.logos-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: scroll 30s linear infinite;
}

.logos-track img {
    height: 70px;
    width: 140px;
    padding: 0 25px;
    object-fit: contain;
    flex-shrink: 0;
    filter: grayscale(20%) opacity(0.85);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.logos-track img:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

.logos-wrapper:hover .logos-track {
    animation-play-state: paused;
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@media (max-width: 767.98px) {
    .logos-track img {
        height: 55px;
        width: 110px;
        padding: 0 18px;
    }

    .logos-track {
        animation-duration: 25s;
    }
}

@media (max-width: 575.98px) {
    .logos-track img {
        height: 45px;
        width: 90px;
        padding: 0 12px;
    }

    .logos-track {
        animation-duration: 20s;
    }
}

@media (prefers-reduced-motion: reduce) {
    .logos-track {
        animation: none;
    }
}

/* ===== Contact Section ===== */
.contact-section {
    padding: var(--section-padding);
    background-color: var(--light-bg);
}

.contact-form {
    background-color: var(--white);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-control {
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(26, 74, 74, 0.1);
}

.contact-divider {
    text-align: center;
    margin: 40px 0;
    position: relative;
}

.contact-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e9ecef;
}

.contact-divider span {
    background-color: var(--light-bg);
    padding: 0 20px;
    position: relative;
    color: var(--text-light);
    font-weight: 500;
}

.contact-info {
    padding: 30px;
}

.contact-item {
    margin-bottom: 20px;
}

.contact-item i {
    font-size: 1.3rem;
    color: #000;
    margin-left: 10px;
}

.contact-item a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: #000;
}

.social-links {
    margin-top: 30px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: #000;
    color: var(--white);
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s ease;
    margin: 0 8px;
    text-decoration: none;
}

.social-link i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link:hover {
    background-color: #333;
    color: var(--white);
    transform: translateY(-3px);
}

/* ===== Footer ===== */
.footer {
    background-color: #000;
    padding: 30px 0;
    color: var(--white);
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
}

.footer-logo-img {
    height: 40px;
    width: auto;
}

.footer-text {
    opacity: 0.8;
    font-size: 0.95rem;
}

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

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

/* ===== Responsive Styles ===== */
@media (max-width: 991.98px) {
    .hero-title-img img {
        max-width: 450px;
    }

    .section-title {
        font-size: 2rem;
    }

    .contact-form {
        padding: 30px;
    }

    .hero-pattern {
        width: 50px;
    }
}

@media (max-width: 767.98px) {
    .hero-title-img img {
        max-width: 350px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .service-title-svg img {
        max-width: 140px;
    }

    .service-title-inline-img img {
        max-width: 220px;
    }

    .about-text {
        font-size: 1rem;
    }

    :root {
        --section-padding: 60px 0;
    }

    .contact-form {
        padding: 25px;
    }

    .hero-pattern {
        width: 40px;
    }
}

@media (max-width: 575.98px) {
    .hero-title-img img {
        max-width: 280px;
    }

    .btn-hero {
        padding: 12px 30px;
        font-size: 0.95rem;
    }

    .hero-pattern {
        width: 30px;
    }
}

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

/* ===== Selection ===== */
::selection {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ===== Form Validation ===== */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
}

/* ===== Loading Spinner ===== */
.spin-icon {
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== SweetAlert RTL Support ===== */
.swal2-popup {
    direction: rtl;
    text-align: right;
}
