/* ========================================
   Alhaed Engineering Consultancy - Custom Styles
   Template: Victory
   Colors from Logo: Navy Blue #1E2A5E & Golden Yellow #F4B814
   ======================================== */

/* ========== Base Responsive ========== */
html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

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

/* ========== Almarai Font - خط الموقع ========== */
@font-face {
    font-family: 'Almarai';
    src: url('/fonts/ALMARAI-BOLD.TTF') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Almarai';
    src: url('/fonts/ALMARAI-EXTRABOLD.TTF') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* تطبيق خط Almarai على كامل الموقع */
html,
body,
body * {
    font-family: 'Almarai', 'Spectral', 'Roboto', Arial, sans-serif !important;
}

/* استثناء أيقونات Font Awesome حتى تظهر بشكل صحيح في محتوى الصفحات */
.fa,
.fas,
.far,
.fab,
.fal,
[class^="fa-"],
[class*=" fa-"] {
    font-family: 'FontAwesome' !important;
}

/* ========== Color Variables ========== */
:root {
    --primary-navy: #1E2A5E;
    --primary-navy-dark: #151f45;
    --primary-navy-light: #2a3a7a;
    --secondary-gold: #F4B814;
    --secondary-gold-dark: #d9a410;
    --secondary-gold-light: #f6c43a;
}

/* ========== Override Victory Template Colors ========== */
.header {
    background-color: var(--primary-navy) !important;
}

.navbar-brand {
    color: var(--secondary-gold) !important;
}

.navbar-inverse .navbar-nav > li > a {
    color: #ffffff !important;
}

.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
    color: var(--secondary-gold) !important;
}

.primary-button a,
.primary-white-button a {
    background-color: var(--secondary-gold) !important;
    border-color: var(--secondary-gold) !important;
    color: var(--primary-navy) !important;
    font-weight: 700;
}

.primary-button a:hover,
.primary-white-button a:hover {
    background-color: var(--secondary-gold-dark) !important;
    border-color: var(--secondary-gold-dark) !important;
}

.section-heading h2,
.heading h2 {
    color: var(--primary-navy) !important;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.service-item:hover {
    background-color: var(--secondary-gold) !important;
}

.service-item:hover h4 {
    color: var(--primary-navy) !important;
}

button[type="submit"],
.btn {
    background-color: var(--secondary-gold) !important;
    border-color: var(--secondary-gold) !important;
    color: var(--primary-navy) !important;
    font-weight: 700;
}

button[type="submit"]:hover,
.btn:hover {
    background-color: var(--secondary-gold-dark) !important;
    border-color: var(--secondary-gold-dark) !important;
}

footer {
    background-color: var(--primary-navy) !important;
}

footer h4,
footer p,
footer a {
    color: #ffffff !important;
}

footer a:hover {
    color: var(--secondary-gold) !important;
}

/* أيقونات التواصل الاجتماعي في الفوتر */
footer .social-icons {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

footer .social-icons li {
    margin: 0;
}

footer .social-icons li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--primary-navy) !important;
    transition: all 0.3s ease;
}

footer .social-icons li a:hover {
    background: var(--secondary-gold);
    border-color: var(--secondary-gold);
    color: var(--primary-navy) !important;
    transform: translateY(-3px);
}

footer .social-icons li a i,
footer .social-icons li a svg {
    font-size: 20px;
    color: inherit;
    fill: currentColor;
    flex-shrink: 0;
}

/* زر الواتساب العائم */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    color: #fff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    z-index: 9999;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.whatsapp-float:hover {
    background: #20bd5a;
    color: #fff !important;
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.6);
}

.whatsapp-float i,
.whatsapp-float svg {
    font-size: 32px;
    fill: currentColor;
    flex-shrink: 0;
}

[dir="rtl"] .whatsapp-float {
    right: auto;
    left: 24px;
}

@media (max-width: 575px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    .whatsapp-float i {
        font-size: 28px;
    }
    [dir="rtl"] .whatsapp-float {
        right: auto;
        left: 20px;
    }
}

/* ========== RTL Support ========== */
[dir="rtl"] .navbar-nav {
    float: right !important;
}

[dir="rtl"] .text-content,
[dir="rtl"] p,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    text-align: right !important;
}

[dir="rtl"] .col-md-offset-3 {
    margin-right: 25%;
    margin-left: 0;
}

/* ========== Custom Enhancements ========== */
.banner {
    background-image: url('/AlhaedECCoTemp/tempvictory/img/banner-bg.jpg');
    background-size: cover;
    background-position: center;
}

/* ========== Services (RTL + AJAX filter styles) ========== */
.services-loading {
    padding: 18px 12px;
    text-align: center;
    color: #666;
    font-weight: 700;
}

.services-card-col {
    margin-bottom: 30px;
}

.services-card {
    background: #fff;
    padding: 40px 30px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    min-height: 350px;
}

.services-card-icon {
    max-width: 80px;
    margin-bottom: 20px;
}

.services-card-fallback-icon {
    font-size: 60px;
    color: var(--secondary-gold);
    margin-bottom: 20px;
}

.services-card-title {
    color: var(--primary-navy);
    margin-bottom: 15px;
    font-weight: 800;
}

.services-card-desc {
    color: #666;
    line-height: 1.8;
}

.services-card-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* RTL: cards flow from right to left and content aligns naturally */
[dir="rtl"] .services-grid {
    direction: rtl;
}

[dir="rtl"] .services-card {
    text-align: right;
}

[dir="rtl"] .services-card-actions {
    justify-content: flex-start;
}

.page-heading {
    background-image: url('/AlhaedECCoTemp/tempvictory/img/heading-bg.jpg');
    background-size: cover;
    background-position: center;
}

/* Partners Section */
.partners-section {
    padding: 80px 0;
    background-color: #f8f9fa;
}

.partner-logo {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ========== Projects CTA Section (Projects page bottom block) ========== */
.projects-cta-wrapper {
    padding: 60px 0 40px;
    text-align: center;
}

.projects-cta-wrapper .section-heading h2,
.projects-cta-wrapper .section-heading span {
    text-align: center !important;
}

.projects-cta-wrapper .filled-button,
.projects-cta-wrapper .border-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-inline: 22px;
}

/* ========== Hero Section Enhancements ========== */
.banner {
    position: relative;
    min-height: clamp(320px, 50vw, 600px);
    display: flex;
    align-items: center;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 42, 94, 0.85) 0%, rgba(30, 42, 94, 0.6) 100%);
    z-index: 1;
}

.banner .container {
    position: relative;
    z-index: 2;
}

.banner video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.banner h4 {
    color: var(--secondary-gold) !important;
    font-size: clamp(16px, 4vw, 24px);
    margin-bottom: 20px;
    animation: fadeInDown 1s ease;
}

.banner h2 {
    color: #ffffff !important;
    font-size: clamp(24px, 5vw, 48px);
    font-weight: 800;
    margin-bottom: 25px;
    animation: fadeInUp 1s ease 0.2s both;
}

.banner p {
    color: #ffffff !important;
    font-size: clamp(14px, 2.5vw, 18px);
    margin-bottom: 30px;
    animation: fadeInUp 1s ease 0.4s both;
}

/* ========== Navbar Logo Enhancement ========== */
.navbar-brand img,
.nav-logo-desktop a img {
    max-height: 50px;
    width: auto;
    transition: all 0.3s ease;
}

.navbar-brand:hover img,
.nav-logo-desktop a:hover img {
    transform: scale(1.05);
}

.navbar-brand-mobile { display: none !important; }
.nav-logo-desktop { display: list-item !important; }

/* ========== قائمة الجوال - تحسين بسيط مع الحفاظ على سلوك Bootstrap ========== */
@media (max-width: 767px) {
    .navbar-brand-mobile {
        display: inline-flex !important;
        align-items: center;
        max-width: 70%;
        min-height: 48px;
        padding: 4px 0;
    }
    .nav-logo-desktop { display: none !important; }
    .navbar-brand-mobile img {
        max-height: 56px !important;
        min-height: 40px;
        height: 48px;
        width: auto;
        object-fit: contain;
        object-position: start center;
    }
    .navbar-brand-mobile span {
        font-size: 1.35rem;
        font-weight: 800;
        color: var(--secondary-gold) !important;
    }
    .header .navbar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 0;
        flex-direction: row;
        gap: 12px;
    }
    [dir="rtl"] .header .navbar-header {
        flex-direction: row-reverse;
    }
    .navbar-inverse .navbar-toggle {
        border: 2px solid rgba(255,255,255,0.4);
        border-radius: 8px;
        padding: 10px 12px;
        margin: 0;
        background: rgba(255,255,255,0.08);
    }
    .navbar-inverse .navbar-toggle:hover,
    .navbar-inverse .navbar-toggle:focus {
        background: var(--secondary-gold);
        border-color: var(--secondary-gold);
    }
    .navbar-inverse .navbar-toggle .icon-bar {
        background-color: #fff;
        width: 22px;
        height: 2px;
        border-radius: 1px;
    }
    .navbar-inverse .navbar-toggle .icon-bar + .icon-bar {
        margin-top: 5px;
    }

    /* عناصر القائمة في وضع الجوال: عمودية وعريضة للغتين */
    .header .navbar #main-nav {
        background: var(--primary-navy-dark);
        border-top: 1px solid rgba(255,255,255,0.12);
        margin: 0 -15px;
        padding: 0;
        text-align: start;
    }
    .header .navbar #main-nav .navbar-nav {
        margin: 0;
        width: 100%;
        float: none;
        display: block;
    }
    .header .navbar-nav > li {
        display: block;
        width: 100%;
        float: none;
        margin: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .header .navbar-nav > li:last-child {
        border-bottom: none;
    }
    .header .navbar-nav > li > a {
        display: block;
        color: #fff !important;
        padding: 16px 20px;
        font-size: 16px;
        font-weight: 600;
        text-align: center; /* توسيط نص عناصر القائمة في الجوال */
        text-transform: none;
        letter-spacing: 0;
        transition: background 0.2s ease, color 0.2s ease;
    }
    .header .navbar-nav > li > a:hover,
    .header .navbar-nav > li > a:focus {
        background: rgba(255,255,255,0.08);
        color: var(--secondary-gold) !important;
    }

    /* إلغاء تأثير float في وضع RTL للجوال حتى يكون الشكل مثل الإنجليزي */
    [dir="rtl"] .header .navbar-nav {
        float: none !important;
    }
    [dir="rtl"] .header .navbar-nav > li {
        float: none !important;
    }
}

/* ========== Professional Footer ========== */
.site-footer {
    background: linear-gradient(180deg, var(--primary-navy) 0%, var(--primary-navy-dark) 100%) !important;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0;
}

.site-footer .footer-top {
    padding: 48px 0 36px;
}

.site-footer .footer-grid {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 40px 32px;
    align-items: start;
    max-width: 100%;
}

.site-footer .footer-col {
    margin-bottom: 0;
    min-width: 0;
}

.site-footer .footer-brand {
    max-width: 320px;
}

.site-footer .footer-brand .footer-logo {
    display: inline-block;
    margin-bottom: 20px;
}

.site-footer .footer-brand .footer-logo img {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.site-footer .footer-logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--secondary-gold) !important;
    text-decoration: none;
}

.site-footer .footer-brand .footer-title {
    margin-bottom: 12px;
}

.site-footer .footer-about-text {
    font-size: 0.9rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.8) !important;
    max-width: 100%;
    margin: 0;
}

.site-footer .footer-col .footer-links,
.site-footer .footer-col .footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.site-footer .footer-col .footer-links {
    row-gap: 8px;
}

.site-footer .footer-col .footer-contact {
    row-gap: 12px;
}

.site-footer .footer-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff !important;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-gold);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.site-footer .footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer .footer-links li {
    margin-bottom: 10px;
}

.site-footer .footer-links li a {
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    padding-inline-start: 0;
}

.site-footer .footer-links li a:hover {
    color: var(--secondary-gold) !important;
    padding-inline-start: 8px;
}

.site-footer .footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer .footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.site-footer .footer-contact li i {
    color: var(--secondary-gold);
    margin-top: 3px;
    min-width: 18px;
    text-align: center;
}

.site-footer .footer-contact li a {
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    transition: color 0.25s ease;
}

.site-footer .footer-contact li a:hover {
    color: var(--secondary-gold) !important;
}

.site-footer .footer-social-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.site-footer .footer-social {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.site-footer .footer-social li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #fff !important;
    transition: all 0.3s ease;
}

.site-footer .footer-social li a:hover {
    background: var(--secondary-gold);
    border-color: var(--secondary-gold);
    color: var(--primary-navy) !important;
    transform: translateY(-4px);
}

.site-footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.2);
}

.site-footer .footer-copyright p,
.site-footer .footer-legal a {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8) !important;
}

.site-footer .footer-legal a {
    text-decoration: none;
    transition: color 0.25s ease;
}

.site-footer .footer-legal a:hover {
    color: var(--secondary-gold) !important;
}

.site-footer .footer-sep {
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.4);
}

[dir="rtl"] .site-footer .footer-legal.text-md-end {
    text-align: left !important;
}

@media (max-width: 991px) {
    .site-footer .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px 24px;
    }
    .site-footer .footer-top {
        padding: 40px 0 32px;
    }
    .site-footer .footer-brand {
        grid-column: 1 / -1;
        max-width: none;
    }
    .site-footer .footer-brand .footer-logo img {
        height: 44px;
    }
    .site-footer .footer-about-text {
        max-width: none;
    }
}

@media (max-width: 575px) {
    .site-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .site-footer .footer-brand {
        grid-column: 1;
    }
}

@media (max-width: 767px) {
    .site-footer .footer-bottom .row {
        text-align: center !important;
    }
    .site-footer .footer-legal {
        text-align: center !important;
        margin-top: 10px;
    }
    [dir="rtl"] .site-footer .footer-legal.text-md-end {
        text-align: center !important;
    }
}

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

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

/* ========== RTL Navbar Fix ========== */
[dir="rtl"] .navbar-nav > li {
    float: right !important;
}

[dir="rtl"] .navbar-toggle {
    float: left !important;
}

[dir="rtl"] .navbar-brand {
    float: right !important;
}

/* ========== Navbar - سطر واحد مع زر اللغة ========== */
@media (min-width: 768px) {
    .header .navbar-collapse {
        display: flex !important;
        justify-content: center;
        align-items: center;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .header .navbar-nav {
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        float: none !important;
        margin: 0;
        min-width: min-content;
    }
    .header .navbar-nav > li {
        float: none !important;
        margin: 0 6px !important;
    }
    .header .navbar-nav > li > a {
        padding: 15px 8px !important;
        font-size: 13px !important;
        white-space: nowrap;
    }
    .header .navbar-nav .nav-logo-desktop a img {
        max-height: 42px;
    }
    .header .language-switcher {
        flex-shrink: 0;
        margin: 0 0 0 12px !important;
    }
    [dir="rtl"] .header .language-switcher {
        margin: 0 12px 0 0 !important;
    }
    .header .language-btn {
        padding: 6px 14px !important;
        font-size: 13px !important;
        white-space: nowrap;
    }
}

@media (min-width: 992px) {
    .header .navbar-nav > li {
        margin: 0 10px !important;
    }
    .header .navbar-nav > li > a {
        padding: 15px 10px !important;
        font-size: 14px !important;
    }
    .header .language-switcher {
        margin: 0 0 0 15px !important;
    }
    [dir="rtl"] .header .language-switcher {
        margin: 0 15px 0 0 !important;
    }
}

@media (min-width: 1200px) {
    .header .navbar-nav > li {
        margin: 0 14px !important;
    }
    .header .navbar-nav > li > a {
        padding: 15px 12px !important;
    }
}

/* ========== Language Switcher ========== */
.language-switcher {
    display: inline-block;
    margin-left: 15px;
}

.language-btn:hover {
    background: var(--secondary-gold) !important;
    color: var(--primary-navy) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 184, 20, 0.3);
}

.language-btn:active {
    transform: translateY(0);
}

[dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 15px;
}

/* ========== RTL Row Direction Fix ========== */
[dir="rtl"] .row {
    direction: rtl;
}

[dir="rtl"] .col-md-4,
[dir="rtl"] .col-md-3,
[dir="rtl"] .col-sm-6,
[dir="rtl"] .col-xs-12 {
    float: right !important;
}

[dir="ltr"] .row {
    direction: ltr;
}

[dir="ltr"] .col-md-4,
[dir="ltr"] .col-md-3,
[dir="ltr"] .col-sm-6,
[dir="ltr"] .col-xs-12 {
    float: left !important;
}

/* ========== Responsive - جميع الشاشات ========== */
@media (max-width: 1199px) {
    .container { padding-left: 15px; padding-right: 15px; }
    .banner .container,
    .page-heading .container { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 991px) {
    .container { max-width: 100%; }
    section.services,
    section.projects-section,
    .partners-section { padding: 50px 0 !important; }
    .page-heading { padding: 40px 0; }
    .page-heading h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
}

@media (max-width: 767px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .row { margin-left: -12px; margin-right: -12px; }
    .row > [class*="col-"] { padding-left: 12px; padding-right: 12px; }
    section.services,
    section.projects-section,
    .partners-section { padding: 40px 0 !important; }
    .banner { min-height: 280px; padding: 30px 0; }
    .banner .banner-content { padding: 0 10px; }
    .page-heading { padding: 30px 15px; }
    .page-heading h1 { font-size: 1.5rem; }
    .page-heading p { font-size: 0.95rem; }
    .service-item { min-height: auto !important; }
    .primary-button a,
    .primary-white-button a { padding: 10px 20px; font-size: 0.9rem; }
}

@media (max-width: 575px) {
    .container { padding-left: 10px; padding-right: 10px; }
    .row { margin-left: -10px; margin-right: -10px; }
    .row > [class*="col-"] { padding-left: 10px; padding-right: 10px; }
    .banner { min-height: 240px; }
    .heading h2,
    .section-heading h2 { font-size: 1.35rem !important; }
}


