/* 
 * MAA Ecosystem v5.0 - Ultimate Premium Executive Aesthetics
 * Inspired by modern financial & legal SaaS and Enterprise designs.
 */

:root {
    --maa-navy: #0F172A;
    /* Slate 900 - Premium Dark */
    --maa-gold: #B4905A;
    /* Muted Luxury Gold */
    --maa-gold-light: #d8b783;
    --maa-bg: #F8FAFC;
    /* Slate 50 - Sleek Light */
    --maa-white: #FFFFFF;
    --maa-text: #334155;
    /* Slate 700 */
    --maa-shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.05);
    --maa-shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.1);
    --maa-glass: rgba(255, 255, 255, 0.85);
    --maa-glass-dark: rgba(15, 23, 42, 0.9);
    --maa-transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

body.maa-body-override,
.maa-ecosystem {
    font-family: 'Cairo', sans-serif !important;
    color: var(--maa-text);
    background-color: var(--maa-bg) !important;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
    line-height: 1.8;
}

/* ============================================================ */
/* FONTAWESOME 6 SCOPE */
/* ============================================================ */
.maa-ecosystem i[class*="fa-"],
.maa-ecosystem .fas,
.maa-ecosystem .far,
.maa-ecosystem .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free", "FontAwesome" !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.maa-ecosystem .fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400;
}

.maa-ecosystem .fas,
.maa-ecosystem i.fas {
    font-weight: 900;
}


/* ============================================================ */
/* HEADER (ULTRA PREMIUM) */
/* ============================================================ */

.maa-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    background: var(--maa-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    padding: 15px 0;
    transition: var(--maa-transition);
}

/* Global Section Spacing to prevent Header Overlap */
.maa-ecosystem section {
    position: relative;
    padding-top: 100px;
}

.maa-ecosystem section.maa-hero {
    padding-top: 0;
    /* Hero calculates its own height */
}

/* Standard Section Style used across templates */
.maa-standard-section {
    padding: 120px 0 60px;
    background: var(--maa-bg);
}

.maa-header.scrolled {
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.maa-logo-img {
    height: 50px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: var(--maa-transition);
}

.scrolled .maa-logo-img {
    height: 40px;
}

.maa-logo-placeholder {
    width: 50px;
    height: 50px;
    background: var(--maa-navy);
    color: var(--maa-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
}

.nav-link-maa {
    color: var(--maa-navy);
    font-weight: 700;
    font-size: 1rem;
    padding: 10px 18px;
    text-decoration: none;
    transition: var(--maa-transition);
    position: relative;
    border-radius: 30px;
}

.nav-link-maa:hover,
.nav-link-maa.active {
    color: var(--maa-gold);
    background: rgba(180, 144, 90, 0.05);
}

/* BUTTONS */
.btn-maa-primary {
    background: var(--maa-navy);
    color: var(--maa-white);
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--maa-transition);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

.btn-maa-primary:hover {
    background: var(--maa-gold);
    color: var(--maa-navy);
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(180, 144, 90, 0.3);
}

.btn-maa-outline {
    background: transparent;
    color: var(--maa-white);
    border: 2px solid var(--maa-gold);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--maa-transition);
}

.btn-maa-outline:hover {
    background: var(--maa-gold);
    color: var(--maa-navy);
}

/* ============================================================ */
/* HERO SECTION */
/* ============================================================ */

.maa-hero {
    height: 90vh;
    min-height: 600px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-radius: 0 0 50px 50px;
}

.maa-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 1;
    transform: scale(1.05);
}

.maa-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 100%);
    z-index: 2;
}

.maa-hero-content {
    position: relative;
    z-index: 5;
}

.maa-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.2;
    color: white;
    margin-bottom: 25px;
}

/* ============================================================ */
/* PREMIUM CARDS */
/* ============================================================ */

.maa-premium-card {
    background: var(--maa-white);
    border-radius: 30px;
    padding: 40px;
    box-shadow: var(--maa-shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: var(--maa-transition);
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.maa-premium-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--maa-gold), var(--maa-navy));
    opacity: 0;
    transition: var(--maa-transition);
    z-index: -1;
}

.maa-premium-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--maa-shadow-lg);
}

.maa-premium-card:hover::after {
    opacity: 1;
}

.maa-icon-wrapper {
    width: 70px;
    height: 70px;
    background: rgba(180, 144, 90, 0.1);
    color: var(--maa-gold);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 30px;
    transition: var(--maa-transition);
}

.maa-premium-card:hover .maa-icon-wrapper {
    background: var(--maa-navy);
    color: var(--maa-gold);
    border-radius: 50%;
    transform: rotateY(180deg);
}

/* ============================================================ */
/* AI ASSISTANT (WIDGET - APP STYLE) */
/* ============================================================ */

.maa-ai-launcher {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: var(--maa-navy);
    color: var(--maa-gold);
    border-radius: 25px;
    border: 2px solid var(--maa-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    cursor: pointer;
    z-index: 100000;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.4);
    transition: var(--maa-transition);
}

.maa-ai-launcher:hover {
    transform: translateY(-5px) scale(1.05);
    background: var(--maa-gold);
    color: var(--maa-navy);
    border-color: var(--maa-navy);
}

.maa-ai-panel {
    position: fixed;
    bottom: 110px;
    right: 110px;
    width: 380px;
    height: 600px;
    background: var(--maa-white);
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    z-index: 100000;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: bottom right;
}

.maa-ai-panel.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.maa-ai-header {
    background: var(--maa-navy);
    padding: 25px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--maa-gold);
}

.maa-ai-chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #fdfdfd;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.maa-chat-msg {
    max-width: 85%;
    padding: 15px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
}

.maa-chat-msg.bot {
    align-self: flex-start;
    background: #F1F5F9;
    color: var(--maa-navy);
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.maa-chat-msg.user {
    align-self: flex-end;
    background: var(--maa-navy);
    color: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.2);
}

.maa-ai-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.maa-ai-input-area input {
    flex: 1;
    border: 1px solid #E2E8F0;
    padding: 15px 20px;
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: 0.3s;
}

.maa-ai-input-area input:focus {
    border-color: var(--maa-gold);
    box-shadow: 0 0 0 4px rgba(180, 144, 90, 0.1);
}

.maa-ai-input-area button {
    width: 50px;
    height: 50px;
    background: var(--maa-gold);
    color: var(--maa-navy);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maa-ai-input-area button:hover {
    background: var(--maa-navy);
    color: var(--maa-gold);
    transform: rotate(-45deg);
}

/* ============================================================ */
/* MOBILE APP BOTTOM NAV */
/* ============================================================ */

.maa-mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--maa-white);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
    z-index: 99999;
    border-top: 1px solid #f1f5f9;
    padding: 12px 10px 20px;
    border-radius: 30px 30px 0 0;
}

.maa-mobile-nav .nav-item {
    flex: 1;
    text-align: center;
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.maa-mobile-nav .nav-item i {
    font-size: 1.4rem;
}

.maa-mobile-nav .nav-item.active {
    color: var(--maa-navy);
    transform: translateY(-5px);
}

.maa-mobile-nav .nav-item.active i {
    color: var(--maa-gold);
}

/* FORMS */
.maa-form-control {
    width: 100%;
    padding: 18px 25px;
    border-radius: 20px;
    border: 2px solid #E2E8F0;
    background: #fff;
    transition: var(--maa-transition);
    font-family: inherit;
    font-size: 1rem;
    color: var(--maa-navy);
}

.maa-form-control:focus {
    border-color: var(--maa-gold);
    outline: none;
    box-shadow: 0 0 20px rgba(180, 144, 90, 0.1);
}

/* RESPONSIVE */
@media (max-width: 991px) {
    .maa-header {
        padding: 10px 0;
    }

    .maa-header.scrolled {
        padding: 5px 0;
    }

    .maa-title {
        font-size: 2.5rem;
    }

    .maa-standard-section {
        padding-top: 80px;
    }

    .maa-hero {
        border-radius: 0 0 30px 30px;
        height: 70vh;
        min-height: 500px;
    }

    .maa-mobile-nav {
        display: flex;
    }

    .maa-ai-panel {
        width: 100%;
        height: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
        position: fixed;
        z-index: 1000000;
    }

    .maa-ai-launcher {
        bottom: 90px;
        right: 20px;
        width: 65px;
        height: 65px;
        font-size: 1.8rem;
    }

    body.maa-body-override {
        padding-bottom: 90px;
    }

    /* Fixed Mobile Container width issue */
    .maa-ecosystem .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .maa-standard-section {
        padding-top: 90px !important;
    }

    /* Critical Fix for Squeezing/Padding Issues on Mobile */
    .maa-ecosystem .row {
        margin-left: -5px !important;
        margin-right: -5px !important;
    }

    .maa-ecosystem .col-12,
    .maa-ecosystem [class*="col-"] {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .maa-premium-card {
        padding: 30px 15px !important;
        margin-bottom: 20px;
    }

    /* Override padding for services content */
    .maa-premium-card .col-lg-5,
    .maa-premium-card .col-lg-7 {
        margin-bottom: 20px;
    }

    .maa-premium-card img {
        height: 250px !important;
        margin-bottom: 20px;
    }

    .maa-premium-card h2 {
        font-size: 1.4rem !important;
        line-height: 1.4;
    }

    .maa-premium-card p,
    .maa-premium-card ul li {
        font-size: 0.95rem !important;
        line-height: 1.6;
    }

    .maa-premium-card ul li i {
        font-size: 1rem !important;
        margin-top: 4px;
    }

    .maa-title {
        font-size: 2.2rem;
    }

    /* CTA Section on mobile */
    .maa-ecosystem .text-center.mt-5.py-5.px-4.rounded-4 {
        padding: 40px 15px !important;
        margin-top: 20px !important;
        border-radius: 25px !important;
    }

    .maa-ecosystem .text-center.mt-5.py-5.px-4.rounded-4 h2 {
        font-size: 1.6rem !important;
    }
}