/********** Template CSS **********/
:root {
    --primary: #f01a1a;
    --secondary: #6c757d;
    --light: #f8f9fa;
    --dark: #212529;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--dark);
    background-color: #fff;
}

h1,
h2,
.h1,
.h2,
.fw-bold {
    font-weight: 600 !important;
}

h3,
h4,
.h3,
.h4,
.fw-medium {
    font-weight: 500 !important;
}

h5,
h6,
.h5,
.h6,
.fw-normal {
    font-weight: 400 !important;
}

.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    display: none;
    z-index: 99;
}

/*** Spinner Container ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

/*** Spinner Animation Container ***/
.spinner-container {
    position: relative;
    width: 6rem; /* Adjust size as needed */
    height: 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/*** Top Red Gear Animation ***/
.spinner-top-gear {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotate-clockwise 2s linear infinite; /* Rotates clockwise */
}

/*** Bottom Black Gear Animation ***/
.spinner-bottom-gear {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotate-counterclockwise 2s linear infinite; /* Rotates counterclockwise */
}

/*** Keyframes for Clockwise Rotation ***/
@keyframes rotate-clockwise {
    from { transform: rotate(-360deg); }
    to { transform: rotate(360deg); }
}

/*** Keyframes for Counterclockwise Rotation ***/
@keyframes rotate-counterclockwise {
    from { transform: rotate(360deg); }
    to { transform: rotate(-360deg); }
}

/*** Button ***/
.btn {
    font-weight: 500;
    transition: .5s;
}

.btn.btn-primary,
.btn.btn-secondary {
    color: #FFFFFF;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

.btn-outline-body {
    color: var(--primary);
    border-color: #777777;
}

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

.owl-carousel {
    direction: ltr; /* الاتجاه الافتراضي */
}

.project-carousel .project-item {
    overflow: hidden; /* منع تمدد العناصر */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.project-carousel .project-item img {
    width: 100%;
    height: 250px; /* ضبط ارتفاع ثابت */
    object-fit: cover; /* قص الصور بشكل متناسق */
    border-radius: 8px; /* إضافة زوايا مستديرة */
}

.project-carousel .owl-item {
    display: flex;
    justify-content: center; /* محاذاة العنصر في المركز */
}

/* التحكم في الفواصل بين العناصر */
.project-carousel .owl-stage {
    display: flex;
    align-items: center;
}

/* الأزرار بجانب المشاريع */
.owl-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none; /* منع التدخل مع العناصر الأخرى */
}

.owl-prev, .owl-next {
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 50%;
    pointer-events: all; /* السماح بالتفاعل مع الأزرار */
}

/* الاتجاه الافتراضي (LTR) */
.owl-prev {
    margin-left: -50px; /* السهم على اليسار */
}

.owl-next {
    margin-right: -50px; /* السهم على اليمين */
}

/* دعم الاتجاه RTL */
[dir="rtl"] .owl-prev {
    margin-left: auto;
    margin-right: -50px; /* السهم على اليمين */
}

[dir="rtl"] .owl-next {
    margin-right: auto;
    margin-left: -50px; /* السهم على اليسار */
}

.owl-prev, .owl-next {
    pointer-events: all; /* تفعيل التفاعل مع الأزرار */
    cursor: pointer; /* تحويل المؤشر إلى اليد */
}

/*** Navbar ***/
.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}

.navbar .navbar-nav .nav-link {
    margin-right: 30px;
    padding: 30px 0;
    color: var(--dark);
    font-weight: 500;
    text-transform: uppercase;
    outline: none;
}

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

.navbar.sticky-top {
    top: -100px;
    transition: .5s;
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav .nav-link {
        margin-right: 0;
        padding: 10px 0;
    }

    .navbar .navbar-nav {
        border-top: 1px solid #EEEEEE;
    }
}

@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        visibility: hidden;
        top: 100%;
        transform: rotateX(-75deg);
        transform-origin: 0% 0%;
        transition: .5s;
        opacity: 0;
    }

    .navbar .nav-item:hover .dropdown-menu {
        transform: rotateX(0deg);
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}

.mobile-nav {
    border-top: 1px solid #eee;
}

.mobile-nav .nav-link {
    color: #6c757d;
    font-size: 12px;
    text-transform: uppercase;
}

.mobile-nav .nav-link.active {
    color: var(--primary);
}

.mobile-nav .nav-link i {
    font-size: 20px;
}

@media (max-width: 991.98px) {
    .navbar {
        display: none;
    }
}

/*** Header ***/
.owl-carousel-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, .5);
}

@media (max-width: 768px) {
    .header-carousel .owl-carousel-item {
        position: relative;
        min-height: 500px;
    }

    .header-carousel .owl-carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .header-carousel .owl-carousel-item p {
        font-size: 16px !important;
    }
}

.header-carousel .owl-dots {
    position: absolute;
    width: 60px;
    height: 100%;
    top: 0;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-carousel .owl-dots .owl-dot {
    position: relative;
    width: 45px;
    height: 45px;
    margin: 5px 0;
    background: var(--dark);
    transition: .5s;
}

.header-carousel .owl-dots .owl-dot.active {
    width: 60px;
    height: 60px;
}

.header-carousel .owl-dots .owl-dot img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 2px;
    transition: .5s;
    opacity: .3;
}

.header-carousel .owl-dots .owl-dot.active img {
    opacity: 1;
}

.page-header {
    background: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, .5)), url(../img/carousel-1.jpg) center center no-repeat;
    background-size: cover;
}

.page-header2 {
    background: url('../img/product-bottom-banner5.jpg') center center no-repeat;
    background-size: cover;
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    color: #fff;
}

.page-header2 .content {
    z-index: 1; /* لعرض المحتوى فوق الخلفية */
}

.page-header2:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* إعدادات الشاشات الصغيرة */
@media (max-width: 768px) {
    .page-header2 {
        height: 200px; /* تقليل الارتفاع للشاشات الصغيرة */
    }
    .page-header2 .content h1 {
        font-size: 24px; /* تقليل حجم النص */
    }
    .page-header2 .content p {
        font-size: 16px;
    }
}

/* إعدادات الشاشات الكبيرة */
@media (min-width: 1200px) {
    .page-header2 {
        height: 400px; /* زيادة الارتفاع للشاشات الكبيرة */
    }
    .page-header2 .content h1 {
        font-size: 48px; /* زيادة حجم النص */
    }
    .page-header2 .content p {
        font-size: 20px;
    }
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--light);
}

/*** Section Title ***/
.section-title {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 5px;
    text-transform: uppercase;
}

/*** Facts ***/
.fact-item .fact-icon {
    width: 120px;
    height: 120px;
    margin-top: -60px;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border-radius: 120px;
    transition: .5s;
}

.fact-item:hover .fact-icon {
    background: var(--dark);
}

.fact-item .fact-icon i {
    color: var(--primary);
    transition: .5;
}

.fact-item:hover .fact-icon i {
    color: #FFFFFF;
}

/*** Products ***/
.product-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 45px rgba(0, 0, 0, .07);
}

.product-item .product-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    padding-top: 60px;
    transition: .5s;
}

.product-item:hover .product-overlay {
    opacity: 1;
    padding-top: 0;
}

.courses {
    min-height: 100vh;
    background: linear-gradient(rgba(255, 255, 255, .9), rgba(255, 255, 255, .9)), url(../img/carousel-1.jpg) center center no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

.courses-item .courses-overlay {
    position: absolute;
    width: 100%;
    height: 0;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    overflow: hidden;
    opacity: 0;
    transition: .5s;
}

.courses-item:hover .courses-overlay {
    height: 100%;
    opacity: 1;
}

.project-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 45px rgba(0, 0, 0, .07);
}

.project-item .project-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    padding-top: 60px;
    transition: .5s;
}

.project-item:hover .project-overlay {
    opacity: 1;
    padding-top: 0;
}

.project-carousel .owl-nav {
    position: absolute;
    top: 50%;
    left: -40px;
    right: -40px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.project-carousel .owl-nav .owl-prev,
.project-carousel .owl-nav .owl-next {
    pointer-events: all; /* تمكين النقر على الأزرار */
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 25px;
    background: white;
    transition: all 0.3s ease;
    z-index: 11;
}

.project-carousel .owl-nav .owl-prev i,
.project-carousel .owl-nav .owl-next i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transform: none;
}

.project-carousel .owl-nav .owl-prev:hover,
.project-carousel .owl-nav .owl-next:hover {
    background: var(--primary);
    color: #FFFFFF;
}

@media (max-width: 768px) {
    .project-carousel .owl-nav .owl-prev,
    .project-carousel .owl-nav .owl-next {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .project-carousel .owl-nav .owl-prev {
        left: 100px; /* تقليل المسافة على الشاشات الصغيرة */
    }

    .project-carousel .owl-nav .owl-next {
        right: 100px; /* تقليل المسافة على الشاشات الصغيرة */
    }
}

.hover-color {
    transition: background-color 0.3s, color 0.3s; /* تأثير انتقال ناعم */
}

.hover-color:hover {
    background-color: #ff2200; /* اللون الجديد عند التحويم */
    color: #fff; /* تغيير لون الأيقونة للنص */
}

/*** About & Feature ***/
.about-img,
.feature-img {
    position: relative;
    height: 100%;
    min-height: 400px;
}

.about-img img,
.feature-img img {
    position: absolute;
    width: 60%;
    height: 80%;
    object-fit: cover;
}

.about-img img:last-child,
.feature-img img:last-child {
    margin: 20% 0 0 40%;
}

.about-img::before,
.feature-img::before {
    position: absolute;
    content: "";
    width: 60%;
    height: 80%;
    top: 10%;
    left: 20%;
    border: 5px solid var(--primary);
    z-index: -1;
}

/*** Service ***/
.service-item .bg-img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    transition: transform 0.5s ease;
}

.service-item:hover .bg-img {
    transform: scale(1.1);
}

.service-item .service-text {
    background: var(--light);
    transition: .5s;
    width: 100%;
}

.service-item:hover .service-text {
    background: rgba(0, 0, 0, .7);
    width: 100%;
}

.service-item * {
    transition: .5;
}

.service-item:hover * {
    color: #FFFFFF;
}

.service-item .btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    color: var(--dark);
    background: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    transition: .5s;
}

.service-item:hover .btn {
    width: 140px;
}

/*** Project ***/
.project .nav .nav-link {
    background: var(--light);
    transition: .5s;
}

.project .nav .nav-link.active {
    background: var(--primary);
}

.project .nav .nav-link.active h3 {
    color: #FFFFFF !important;
}

/*** Team ***/
.team-items {
    margin: -.75rem;
}

.team-item {
    padding: .75rem;
}

.team-item .team-social {
    position: absolute;
    width: 100%;
    height: 0;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .75);
    overflow: hidden;
    opacity: 0;
    transition: .5s;
}

.team-item:hover .team-social {
    height: 100%;
    opacity: 1;
}

/*** Appointment ***/
.bootstrap-datetimepicker-widget.bottom {
    top: auto !important;
}

.bootstrap-datetimepicker-widget .table * {
    border-bottom-width: 0px;
}

.bootstrap-datetimepicker-widget .table th {
    font-weight: 500;
}

.bootstrap-datetimepicker-widget.dropdown-menu {
    padding: 10px;
    border-radius: 2px;
}

.bootstrap-datetimepicker-widget table td.active,
.bootstrap-datetimepicker-widget table td.active:hover {
    background: var(--primary);
}

.bootstrap-datetimepicker-widget table td.today::before {
    border-bottom-color: var(--primary);
}

/*** Footer ***/
.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: #777777;
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--primary);
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    color: var(--primary);
    letter-spacing: 1px;
    box-shadow: none;
}

.footer .form-control {
    border-color: #777777;
}

.footer .copyright {
    padding: 25px 0;
    font-size: 15px;
    border-top: 1px solid rgba(256, 256, 256, .1);
}

.footer .copyright a {
    color: var(--light);
}

.footer .copyright a:hover {
    color: var(--primary);
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
    box-shadow: none;
    border-color: var(--primary);
}

.invalid-feedback {
    display: none;
    color: #dc3545;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-select:invalid ~ .invalid-feedback {
    display: block;
}

/* Lazy Loading Images */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img.lazy.loaded {
    opacity: 1;
}

/* Animations */
.wow {
    visibility: hidden;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.875rem; }
}

/* Loading Spinner for Buttons */
.btn .spinner-border {
    display: none;
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

.btn.loading .spinner-border {
    display: inline-block;
}

/* Toastr Customization */
#toast-container > div {
    opacity: 1;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: none;
    }

    .container {
        width: auto;
        max-width: 100%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #ffffff;
    }

    .card {
        background-color: #1e1e1e;
        border-color: #2d2d2d;
    }

    .form-control,
    .form-select {
        background-color: #2d2d2d;
        border-color: #3d3d3d;
        color: #ffffff;
    }
}

/* Accessibility Improvements */
.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;
}

/* Focus Styles */
:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

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

img {
    max-width: 100%;
    height: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}
