/* =============== GOOGLE FONTS =============== */
/* Imported in HTML to avoid render blocking, but noted here: Cairo & Tajawal */

/* =============== VARIABLES CSS =============== */
:root {
    --header-height: 4.5rem;

    /* ========== Colors ========== */
    /* Deep Islamic Green */
    --first-color: #0F4C3A;
    --first-color-alt: #093326;
    --first-color-light: #E8F5F1;

    /* Gold/Bronze */
    --second-color: #C5A059;
    --second-color-alt: #A88645;

    /* Neutral */
    --title-color: #1A1A1A;
    --text-color: #555555;
    --text-color-light: #888888;
    --body-color: #FFFFFF;
    --container-color: #FFFFFF;
    --section-bg: #F9FAFB;
    --border-color: #E5E7EB;

    /* ========== Font and Typography ========== */
    --body-font: 'Tajawal', sans-serif;
    --title-font: 'Cairo', sans-serif;

    --h1-font-size: 2.5rem;
    --h2-font-size: 2rem;
    --h3-font-size: 1.25rem;
    --normal-font-size: 1rem;
    --small-font-size: 0.875rem;
    --smaller-font-size: 0.813rem;

    /* ========== Font Weight ========== */
    --font-medium: 500;
    --font-semi-bold: 600;
    --font-bold: 700;

    /* ========== Z Index ========== */
    --z-tooltip: 10;
    --z-fixed: 100;
}

/* Responsive Typography */
@media screen and (min-width: 968px) {
    :root {
        --h1-font-size: 3.5rem;
        --h2-font-size: 2.5rem;
        --h3-font-size: 1.5rem;
        --normal-font-size: 1.125rem;
        --small-font-size: 1rem;
        --smaller-font-size: 0.875rem;
    }
}

/* =============== BASE =============== */
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
    background-color: var(--body-color);
    color: var(--text-color);
    direction: rtl;
    /* RTL Support */
    overflow-x: hidden;
}

h1,
h2,
h3 {
    color: var(--title-color);
    font-family: var(--title-font);
    font-weight: var(--font-bold);
    line-height: 1.3;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: .3s;
}

img {
    max-width: 100%;
    height: auto;
}

button,
input {
    border: none;
    outline: none;
    font-family: var(--body-font);
}

button {
    cursor: pointer;
}

/* =============== CSS CLASSES =============== */
.section {
    padding: 5rem 0 2rem;
}

.section-title {
    font-size: var(--h2-font-size);
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--first-color);
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-subtitle {
    display: block;
    font-size: var(--small-font-size);
    color: var(--second-color);
    text-align: center;
    margin-bottom: 0.5rem;
    font-weight: var(--font-semi-bold);
    letter-spacing: 1px;
}

.container {
    max-width: 1100px;
    margin-left: 1.5rem;
    margin-right: 1.5rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    column-gap: 0.5rem;
    padding: 1rem 1.75rem;
    border-radius: 0.5rem;
    font-weight: var(--font-semi-bold);
    transition: .3s;
    font-size: var(--normal-font-size);
}

.btn-primary {
    background-color: var(--second-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--second-color-alt);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
}

.btn-outline {
    border: 2px solid var(--second-color);
    color: var(--second-color);
    padding: 0.75rem 1.5rem;
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--second-color);
    color: white;
}

.btn-light {
    background-color: white;
    color: var(--first-color);
}

.btn-light:hover {
    background-color: var(--first-color-light);
}

.btn-text {
    color: white;
}

.btn-text:hover {
    color: var(--second-color);
}

/* =============== HEADER =============== */
.header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-fixed);
    background-color: transparent;
    /* Transparent initially */
    transition: .4s;
}

/* Header scroll state */
.header.scroll-header {
    background-color: var(--body-color);
    box-shadow: 0 2px 16px rgba(0, 0, 0, .08);
    height: var(--header-height);
}

.header.scroll-header .nav-link,
.header.scroll-header .logo,
.header.scroll-header .nav-toggle {
    color: var(--title-color);
}

.header-container {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: white;
    /* Default mostly for Hero */
    font-weight: var(--font-bold);
    font-size: var(--h3-font-size);
    font-family: var(--title-font);
    display: flex;
    align-items: center;
    column-gap: 0.5rem;
}

.logo i {
    color: var(--second-color);
    font-size: 1.5rem;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 4px; /* Optional: smooth corners if it's rectangular */
}

.nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    column-gap: 2rem;
}

.nav-link {
    color: white;
    /* Default for transparent header */
    font-weight: var(--font-medium);
}

.nav-link:hover {
    color: var(--second-color);
}

.nav-link.active {
    color: var(--second-color);
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--second-color);
}

.header-actions {
    display: flex;
    align-items: center;
    column-gap: 1rem;
}

.nav-toggle {
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: none;
}

.nav-close {
    font-size: 1.5rem;
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    cursor: pointer;
    color: var(--title-color);
    display: none;
    /* Only mobile */
}

/* =============== HOME (HERO) =============== */
.home {
    position: relative;
    padding-top: var(--header-height);
    padding-bottom: 5rem;
    background-color: var(--first-color);
    /* Fallback */
    background-image: url('https://images.unsplash.com/photo-1542204165-65bf26472b9b?ixlib=rb-4.0.3&auto=format&fit=crop&w=1674&q=80');
    /* Professional nature/abstract background */
    background-size: cover;
    background-position: center;
    min-height: 90vh;
    display: flex;
    align-items: center;
    color: white;
    overflow: hidden;
    /* Prevent 3D scrollbars */
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Below content (2), same/above overlay (1) - need to check overlay z-index */
    pointer-events: none;
    /* Let clicks pass through */
}

.home-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 76, 58, 0.95) 0%, rgba(15, 76, 58, 0.7) 100%);
    z-index: 0;
    /* Move overlay to 0 */
}

/* Update container z-index to be above canvas */
.home-container {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.home-subtitle {
    display: block;
    font-size: var(--h3-font-size);
    font-family: var(--title-font);
    margin-bottom: 1rem;
    color: var(--second-color);
}

.home-title {
    font-size: var(--h1-font-size);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.home-description {
    margin-bottom: 2.5rem;
    font-size: var(--h3-font-size);
    opacity: 0.9;
    max-width: 600px;
}

.home-buttons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* =============== VALUES =============== */
.values {
    background-color: var(--section-bg);
}

.values-container {
    grid-template-columns: repeat(3, 1fr);
    margin-top: -6rem;
    /* Overlap hero */
    z-index: 10;
    position: relative;
}

.values-card {
    background-color: var(--container-color);
    padding: 2.5rem 1.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 8px 24px rgba(15, 76, 58, 0.08);
    /* Green shadow hint */
    transition: .3s;
    border-top: 4px solid transparent;
}

.values-card:hover {
    transform: translateY(-10px);
    border-top: 4px solid var(--second-color);
    box-shadow: 0 12px 32px rgba(15, 76, 58, 0.12);
}

.values-icon {
    font-size: 2.5rem;
    color: var(--first-color);
    margin-bottom: 1rem;
}

.values-title {
    font-size: var(--h3-font-size);
    margin-bottom: 0.75rem;
}

.values-description {
    font-size: var(--small-font-size);
}


/* =============== PRODUCTS =============== */
.products-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--container-color);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 1rem;
    transition: .4s;
    position: relative;
    overflow: hidden;
    /* Background settings common */
    background-size: cover;
    background-position: center;
    z-index: 1;
}

/* Dark overlay for readability */
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(15, 76, 58, 0.85) 0%, rgba(9, 51, 38, 0.95) 100%);
    z-index: -1;
    opacity: 0;
    transition: .4s;
}

/* Specific Backgrounds - Initially just container color, image added on specific classes */
.card-motor {
    background-image: url('https://images.unsplash.com/photo-1549317661-bd32c8ce0db2?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
    /* Modern Car */
}

.card-health {
    background-image: url('https://images.unsplash.com/photo-1505751172876-fa1923c5c528?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
    /* Health/Stethoscope */
}

.card-property {
    background-image: url('https://images.unsplash.com/photo-1560518883-ce09059eeffa?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
    /* Modern House */
}

.card-family {
    background-image: url('https://images.unsplash.com/photo-1511895426328-dc8714191300?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
    /* Family hands */
}

/* Default state (with image): Use overlay to darken image so text is readable */
.product-card {
    border: none;
    /* remove border as we have full bg */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.product-card::before {
    opacity: 0.85;
    /* Always show overlay */
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.product-card:hover::before {
    opacity: 0.92;
    /* Darker on hover for focus */
    background: linear-gradient(180deg, rgba(15, 76, 58, 0.9) 0%, rgba(197, 160, 89, 0.9) 100%);
    /* Green to Gold hint */
}

/* Text colors needs to be white on dark backgrounds */
.product-card .product-title,
.product-card .product-description,
.product-card .product-icon-wrapper i {
    color: white;
    position: relative;
    z-index: 10;
}

.product-icon-wrapper {
    width: 60px;
    height: 60px;
    background-color: var(--first-color-light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--first-color);
    font-size: 1.5rem;
    transition: .3s;
}

.product-card .product-icon-wrapper {
    background-color: rgba(255, 255, 255, 0.15);
    /* Transparent white */
    backdrop-filter: blur(4px);
}

.product-card:hover .product-icon-wrapper {
    background-color: var(--second-color);
    color: white;
}

.product-title {
    font-size: var(--h3-font-size);
    margin-bottom: 0.75rem;
}

.product-description {
    font-size: var(--small-font-size);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.product-link {
    color: var(--second-color);
    font-weight: var(--font-bold);
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-top: auto;
    /* Push to bottom if flex */
}

.product-link:hover {
    background-color: white;
    color: var(--first-color);
}

/* =============== ABOUT =============== */
.about {
    background-color: var(--first-color-light);
    /* Very light green hint */
}

.about-container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    gap: 4rem;
}

.about-description {
    margin-bottom: 2rem;
    line-height: 1.7;
}

.about-list li {
    display: flex;
    align-items: center;
    column-gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: var(--font-medium);
}

.about-list i {
    color: var(--second-color);
}

.about-image {
    position: relative;
}

.image-placeholder {
    width: 100%;
    height: 400px;
    background-color: #ddd;
    /* Fallback */
    background-image: url('https://images.unsplash.com/photo-1556761175-5973dc0f32e7?ixlib=rb-4.0.3&auto=format&fit=crop&w=1632&q=80');
    /* Business meeting/handshake */
    background-size: cover;
    background-position: center;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.7);
    display: none;
    /* Hiding icon if img loads */
}

/* =============== CTA =============== */
.cta {
    background-color: var(--first-color);
    color: white;
    text-align: center;
    padding: 4rem 0;
}

.cta-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: url('https://www.transparenttextures.com/patterns/arabesque.png');
    /* Pattern overlay */
}

.cta-title {
    color: white;
    font-size: var(--h2-font-size);
    margin-bottom: 0.5rem;
}

.cta-description {
    opacity: 0.9;
}

/* =============== FOOTER =============== */
.footer {
    background-color: #0B3328;
    /* Darker than first-color */
    color: #d1d5db;
    padding-top: 4rem;
    padding-bottom: 1rem;
}

.footer-container {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 0.8fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    column-gap: 0.5rem;
    color: white;
    font-size: 1.5rem;
    font-family: var(--title-font);
    font-weight: var(--font-bold);
    margin-bottom: 1.25rem;
}

.footer-logo i {
    color: var(--second-color);
}

.footer-description {
    font-size: var(--small-font-size);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    column-gap: 1rem;
}

.footer-social-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: .3s;
}

.footer-social-link:hover {
    background-color: var(--second-color);
}

.footer-title {
    font-size: var(--h3-font-size);
    color: white;
    margin-bottom: 1.25rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-link:hover {
    color: var(--second-color);
}

.footer-info li {
    display: flex;
    column-gap: 1rem;
    /* RTL flipped */
    margin-bottom: 1rem;
    font-size: var(--small-font-size);
}

.footer-info i {
    color: var(--second-color);
    font-size: 1.1rem;
}

.footer-copy {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: var(--smaller-font-size);
}

/* =============== SCROLL UP =============== */
.scrollup {
    position: fixed;
    right: 1rem;
    bottom: -30%;
    background-color: var(--second-color);
    color: white;
    display: inline-flex;
    padding: 0.6rem;
    border-radius: 0.25rem;
    z-index: var(--z-tooltip);
    opacity: 0.8;
    transition: .4s;
}

.scrollup:hover {
    opacity: 1;
    transform: translateY(-5px);
}

.scrollup.show-scroll {
    bottom: 3rem;
}

/* =============== BREAKPOINTS =============== */
/* Large Devices (Desktops) */
@media screen and (min-width: 1024px) {
    .container {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Medium Devices (Tablets) */
@media screen and (max-width: 968px) {
    .nav-list {
        display: none;
        /* Hide for now, use mobile menu in smaller */
    }

    .cta-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .values-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-container {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Devices (Mobiles) */
@media screen and (max-width: 767px) {
    .nav-menu {
        position: fixed;
        top: -100%;
        left: 0;
        width: 100%;
        background-color: white;
        padding: 4rem 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transition: .4s;
        z-index: var(--z-fixed);
    }

    /* Show Menu */
    .show-menu {
        top: 0;
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        row-gap: 1.5rem;
    }

    .nav-link {
        color: var(--title-color);
        font-size: var(--h3-font-size);
    }

    .nav-close {
        display: block;
    }

    .nav-toggle {
        display: block;
    }

    .header-actions .btn {
        display: none;
        /* Hide portal btn on very small */
    }

    .values-container {
        grid-template-columns: 1fr;
        margin-top: 2rem;
    }

    .home-title {
        font-size: 2rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* =============== CALCULATOR =============== */
.calculator {
    background-color: var(--first-color-light);
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.calculator-description {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.calculator-form {
    background-color: var(--container-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: var(--font-medium);
    color: var(--title-color);
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--body-color);
    color: var(--text-color);
    font-size: var(--normal-font-size);
}

.input-field:focus {
    border-color: var(--second-color);
}

.calculator-result {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: var(--font-bold);
    color: var(--title-color);
}

.result-value {
    color: var(--first-color);
    font-size: 1.5rem;
}

/* =============== CLAIMS PROCESS =============== */
.claims-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    text-align: center;
    margin-top: 3rem;
}

.claims-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
}

.step-number {
    width: 30px;
    height: 30px;
    background-color: var(--second-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: var(--font-bold);
    margin-bottom: 1rem;
}

.step-icon {
    font-size: 2.5rem;
    color: var(--first-color);
    margin-bottom: 1rem;
}

.step-title {
    font-size: var(--h3-font-size);
    margin-bottom: 0.5rem;
}

.step-desc {
    font-size: var(--small-font-size);
    line-height: 1.5;
}

.step-line {
    width: 100%;
    height: 2px;
    background-color: var(--border-color);
    margin-top: 2.5rem;
    /* Align with icons roughly */
}

/* =============== SHARIA BOARD =============== */
.sharia {
    background-color: #fdfbf7;
    /* Slight warm tint */
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.sharia-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.sharia-scholars {
    margin-top: 2rem;
    display: grid;
    gap: 1.5rem;
}

.scholar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.scholar-item i {
    font-size: 2rem;
    color: var(--second-color);
}

.scholar-item h4 {
    color: var(--title-color);
    margin-bottom: 0.25rem;
}

.sharia-badge {
    display: flex;
    justify-content: center;
    align-items: center;
}

.badge-content {
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    width: 200px;
    height: 200px;
    border: 4px solid var(--second-color);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--second-color);
    position: relative;
}

.badge-content i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.badge-content span {
    font-weight: var(--font-bold);
    font-size: 1.25rem;
}

/* =============== WHATSAPP BUTTON =============== */
.whatsapp-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background-color: #25D366;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: var(--z-fixed);
    font-weight: var(--font-bold);
    transition: .3s;
}

.whatsapp-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(37, 211, 102, 0.5);
}

.whatsapp-btn i {
    font-size: 1.5rem;
}

@media screen and (max-width: 968px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }

    .sharia-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .sharia-text .section-title {
        text-align: center !important;
    }
}

@media screen and (max-width: 767px) {
    .claims-container {
        flex-direction: column;
        gap: 2rem;
    }

    .step-line {
        width: 2px;
        height: 30px;
        margin: 0.5rem 0;
    }
}