/* === Base Styles === */

/* main font install */
@font-face {
    font-family: 'TheSansArabPlain';
    src: url(../fonts/TheSansArab-Plain.ttf);
}

:root {
    /* Light mode variables */
    --bg-color: rgba(245, 247, 250, 1);
    --text-color: #1A1A1A;
    --heading-color: #121212;
    --paragraph-color: #222222;
    --nav-bg: #fff;
    --btn-bg: #007167;
    --btn-color: #fff;
    --card-bg: #fff;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --stats-bg: #fff;
    --stats-number-color: #007167;
    --stats-text-color: #222222;
    --stats-item-bg: rgba(255, 255, 255, 0.7);
    --footer-bg: #007167;
    --footer-text: rgba(255, 255, 255, 0.8);
    --primary-color: #007167;
    --title-color: rgba(0, 113, 103, 1);
    --title-underline: rgba(0, 113, 103, 0.7);
}

body{
    /* Basic body setup */
    background-color: var(--bg-color);
    font-family: 'TheSansArabPlain', sans-serif;
    direction: rtl; /* Right-to-left for Arabic */
    text-align: right;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.6; /* Improved line height for better readability */
    color: var(--text-color); /* Using CSS variable instead of hardcoded value */
    overflow-x: hidden; /* Prevent horizontal scroll */
    max-width: 100vw;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* === Typography Improvements === */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-top: 0;
    letter-spacing: -0.01em; /* Slightly tighter letter-spacing for headings */
    color: var(--heading-color); /* Using CSS variable instead of hardcoded value */
    transition: color 0.3s ease;
}

p {
    margin-bottom: 1rem;
    color: var(--paragraph-color); /* Using CSS variable instead of hardcoded value */
    transition: color 0.3s ease;
}

/* === Header & Banner === */

.nav-holder {
    display: flex;
    padding: 15px 20px; /* Slightly more vertical padding */
    min-height: 80px;
    width: 100%;
    background-color: var(--nav-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* Subtle shadow for depth */
    position: sticky; /* Make navigation sticky */
    top: 0;
    z-index: 1000; /* Ensure it stays above other content */
    transition: background-color 0.3s ease;
}

.nav-holder .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Theme toggle switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.theme-switch-wrapper svg {
    margin-left: 10px;
    width: 20px;
    height: 20px;
    fill: var(--text-color);
}

.banner-holder {
    padding: 60px 0 40px; /* More padding top, less padding bottom */
}

.banner-holder h1 {
    font-size: 54px;
    font-weight: bold;
    margin-bottom: 0.5rem; /* Tighten space under main heading */
    color: var(--primary-color); /* Using CSS variable instead of hardcoded value */
}

.banner-holder h3 {
    font-size: 30px;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.banner-holder p {
    font-size: 18px;
    line-height: 1.7;
    max-width: 95%; /* Prevent long lines on large screens */
}

.banner-btns {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    width: 100%;
    min-height: auto; /* Allow natural height */
    text-decoration: none;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.banner-btn-div {
    display: flex;
    padding: 22px; /* Slightly larger padding */
    align-items: center;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--card-bg);
    border-radius: 12px; /* More rounded corners */
    border: 1px rgba(238, 238, 238, 0.1) solid;
    box-shadow: var(--card-shadow); /* Using CSS variable */
    transition: all ease .3s;
    cursor: pointer;
    min-width: 30%;
    text-align: center;
    flex: 1 1 calc(33.33% - 20px); /* More flexible sizing */
}

.banner-btn-div svg {
    margin-bottom: 10px; /* Add space between icon and text */
    transition: transform 0.3s ease;
}

.banner-btn-div svg path {
    fill: var(--primary-color);
    transition: fill 0.3s ease;
}

.banner-btn-div p {
    font-size: 18px;
    font-weight: 600; /* Slightly less bold for better balance */
    color: var(--text-color); /* Using CSS variable instead of hardcoded value */
    margin: 0; /* Remove default margins */
    transition: all 0.3s ease;
}

.banner-btn-div:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px); /* Slight lift effect */
    box-shadow: 0 8px 20px rgba(0, 113, 103, 0.2); /* Enhanced shadow on hover */
}

.banner-btn-div:hover svg {
    transform: scale(1.1); /* Slightly enlarge icon on hover */
}

.banner-btn-div:hover svg path {
    fill: #fff;
}

.banner-btn-div:hover p {
    color: #fff;
}

/* === Statistics Section === */

.banner-logos{
    width: 100%;
    padding: 20px 0; /* Reduced padding for better balance */
    background-color: var(--stats-bg);
    box-shadow: var(--card-shadow); /* Using CSS variable */
    margin-top: 20px; /* Space from previous section */
    transition: background-color 0.3s ease;
}

.stats-container {
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around; /* More even spacing */
    padding: 10px 15px; /* Increased padding */
}

.stat-item {
    flex: 0 0 calc(25% - 30px); /* 4 items per row with more spacing */
    display: flex;
    align-items: center;
    padding: 15px;
    transition: transform 0.3s ease; /* Add transition for hover effect */
    position: relative; /* For pseudo-element border */
}

.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: -15px; /* Position to the left (RTL layout) */
    top: 25%;
    height: 50%;
    width: 1px;
    background-color: rgba(0, 113, 103, 0.1); /* Very subtle divider */
}

.stat-item:hover {
    transform: translateY(-5px); /* Slight lift on hover */
}

.stat-item img {
    width: 40px; /* Slightly larger icons */
    height: auto;
    filter: drop-shadow(0 3px 5px rgba(0, 113, 103, 0.2)); /* Add subtle shadow to icons */
    transition: transform 0.3s ease;
}

.stat-item:hover img {
    transform: scale(1.1); /* Scale up icon on hover */
}

.stat-content {
    margin-right: 20px; /* More space between icon and text */
    text-align: right;
}

.stat-content strong {
    font-size: 36px; /* Larger numbers */
    color: var(--stats-number-color); /* Using CSS variable for dark mode compatibility */
    display: block;
    direction: ltr;
    text-align: right;
    font-weight: bold;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.stat-content p {
    font-size: 16px;
    font-weight: 600;
    margin-top: 5px;
    margin-bottom: 0;
    line-height: 1.5;
    color: var(--stats-text-color); /* Using CSS variable for dark mode compatibility */
    transition: color 0.3s ease;
}

/* === General & Content Sections === */

.title {
    font-size: 36px; /* Larger title */
    color: var(--title-color); /* Using CSS variable */
    font-weight: bold;
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
}

/* Add decorative underline to section titles */
.title:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background-color: var(--title-underline); /* Using CSS variable */
}

/* Adjust title display when centered to align underline correctly */
.text-center .title {
    display: inline-block;
}

.mt-6 {
    margin-top: 100px; /* Slightly reduced from 120px */
}

/* === Owl Carousel (Services Section) === */

.owl-carousel {
    direction: ltr;
    margin-top: 40px;
    position: relative;
    padding: 20px 5px; /* Add padding for shadow overflow */
}

/* Add box shadow and hover effects to carousel items */
.owl-carousel .owl-item > div {
    position: relative;
    cursor: pointer;
    display: block;
    border-radius: 12px;
    overflow: hidden; /* Keep shadow within border radius */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.owl-carousel .owl-item > div:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 113, 103, 0.15);
}

/* Target the default (white) card image inside the item div */
.owl-carousel .owl-item > div > .hover-hide {
    transition: opacity ease .3s;
    opacity: 1;
    display: block;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Apply hover effect ONLY to the specific div inside the specific owl-item */
.owl-carousel .owl-item > div:hover > .hover-hide {
    opacity: 0;
    z-index: 0;
}

/* Target the hover (green) card image inside the item div */
.owl-carousel .owl-item > div > .hover-show {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 1;
}

/* Improve navigation buttons */
.owl-carousel .owl-nav {
    margin-top: 30px;
    display: flex !important; /* Force display */
    justify-content: center;
    gap: 20px;
    z-index: 10; /* Ensure it's not hidden behind other elements */
}

.owl-carousel .owl-nav button.owl-prev,
.owl-carousel .owl-nav button.owl-next {
    width: 45px;
    height: 45px;
    background-color: var(--card-bg); /* Use theme variable */
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 113, 103, 0.3); /* Consider var(--primary-color) alpha */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.owl-carousel .owl-nav button.owl-prev:hover,
.owl-carousel .owl-nav button.owl-next:hover {
    background-color: var(--primary-color); /* Use theme variable */
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 113, 103, 0.2); /* Consider var(--primary-color) alpha */
}

.owl-carousel .owl-nav button.owl-prev span,
.owl-carousel .owl-nav button.owl-next span {
    font-size: 28px;
    line-height: 28px;
    color: var(--primary-color); /* Use theme variable */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    transition: color 0.3s ease;
}

.owl-carousel .owl-nav button:hover span {
    color: var(--btn-color); /* Use theme variable */
}

/* Improve dots navigation */
.owl-carousel .owl-dots {
    text-align: center;
    margin-top: 25px;
}

.owl-carousel .owl-dots .owl-dot {
    display: inline-block;
    margin: 0 6px;
}

.owl-carousel .owl-dots .owl-dot span {
    width: 12px;
    height: 12px;
    background-color: #ddd;
    border-radius: 50%;
    display: block;
    transition: all 0.3s ease;
}

.owl-carousel .owl-dots .owl-dot.active span {
    background-color: #007167;
    transform: scale(1.2);
}

.owl-carousel .owl-dots .owl-dot:hover span {
    background-color: rgba(0, 113, 103, 0.5);
}

/* === Buttons === */

.btn-green {
    text-decoration: none;
    display: inline-flex;
    padding: 18px 28px;
    background-color: var(--btn-bg);
    color: var(--btn-color);
    border-radius: 12px; /* More rounded corners */
    font-weight: 600;
    font-size: 17px;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    min-width: 180px; /* Ensure consistent width */
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 113, 103, 0.2);
}

.btn-green:hover {
    background-color: #005a52;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 113, 103, 0.3);
}

/* Style for the buttons in the middle section */
.btn-alpha {
    text-decoration: none;
    display: flex;
    padding: 16px 24px;
    background-color: #fff;
    color: #007167;
    border-radius: 10px;
    border: 2px solid rgba(0, 113, 103, 0.2);
    font-weight: 600;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-alpha img {
    transition: transform 0.3s ease;
}

.btn-alpha:hover {
    background-color: #007167;
    color: #fff;
    border-color: #007167;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 113, 103, 0.2);
}

.btn-alpha:hover img {
    transform: scale(1.1) rotate(-5deg);
    filter: brightness(10);
}

/* === Footer === */

footer {
    width: 100%;
    min-height: 260px;
    background-color: var(--footer-bg);
    display: flex;
    margin-top: 120px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

/* Add a subtle wave pattern to the footer */
footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, transparent 33.33%, rgba(255, 255, 255, 0.05) 33.33%, rgba(255, 255, 255, 0.05) 66.66%, transparent 66.66%);
    background-size: 30px 30px;
    opacity: 0.4;
    z-index: 1;
}

.footer-title {
    font-size: 22px;
    color: #fff;
    font-weight: bold;
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.footer-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.6);
}

.footer-link {
    font-size: 15px;
    color: var(--footer-text);
    text-decoration: none;
    margin: 12px 0;
    display: flex;
    width: 100%;
    transition: all 0.3s ease;
    position: relative;
    padding-right: 15px;
}

.footer-link:before {
    content: '»';
    position: absolute;
    right: 0;
    transform: translateX(0);
    opacity: 0;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #fff;
    padding-right: 20px;
}

.footer-link:hover:before {
    opacity: 1;
    transform: translateX(5px);
}

.social {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex-direction: row;
    margin: 25px 0;
    gap: 15px;
}

.social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.social a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.social img {
    width: 22px;
    height: auto;
}

hr {
    opacity: 0.2;
    margin: 30px 0;
}

.copyrights {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    margin: 20px 0;
    opacity: 0.7;
    text-align: center;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background-color: #007167;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.back-to-top:hover {
    background-color: #005a52;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.back-to-top:hover svg {
    transform: translateY(-3px);
}

/* === Media Queries === */

/* Note: These media queries primarily adjust the statistics layout */
/* The .res-banner-logo and .container-logos classes seem to be legacy styles */
/* for a previous version of the statistics section and might be removable */

/* Larger Desktops */
@media only screen and (min-width:1401px) {
    /* Legacy styles - may not be needed */
    .res-banner-logo {
        display: flex;
        flex-direction: row;
    }
    .container-logos {
        flex-direction: row;
        max-width: 1320px;
    }
}

/* Standard Desktops */
@media only screen and (max-width:1400px) {
    /* Legacy styles - may not be needed */
    .res-banner-logo{
        display: flex;
        flex-direction: row;
    }
    .container-logos {
        flex-direction: row;
        width: 100%;
        padding: 0 15px;
    }
}

/* Smaller Desktops / Large Tablets */
@media only screen and (max-width:1000px) {
    /* Legacy styles - may not be needed */
    .res-banner-logo {
        display: flex;
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }
    .container-logos{
        flex-direction: column;
        width: 100%;
    }
    .banner-logo {
        width: 48%;
        margin: 10px 0;
    }
}

/* Tablets and Below (Mobile View) */
@media only screen and (max-width:768px) {
    /* Legacy styles - may not be needed */
    .res-banner-logo {
        display: flex;
        flex-direction: column;
        width: 100%;
        align-items: center;
        margin: 10px 0;
    }
    .banner-logo {
        width: 90%;
        justify-content: center;
        margin: 15px 0;
        text-align: center;
    }
    .banner-logo div {
        text-align: center;
    }
    .container-logos {
        flex-direction: column;
        width: 100%;
        padding: 15px;
    }

    /* Responsive banner buttons for mobile */
    .banner-btns {
        flex-direction: column;
        gap: 15px;
        min-height: auto;
    }
    
    .banner-btn-div {
        width: 100%;
        padding: 15px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        min-width: 100%;
    }
    
    .banner-btn-div p {
        margin-top: 0;
        margin-right: 10px;
        font-size: 18px;
    }

    /* Mobile layout for Statistics Section (Overrides desktop flex layout) */
    .stats-container {
        display: flex;
        flex-direction: column; /* Stack items vertically */
        align-items: center; /* Center items horizontally */
        padding: 0 20px;
    }
    
    /* Mobile layout for individual stat items */
    .stat-item {
        width: 100%; /* Take full available width */
        max-width: 320px; /* Limit width for readability */
        display: flex;
        flex-direction: column; /* Stack icon above text */
        align-items: center;
        margin-bottom: 40px; /* Increased spacing between items */
        padding: 20px 0; /* Vertical padding within item */
        text-align: center;
        border-radius: 10px; /* Rounded corners for card look */
        background-color: var(--stats-item-bg); /* Using CSS variable */
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    }
    
    .stat-item img {
        width: 40px; /* Icon size for mobile - adjusted for consistency */
        margin: 0 0 20px 0; /* Space below icon */
    }
    
    .stat-content {
        margin-right: 0; /* Reset margin for centered layout */
        text-align: center; /* Center text */
        width: 100%;
    }
    
    .stat-content strong {
        text-align: center;
        font-size: 34px; /* Number size for mobile */
        margin-bottom: 5px; /* Space between number and label */
    }
}

/* Smaller Mobile Devices */
@media only screen and (max-width: 576px) {
    /* Further adjustments for very small screens */
    .stat-item img {
        width: 40px; /* Adjusted for consistency */
    }
    .stat-content strong {
        font-size: 28px;
    }
    .stat-content p {
        font-size: 14px;
    }

    .banner-holder h1 {
        font-size: 40px;
    }
    
    .banner-holder h3 {
        font-size: 24px;
    }
    
    .banner-holder p {
        font-size: 14px;
    }
    
    .btn-green {
        padding: 15px 20px;
    }
}

/* Adjustments for Statistics layout based on screen width */
/* Applies on screens smaller than 1200px */
@media only screen and (max-width: 1200px) {
    .stat-item {
        /* Adjust flex basis for slightly smaller screens if needed */
        flex: 0 0 calc(25% - 15px);
    }
}

/* Applies on screens smaller than 992px (e.g., large tablets) */
@media only screen and (max-width: 992px) {
    .stat-item {
        /* Change to 2 items per row */
        flex: 0 0 calc(50% - 15px);
        margin-bottom: 15px; /* Add bottom margin when wrapping */
    }
}

/* Service Cards */
.service-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 25px 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.3s ease;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 8px;
    border: 1px solid rgba(238, 238, 238, 0.5);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 113, 103, 0.1);
    background-color: var(--primary-color);
    color: white;
}

.service-icon {
    margin: 0 auto 20px auto;
    background-color: rgba(0, 113, 103, 0.08);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Add hover effect for service icons */
.service-card:hover .service-icon {
    background-color: rgba(255, 255, 255, 0.2);
}

.service-card:hover .service-icon svg path,
.service-card:hover .service-icon svg rect {
    stroke: white;
    fill: white;
}

.service-title {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 25px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.service-card:hover .service-title {
    color: white;
}

.service-stats {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin-top: auto;
    justify-content: space-between;
    padding: 0 5px;
}

.service-stat {
    display: flex;
    align-items: center;
    flex-direction: row-reverse; /* Reverse order for RTL to place icon right */
    justify-content: flex-start;
    gap: 8px;
}

.service-card:hover .service-stat svg path {
    stroke: white;
    fill: white;
}

.service-stat svg {
    min-width: 16px;
    transition: all 0.3s ease;
}

.service-stat span {
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s ease;
}

.service-card:hover .service-stat span {
    color: white;
}
    
/* Responsive Adjustments */
@media only screen and (max-width: 768px) {
    .service-card {
        padding: 25px; /* Increase padding */
        margin: 15px 0; /* Increase vertical margin */
    }
    
    .service-icon {
        width: 80px; /* Increase icon size */
        height: 80px;
    }
    
    .service-title {
        font-size: 20px; /* Increase title font size */
        margin-bottom: 25px;
    }
    
    .service-stats {
        flex-direction: column;
        gap: 15px;
        align-items: center; /* Center stats when stacked */
    }
    
    .service-stat span {
        font-size: 15px; /* Increase stat font size */
    }
}