/*
  Theme Name: Molham
  Author: Moez Tech
*/

/* ******************************************************************************* */
/* *********************************** VARIABLES ********************************* */
/* ******************************************************************************* */
:root {
    --primary-color: #5c3a56;
    --secondary-color: #c0b79a;
    --accent-color: #beb699;
    --dark-color: #2a1124;
    --light-color: #ffffff;
    --text-color: #333;
    --body-bg: #f8f9fa;
    --font-family: 'Tajawal', sans-serif;
}

/* ******************************************************************************* */
/* ********************************* GLOBAL STYLES ******************************* */
/* ******************************************************************************* */

/* Screen Reader Only Class for SEO */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px; /* Adjusted for new header */
}

body {
    font-family: var(--font-family);
    background-color: var(--body-bg);
    color: var(--text-color);
    overflow-x: hidden;
    direction: rtl;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

p {
    line-height: 1.8;
    color: #555;
}

.section-title {
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 1rem;
    transition: letter-spacing 0.4s ease;
}

.section-subtitle {
    color: var(--secondary-color);
    font-weight: 500;
    margin: 0;
}

.partners-section .section-subtitle {
    color: var(--primary-color); /* تم تغيير اللون ليكون بلون الهوية الأساسي */
}


.about-box .section-title.about-title {
    color: var(--light-color);
    margin-bottom: 0;
}


section:hover .section-title {
    letter-spacing: 1px;
}

.section-icon {
    width: 70px;
    height: 70px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
    transition: transform 0.4s ease;
    margin-inline-end: 1rem;
}

section:hover .section-icon {
    transform: rotate(10deg);
}


.highlight {
    color: var(--secondary-color);
    font-weight: 700;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    cursor: default;
}

.about-box .highlight:hover,
.manager-box .highlight:hover {
    color: var(--light-color);
    text-shadow: 0 0 8px var(--secondary-color), 0 0 12px var(--secondary-color);
}


/* ******************************************************************************* */
/* *********************************** HEADER ************************************ */
/* ******************************************************************************* */
.main-header.fixed-top {
    top: 20px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1140px; /* Corresponds to container width */
    background-color: rgba(42, 17, 36, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 32.5px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.main-header .navbar {
    padding: 0.5rem;
}

.main-header .navbar-brand img {
    height: 60px; /* Adjusted for new padding */
    transition: transform 0.3s ease;
}

.main-header .navbar-brand:hover img {
    transform: scale(1.05);
}

.main-header .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    position: relative;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 20px;
}

.main-header .navbar-nav .nav-link::after {
    display: none; /* Removed underline effect */
}

.main-header .navbar-nav .nav-link:hover,
.main-header .navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--secondary-color);
}

.custom-service-btn {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: 2px solid var(--secondary-color);
    font-weight: 700;
    transition: all 0.3s ease;
}

.custom-service-btn:hover {
    background-color: var(--light-color);
    border-color: var(--light-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ******************************************************************************* */
/* *********************************** WELCOME SECTION *************************** */
/* ******************************************************************************* */
.welcome-section {
    overflow: hidden;
    background-color: #000;
}

#spaceCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.welcome-bg {
    z-index: 0;
}

/* ******************************************************************************* */
/* *********************************** ABOUT SECTION ***************************** */
/* ******************************************************************************* */
#about-molham {
    background-color: var(--light-color);
    position: relative;
    overflow: hidden;
}

.about-box, .manager-box {
    background: linear-gradient(145deg, var(--primary-color), #4a2d45);
    color: var(--light-color);
    padding: 3rem 0;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden; /* To contain the pseudo-element */
}

/* Change: New animated space background with multiple layers */
@keyframes space-effect {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%; }
    100% { background-position: -1000px 500px, -800px 300px, -600px 400px; }
}

.about-box::before, .manager-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Layered background for a richer space effect */
    background-image:
        /* Layer 1: Small white stars */
        radial-gradient(1px 1px at 20px 30px, white, rgba(255,255,255,0)),
        radial-gradient(1px 1px at 40px 70px, white, rgba(255,255,255,0)),
        radial-gradient(1.5px 1.5px at 50px 160px, white, rgba(255,255,255,0)),
        /* Layer 2: Secondary color stars */
        radial-gradient(1.5px 1.5px at 90px 40px, var(--secondary-color), rgba(192,183,154,0)),
        radial-gradient(2px 2px at 130px 80px, var(--secondary-color), rgba(192,183,154,0)),
        radial-gradient(1.5px 1.5px at 160px 120px, white, rgba(255,255,255,0)),
        /* Layer 3: Larger glowing stars */
        radial-gradient(2.5px 2.5px at 10px 200px, white, rgba(255,255,255,0)),
        radial-gradient(2.5px 2.5px at 180px 180px, var(--secondary-color), rgba(192,183,154,0));

    background-repeat: repeat;
    background-size: 200px 200px, 150px 150px, 250px 250px; /* Different sizes for parallax */
    animation: space-effect 45s linear infinite;
    z-index: 1; /* Behind the content */
    opacity: 0.4; /* Increased opacity for more visibility */
}


/* Ensure content is above the new background */
.about-box > .container,
.manager-box > .container {
    position: relative;
    z-index: 2;
}

.about-box {
    margin-bottom: 2rem;
}

.about-box:hover, .manager-box:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(92, 58, 86, 0.3);
}

.about-box .section-title {
    color: var(--light-color);
}

.about-box .section-title .highlight {
    color: var(--secondary-color);
}

.about-box p, .manager-box p {
    color: rgba(255, 255, 255, 0.85);
}

/* Text animation inside about section */
#about-molham [data-aos] p, 
#about-molham [data-aos] h2,
#about-molham [data-aos] h5,
#about-molham [data-aos] .vertical-line {
    transition-property: opacity, transform;
}

.logo-about-container {
    perspective: 1000px;
}

.logo-about {
    max-width: 120px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2));
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.manager-photo-container {
    perspective: 1000px;
}

.manager-photo {
    border-radius: 15px;
    /* تم تعليق إطار الصورة فقط بناءً على الطلب */
    /* border: 5px solid var(--secondary-color); */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 200px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.vertical-line {
    width: 4px;
    height: 50px;
    background-color: var(--secondary-color);
    margin-inline-end: 15px;
    border-radius: 2px;
}

/* ******************************************************************************* */
/* ********************************* SERVICES SECTION **************************** */
/* ******************************************************************************* */
.services-section {
    background-color: var(--body-bg);
    position: relative;
    padding-bottom: 5rem;
}

.service-card {
    background-color: var(--light-color);
    padding: 2rem 1rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    border: 1px solid transparent;
    /* New styles for alignment */
    display: flex;
    flex-direction: column;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(92, 58, 86, 0.15);
    background-color: var(--primary-color);
    border-color: var(--secondary-color);
}

.service-card img {
    height: 80px;
    width: 80px;
    object-fit: contain;
    margin: 0 auto 1rem auto;
    transition: transform 0.4s ease;
}

.service-card h5 {
    color: var(--primary-color);
    font-weight: 700;
    transition: color 0.4s ease;
    margin-top: auto; /* Push text to the bottom */
    min-height: 48px; /* Reserve space for 2 lines of text */
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card:hover img {
    transform: scale(1.1) rotate(-5deg);
}

.service-card:hover h5 {
    color: var(--light-color);
}

/* ******************************************************************************* */
/* ********************************* PARTNERS SECTION **************************** */
/* ******************************************************************************* */
.partners-section {
    padding: 3rem 0;
    background-color: var(--secondary-color);
    
    /* CSS Variables for dynamic control */
    --slide-w: 170px;
    --slide-pad: 24px;
    --logo-count: 20; /* Default value, will be updated by JS */
    --loop-distance: calc(var(--logo-count) * (var(--slide-w) + var(--slide-pad)));
    --animation-duration: calc(var(--logo-count) * 3.5s);
}

.partners-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.partner-track {
    display: flex;
    width: fit-content; /* Let the width be determined by its content */
    animation: scroll-rtl var(--animation-duration) linear infinite;
}

/* Pause animation on hover for devices that support it */
@media (hover: hover) {
    .partner-track:hover {
        animation-play-state: paused;
    }
}

@keyframes scroll-rtl {
    from {
        transform: translateX(0);
    }
    to   { transform: translateX(var(--loop-distance)); } /* موجب = يمين */
}

.partner-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--slide-w);
    padding: 0 calc(var(--slide-pad) / 2);
    box-sizing: border-box;
    flex-shrink: 0; /* Prevent slides from shrinking */
}

.partner-slide img {
    height: 130px;
    width: 130px;
    object-fit: contain;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.partner-slide:hover img {
    transform: scale(1.1);
}


/* ******************************************************************************* */
/* *********************************** FOOTER ************************************ */
/* ******************************************************************************* */
.footer {
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.8);
    padding-top: 5rem;
}

.footer-heading {
    color: var(--light-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 50px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.footer .contact-info p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.footer .contact-info i {
    color: var(--secondary-color);
}

.footer-logo {
    max-width: 120px;
}

.social-links a {
    color: var(--light-color);
    font-size: 1.5rem;
    margin: 0 0.75rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
    transform: translateY(-5px);
}

.brand-text {
    color: var(--secondary-color);
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease, padding-right 0.3s ease;
}

.footer-links a:hover {
    color: var(--light-color);
    padding-right: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    margin-top: 4rem;
}

.footer-bottom p {
    color: var(--light-color);
    font-weight: 500;
    margin-bottom: 0;
}

/* ******************************************************************************* */
/* ******************************* MOBILE NAVIGATION ***************************** */
/* ******************************************************************************* */
.mobile-nav {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    height: 65px;
    background-color: rgba(42, 17, 36, 0.85); /* Darker background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-radius: 32.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7); /* Lighter default color */
    transition: color 0.3s ease;
    position: relative;
    width: 60px;
    height: 60px;
    z-index: 2;
}

.mobile-nav-item i {
    font-size: 1.4rem;
    margin-bottom: 2px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 2;
}

.mobile-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    position: relative;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-nav-item.active {
    color: var(--primary-color);
}

/* Background circle for the active item */
.mobile-nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px;
    height: 50px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-nav-item.active::before {
    transform: translate(-50%, -50%) scale(1);
}


/* ******************************************************************************* */
/* ********************************* RESPONSIVENESS ****************************** */
/* ******************************************************************************* */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 100px; 
    }

    .about-box, .manager-box {
        padding-top: 2rem;
        padding-bottom: 2rem;
        text-align: center;
        border-radius: 20px;
        margin: 0 1rem 2rem 1rem;
    }

    .about-box:hover, .manager-box:hover {
        transform: translateY(-12px) scale(1.02);
    }
    
    .manager-section .d-flex.align-items-center {
        justify-content: center !important;
    }
    
    .manager-box .col-lg-9 {
        text-align: center;
    }
    
    .manager-photo-container {
        margin: 0 auto 1.5rem;
    }
}

@media (min-width: 992px) {
    .about-box, .manager-box {
        border-radius: 25px;
        margin-left: 2rem;
        margin-right: 2rem;
    }
}

@media (max-width: 767.98px) {
    .section-icon {
        width: 50px;
        height: 50px;
    }
    .service-card h5 {
        font-size: 1rem;
    }
    .partners-container {
        padding: 1.5rem;
    }
    
    .partners-section {
        --slide-w: 150px;
        --slide-pad: 20px;
    }

    .partner-slide img {
        height: 100px;
        width: 100px;
    }
}
