/* ==========================================================================
   الفقيه السوسي - Design System & Stylesheet
   Luxury Dark Emerald & Gold Theme matching exact design reference
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Google Fonts Import & CSS Tokens
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@400;600;700;800&family=Almarai:wght@400;700;800&family=Cairo:wght@400;600;700;800;900&family=El+Messiri:wght@500;600;700&family=Kufam:wght@500;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    /* Theme Color Palette */
    --bg-dark: #041712;
    --bg-surface: #07251e;
    --bg-card: rgba(10, 45, 36, 0.65);
    
    --green-emerald: #0b3d32;
    --green-glow: #10b981;
    --green-whatsapp: #22c55e;
    --green-whatsapp-hover: #16a34a;
    
    --gold-primary: #d4af37;
    --gold-light: #f3e5ab;
    --gold-accent: #e2c475;
    --gold-border: rgba(226, 196, 117, 0.3);
    
    --text-white: #ffffff;
    --text-body: #c8e6da;
    --text-muted: #82ab9c;
    
    /* Luxury Arabic Typography Stack */
    --font-title: 'Cairo', 'Alexandria', 'Almarai', sans-serif;
    --font-heading: 'Cairo', 'Alexandria', 'Almarai', sans-serif;
    --font-body: 'Tajawal', 'Cairo', sans-serif;
    
    /* Layout & Utilities */
    --container-max: 1200px;
    --header-height: 90px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
    
    --shadow-wa: 0 0 25px rgba(34, 197, 94, 0.45);
    --shadow-card: 0 15px 35px rgba(0, 0, 0, 0.3);
    --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-body);
    font-family: var(--font-body);
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Radial Glow & Background Pattern Overlay */
.glow-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    max-width: 1000px;
    max-height: 800px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(7, 37, 30, 0.05) 50%, transparent 80%);
    pointer-events: none;
    z-index: -2;
    filter: blur(60px);
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath fill='none' stroke='%23e2c475' stroke-width='0.8' d='M40 0 L50 15 L65 15 L65 30 L80 40 L65 50 L65 65 L50 65 L40 80 L30 65 L15 65 L15 50 L0 40 L15 30 L15 15 L30 15 Z'/%3E%3Ccircle cx='40' cy='40' r='18' fill='none' stroke='%2310b981' stroke-width='0.6'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img, svg {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* --------------------------------------------------------------------------
   3. Container & Layout Utilities
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* --------------------------------------------------------------------------
   4. Site Header & Navigation
   -------------------------------------------------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(4, 23, 18, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 196, 117, 0.1);
    transition: var(--transition);
}

.header.scrolled {
    background: rgba(4, 23, 18, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-bottom-color: rgba(226, 196, 117, 0.25);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 1.5rem;
}

/* Header Left: Glowing WhatsApp Button */
.btn-whatsapp-header {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: var(--shadow-wa);
    transition: var(--transition);
}

.btn-whatsapp-header:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.65);
    background: linear-gradient(135deg, #25d366 0%, #15803d 100%);
}

.wa-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Header Center: Nav Links */
.nav-menu-wrapper {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.2rem;
    list-style: none;
}

.nav-link {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2f1eb;
    position: relative;
    padding: 0.4rem 0;
    letter-spacing: 0.2px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold-accent), var(--green-glow));
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold-accent);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Header Right: Site Brand & Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-align: right;
}

.logo-icon-emblem {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 14px rgba(212, 175, 55, 0.4));
    transition: var(--transition);
}

.site-logo:hover .logo-icon-emblem {
    transform: scale(1.08) rotate(4deg);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.78rem;
    color: var(--gold-accent);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Mobile Navigation Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    z-index: 1002;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--gold-accent);
    border-radius: 2px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --------------------------------------------------------------------------
   5. Hero Section (Matching Image Design Exactly)
   -------------------------------------------------------------------------- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 5rem;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 920px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Badge Pill */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(10, 45, 36, 0.7);
    border: 1px solid rgba(226, 196, 117, 0.35);
    padding: 0.45rem 1.4rem;
    border-radius: var(--radius-pill);
    color: var(--gold-accent);
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    font-weight: 600;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
}

.star-icon {
    color: var(--gold-primary);
    font-size: 0.9rem;
}

/* Luxury Islamic Title Frame Around 'الفقيه السوسي' */
.islamic-title-frame {
    position: relative;
    padding: 1.2rem 3.8rem;
    margin-bottom: 1.2rem;
    background: rgba(6, 30, 24, 0.72);
    border: 1.5px solid rgba(226, 196, 117, 0.45);
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45), 
                inset 0 0 30px rgba(212, 175, 55, 0.1),
                0 0 35px rgba(212, 175, 55, 0.15);
    backdrop-filter: blur(14px);
    display: inline-block;
}

.islamic-title-frame::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px dashed rgba(226, 196, 117, 0.3);
    border-radius: calc(var(--radius-lg) - 4px);
    pointer-events: none;
}

.frame-corner {
    position: absolute;
    color: var(--gold-accent);
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.9;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

.frame-corner.top-right { top: 8px; right: 12px; }
.frame-corner.top-left { top: 8px; left: 12px; }
.frame-corner.bottom-right { bottom: 8px; right: 12px; }
.frame-corner.bottom-left { bottom: 8px; left: 12px; }

/* Main Title */
.hero-title {
    font-family: var(--font-title);
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 0;
    letter-spacing: -0.5px;
}

.title-white {
    color: #ffffff;
    text-shadow: 0 4px 25px rgba(255, 255, 255, 0.15);
}

.title-gold {
    color: var(--gold-accent);
    background: linear-gradient(180deg, #f5e4b3 0%, #d4af37 60%, #aa771c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 30px rgba(212, 175, 55, 0.25);
}

/* Subtitle */
.hero-subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 2.2vw, 1.6rem);
    font-weight: 800;
    color: var(--gold-accent);
    margin-bottom: 1.4rem;
    letter-spacing: 0.2px;
}

/* Main Description Paragraph */
.hero-description {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    line-height: 2.0;
    color: var(--text-body);
    max-width: 780px;
    margin-bottom: 2.2rem;
    font-weight: 500;
}

/* Hero CTA Button */
.hero-cta-wrapper {
    display: flex;
    justify-content: center;
}

.btn-whatsapp-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    padding: 0.85rem 2.2rem;
    border-radius: var(--radius-pill);
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 0 35px rgba(34, 197, 94, 0.5);
    transition: var(--transition);
}

.btn-whatsapp-hero:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 0 45px rgba(34, 197, 94, 0.75);
    background: linear-gradient(135deg, #25d366 0%, #15803d 100%);
}

.btn-whatsapp-hero .wa-icon {
    width: 24px;
    height: 24px;
}

/* --------------------------------------------------------------------------
   6. Sections General Styling
   -------------------------------------------------------------------------- */
.section {
    padding: 6rem 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    color: var(--gold-accent);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.8rem;
}

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.section-divider .line {
    width: 70px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-accent), transparent);
}

.section-divider .star {
    color: var(--gold-accent);
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   7. Services Section (الخدمات)
   -------------------------------------------------------------------------- */
.services-section {
    background: rgba(7, 37, 30, 0.3);
    border-top: 1px solid rgba(226, 196, 117, 0.08);
    border-bottom: 1px solid rgba(226, 196, 117, 0.08);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 2.8rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--gold-accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(226, 196, 117, 0.15);
}

.service-icon {
    width: 65px;
    height: 65px;
    margin: 0 auto 1.5rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-accent);
}

.service-icon svg {
    width: 30px;
    height: 30px;
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 1.05rem;
    color: var(--text-body);
    line-height: 1.8;
}

/* --------------------------------------------------------------------------
   8. About Section (من نحن)
   -------------------------------------------------------------------------- */
.about-card {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 3.5rem 3rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
}

.about-text {
    font-size: 1.25rem;
    line-height: 2.1;
    color: var(--text-body);
    margin-bottom: 1.5rem;
}

.about-text:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   9. Why Us Section (لماذا نحن؟)
   -------------------------------------------------------------------------- */
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.why-card {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.8rem;
    position: relative;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.why-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold-accent);
}

.why-number {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    color: rgba(226, 196, 117, 0.25);
    margin-bottom: 1rem;
}

.why-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.8rem;
}

.why-card p {
    font-size: 1rem;
    color: var(--text-body);
    line-height: 1.7;
}

/* --------------------------------------------------------------------------
   10. Contact Section & Card
   -------------------------------------------------------------------------- */
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 4rem 2.5rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow-card);
}

.contact-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
}

.contact-icon svg {
    width: 34px;
    height: 34px;
}

.contact-card h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1rem;
}

.contact-card p {
    font-size: 1.15rem;
    color: var(--text-body);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.9;
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: #03100c;
    border-top: 1px solid rgba(226, 196, 117, 0.15);
    padding: 3.5rem 0;
    text-align: center;
    margin-top: auto;
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-size: 0.95rem;
    color: var(--gold-accent);
    margin-bottom: 1.5rem;
}

.footer-divider {
    width: 70px;
    height: 1px;
    background: rgba(226, 196, 117, 0.3);
    margin: 0 auto 1.5rem;
}

.footer-rights {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   12. Floating WhatsApp Button (Bottom Right)
   -------------------------------------------------------------------------- */
.floating-wa-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 58px;
    height: 58px;
    background: #25d366;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
    z-index: 998;
    transition: var(--transition);
    animation: waPulse 2.5s infinite;
}

.floating-wa-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 8px 35px rgba(37, 211, 102, 0.85);
}

.floating-wa-btn svg {
    width: 32px;
    height: 32px;
}

@keyframes waPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* --------------------------------------------------------------------------
   13. Entrance Animations & Responsive Design
   -------------------------------------------------------------------------- */
.animate-fade {
    animation: fadeIn 1s ease forwards;
}

.animate-up {
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-up-delay-1 {
    animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-up-delay-2 {
    animation: fadeInUp 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-up-delay-3 {
    animation: fadeInUp 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu-wrapper {
        position: fixed;
        top: 0;
        right: -320px;
        width: 290px;
        height: 100vh;
        background: #041712;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
        border-left: 1px solid var(--gold-border);
        flex-direction: column;
        justify-content: center;
        padding: 3rem 2rem;
        z-index: 1001;
        transition: right var(--transition);
    }

    .nav-menu-wrapper.active {
        right: 0;
    }

    .nav-menu {
        flex-direction: column;
        gap: 2rem;
        width: 100%;
        text-align: center;
    }

    .nav-link {
        font-size: 1.25rem;
    }

    .btn-whatsapp-header {
        padding: 0.5rem 1.1rem;
        font-size: 0.85rem;
    }

    .about-card {
        padding: 2.5rem 1.5rem;
    }
}

@media (max-width: 576px) {
    :root {
        --header-height: 78px;
    }

    .site-logo {
        gap: 0.6rem;
    }

    .logo-icon-circle {
        width: 38px;
        height: 38px;
    }

    .logo-icon-circle svg {
        width: 18px;
        height: 18px;
    }

    .islamic-title-frame {
        padding: 0.8rem 1.8rem;
    }

    .brand-title {
        font-size: 1.15rem;
    }

    .brand-sub {
        font-size: 0.7rem;
    }

    .btn-whatsapp-header span {
        display: none;
    }

    .btn-whatsapp-header {
        padding: 0.55rem;
        border-radius: 50%;
    }

    .btn-whatsapp-hero {
        padding: 0.95rem 2rem;
        font-size: 1.05rem;
        width: 100%;
    }

    .hero-badge {
        padding: 0.4rem 1rem;
    }

    .floating-wa-btn {
        bottom: 1.2rem;
        right: 1.2rem;
        width: 50px;
        height: 50px;
    }

    .floating-wa-btn svg {
        width: 28px;
        height: 28px;
    }
}
