@font-face {
    font-family: 'Zahra Font';
    src: url('../fonts/zahra_font.woff') format('woff'),
         url('../fonts/zahra_font.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Zahra Font 2';
    src: url('../fonts/zahra_font2.woff') format('woff'),
         url('../fonts/zahra_font2.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'zahra2';
    src: url('../fonts/zahra_font2.woff') format('woff'),
         url('../fonts/zahra_font2.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Force English font for numbers and letters in Arabic text */
@font-face {
    font-family: 'EnglishDefault';
    src: local('Inter'), local('ui-sans-serif'), local('system-ui'), local('Arial');
    unicode-range: U+0021-007E;
}

/* ========================================
   AnnajmPlus Design System Variables
   ======================================== */
:root {
    --font-sans: 'EnglishDefault', 'Inter', 'Noto Sans Arabic', ui-sans-serif, system-ui, sans-serif;
    --font-zahra: 'Zahra Font';
    --font-zahra2: 'EnglishDefault', 'Zahra Font 2';
    --color-primary: #940202;
    --color-primary-dark: #7a0202;
    --color-primary-light: #b00303;
    --color-accent: #f89202;
    --color-accent-dark: #cc7802;
    --color-accent-light: #ffa426;
    --color-dark: #1a1a1a;
    --color-darker: #0f0f0f;
    --color-surface: #fdfdfd;
    --color-surface-alt: #f5f5f5;
    --color-text: #1a1a1a;
    --color-text-light: #4b5563;
    --color-text-lighter: #9ca3af;
    --color-text-dark: #ffffff;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-gold: #f89202;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-dark-bg: rgba(15, 15, 15, 0.7);
    --glass-dark-border: rgba(255, 255, 255, 0.1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: #fffffe;
    overflow-x: hidden;
}

[dir="rtl"] body {
    font-family: 'EnglishDefault', 'zahra2', 'Zahra Font 2', 'Zahra Font', 'Noto Sans Arabic', 'Inter', ui-sans-serif, system-ui, sans-serif;
}

::selection {
    background-color: var(--color-primary);
    color: white;
}

/* Page Loader */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-darker);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255,255,255,0.05);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.76, 0, 0.24, 1) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: transparent;
}

#mobile-toggle {
    transition: all 0.3s ease;
    color: white;
    pointer-events: auto;
}

.navbar.scrolled #mobile-toggle {
    color: var(--color-dark);
}

.navbar.scrolled .navbar-container-home {
    height: 5rem;
}

.navbar.scrolled .logo-home {
    height: 4rem;
}

@media (min-width: 768px) {
    .navbar.scrolled .navbar-container-home {
        height: 6rem;
    }
    .navbar.scrolled .logo-home {
        height: 5rem;
    }
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.navbar.scrolled .nav-logo-text,
.navbar.scrolled .nav-link,
.navbar.scrolled .lang-switch,
.navbar.scrolled #mobile-toggle {
    color: #1a1a1a !important;
}

.navbar.scrolled .lang-switch {
    border-color: rgba(0,0,0,0.1);
}

.navbar.scrolled .lang-switch:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.nav-link {
    position: relative;
    color: rgba(255,255,255,0.9);
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

[dir="rtl"] .nav-link::after {
    left: auto;
    right: 0;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-cta {
    background: var(--color-primary);
    color: white;
    padding: 0.6rem 1.8rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(148, 2, 2, 0.2);
    text-decoration: none;
    display: inline-block;
}

.nav-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(148, 2, 2, 0.3);
    background: var(--color-primary-light);
    color: white;
}

.lang-switch {
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.lang-switch:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.lang-switch-mobile {
    color: var(--color-dark);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 0.8rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    text-decoration: none;
}

.lang-switch-mobile:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: white;
    z-index: 1001;
    transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 2.5rem;
    overflow-y: auto;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    color: var(--color-dark);
}

[dir="rtl"] .mobile-menu {
    right: auto;
    left: -100%;
    transition: left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
}

.mobile-menu.open {
    right: 0;
}

[dir="rtl"] .mobile-menu.open {
    left: 0;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-link {
    display: block;
    color: var(--color-dark);
    font-size: 1rem;
    font-weight: 700;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s ease;
    text-decoration: none;
}

.mobile-nav-link:hover {
    color: var(--color-primary);
    padding-left: 0.5rem;
}

[dir="rtl"] .mobile-nav-link:hover {
    padding-left: 0;
    padding-right: 0.5rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 700px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 500px;
    }
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-slide .hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (max-width: 1024px) {
    .hero-bg-contain {
        background-size: contain !important;
        background-position: center 50% !important;
        transform: scale(2) !important;
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.hero-title {
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    font-weight: 800;
    color: white;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-align: start;
    opacity: 0;
    transform: translateY(40px);
    animation: slideUp 0.8s ease forwards;
}

.hero-title.hero-title-rtl {
    line-height: 1.5;
}

.year-span {
    display: inline-block;
    margin-inline-start: 0.4em;
    vertical-align: baseline;
}

.hero-slide.active .hero-title {
    animation: slideUp 0.8s ease 0.3s forwards;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.2vw, 1.3rem);
    color: white;
    line-height: 1.8;
    margin-top: 1.5rem;
    text-align: start;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s ease forwards;
}

.hero-slide.active .hero-subtitle {
    animation: slideUp 0.8s ease 0.5s forwards;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Common Section */
.section-title {
    font-size: clamp(1.7rem, 4.5vw, 3rem);
    font-weight: 800;
    color: var(--color-dark);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-light);
    max-width: 800px;
    line-height: 1.9;
    font-weight: 400;
}

.accent-line {
    width: 60px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 2px;
    margin-top: 1rem;
}

/* Service Cards */
.service-card {
    position: relative;
    background: white;
    border-radius: 1rem;
    padding: 3rem 2.5rem;
    border: 1px solid var(--color-border);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    border-color: transparent;
    background-image: linear-gradient(white, white), linear-gradient(to bottom right, var(--color-primary-light), var(--color-primary));
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
}

.service-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, var(--color-primary-light), var(--color-primary));
    color: white;
    font-size: 1.8rem;
    transition: all 0.4s ease;
}

.service-card:hover .service-icon {
    border-radius: 1rem;
    transform: scale(1.15) rotate(10deg);
}

[dir="rtl"] .service-card:hover .service-icon {
    transform: scale(1.15) rotate(-10deg);
}

/* Stats Section */
.stats-section {
    background: var(--color-darker);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.stat-item {
    text-align: center;
    position: relative;
}

.stat-number {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 900;
    color: white;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    color: rgba(255,255,255,0.7);
    font-size: 1.05rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* News Cards */
.news-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    height: 420px;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    border-color: transparent;
    background-image: linear-gradient(white, white), linear-gradient(to bottom right, var(--color-primary-light), var(--color-primary));
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
}

.news-image {
    height: 240px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.news-card > div.p-6 {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-card a {
    margin-top: auto;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.news-card:hover .news-image img {
    transform: scale(1.1);
}

/* Page Hero Banner */
.page-hero {
    background: linear-gradient(135deg, var(--color-darker) 0%, var(--color-primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(ellipse at 70% 50%, rgba(248,146,2,0.08) 0%, transparent 60%);
}

/* Mission & Vision Cards */
.mission-card {
    background: linear-gradient(135deg, var(--color-surface-alt), white);
    border-radius: 1.5rem;
    padding: 3rem;
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.mission-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    border-radius: 3px 0 0 3px;
}

[dir="rtl"] .mission-card::before {
    left: auto;
    right: 0;
    border-radius: 0 3px 3px 0;
}

.mission-card.mission::before {
    background: var(--color-primary);
}

.mission-card.vision::before {
    background: var(--color-text-lighter);
}

/* Founder Section */
.founder-image-wrapper {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    aspect-ratio: 3/4;
    max-width: 400px;
}

.founder-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid rgba(148,2,2,0.2);
    border-radius: 1.5rem;
    pointer-events: none;
}

/* Values Section & Morphing Icon */
.value-icon-wrapper {
    width: 85px;
    height: 85px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50% 50% 50% 0px;
    transform: rotate(-45deg);
    margin: 0 auto 2.5rem;
    position: relative;
}

.value-icon-wrapper i {
    transform: rotate(45deg);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .value-icon-wrapper {
    transform: rotate(135deg);
    border-radius: 50%;
}

.service-card:hover .value-icon-wrapper i {
    transform: rotate(-135deg);
}

.values-section .service-card {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.values-section .service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(to bottom right, var(--color-primary-light), var(--color-primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: none;
}

.values-section .service-card:hover {
    background: white;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
    transform: translateY(-12px);
    border-radius: 1.25rem;
}

.values-section .service-card:hover::before {
    opacity: 1;
}

/* Service Image Cards (Featured) */
.service-image-card {
    background: white;
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.5s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
}

.service-image-card:hover {
    transform: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.service-image-card .image-wrapper {
    overflow: hidden;
    aspect-ratio: 3/2;
    position: relative;
}

.service-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1);
}

.service-image-card:hover img {
    transform: scale(1.12);
}

.service-image-card .card-content {
    padding: 2rem;
    text-align: start;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.service-image-card .card-title {
    color: var(--color-primary);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.service-image-card .card-subtitle {
    color: var(--color-dark);
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
    opacity: 0.85;
}

/* Branch Cards */
.branch-card {
    background: white;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: all 0.4s ease;
}

.branch-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

.branch-map {
    height: 220px;
    background: var(--color-surface-alt);
}

.branch-info {
    padding: 2rem;
}

/* CTA buttons */
.cta-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 3rem;
    background: var(--color-primary);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    border-radius: 0.75rem;
    transition: all 0.4s ease;
    box-shadow: 0 10px 25px rgba(148, 2, 2, 0.3);
    text-decoration: none;
}

.cta-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.15);
    color: white;
}

/* Site Footer */
.site-footer {
    background: var(--color-darker);
    color: rgba(255,255,255,0.7);
}

.footer-link {
    color: #9ca3af;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-decoration: none;
}

.footer-link:hover {
    color: var(--color-primary);
    padding-left: 4px;
}

[dir="rtl"] .footer-link:hover {
    padding-left: 0;
    padding-right: 4px;
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="rtl"] .reveal-left {
    transform: translateX(40px);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="rtl"] .reveal-right {
    transform: translateX(-40px);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    text-decoration: none;
}

[dir="rtl"] .whatsapp-float {
    right: auto;
    left: 2.5rem;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background: #20ba5a;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.2);
    color: white;
}

/* Floating Shapes */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.05;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(5deg); }
    50% { transform: translate(-20px, 20px) rotate(-5deg); }
    75% { transform: translate(15px, -15px) rotate(3deg); }
}
