/* ============================================================
   POTHIK — Main Dashboard Stylesheet
   Scoped to .md-dashboard wrapper only.
   Does NOT affect any other page.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Manrope:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
.md-dashboard {
    --primary:        #0F5D4A;
    --primary-hover:  #0D4F3F;
    --secondary:      #2E8B57;
    --bg-page:        #FFFFFF;
    --bg-surface:     #F9FAFB;
    --bg-surface-alt: #F3F4F6;
    --border:         #E5E7EB;
    --border-hover:   #D1D5DB;
    --text-head:      #111827;
    --text-body:      #374151;
    --text-muted:     #6B7280;
    --text-xmuted:    #9CA3AF;
    --green-light:    #ECFDF5;
    --green-mid:      #D1FAE5;
    --shadow-xs:      0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:      0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:      0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --radius-sm:      10px;
    --radius-md:      16px;
    --radius-lg:      20px;
    --radius-pill:    999px;
    --transition:     0.18s ease;
    --font-head:      'Manrope', 'Inter', -apple-system, sans-serif;
    --font-body:      'Inter', -apple-system, sans-serif;
    --max-w:          1280px;
}

/* ── Hard Reset for page ───────────────────────────────────── */
.md-dashboard *,
.md-dashboard *::before,
.md-dashboard *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Override the dark body background for this page */
body:has(.md-dashboard),
html:has(.md-dashboard) {
    background: #fff !important;
    color: #111827 !important;
}

body:has(.md-dashboard)::before,
body:has(.md-dashboard)::after {
    display: none !important;
}

.md-dashboard {
    font-family: var(--font-body);
    background: var(--bg-page);
    color: var(--text-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navbar ────────────────────────────────────────────────── */
.md-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.md-navbar__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 40px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.md-navbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    flex-shrink: 0;
}

.md-navbar__logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--green-light);
    padding: 4px;
}

.md-navbar__name {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 800;
    color: var(--primary) !important;
    letter-spacing: -0.4px;
    text-decoration: none !important;
    -webkit-text-fill-color: unset;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.md-navbar__links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.md-navbar__links a {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted) !important;
    text-decoration: none !important;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    transition: var(--transition);
    background: transparent;
    -webkit-text-fill-color: unset;
    background-image: none;
}

.md-navbar__links a:hover {
    color: var(--primary) !important;
    background: var(--green-light);
    border-color: var(--green-mid);
}

.md-navbar__links a.md-nav-cta {
    color: var(--primary) !important;
    border-color: var(--primary);
    background: var(--green-light);
}

.md-navbar__links a.md-nav-cta:hover {
    background: var(--primary);
    color: #fff !important;
}

/* ── Page Wrapper / Content ───────────────────────────────── */
.md-page {
    flex: 1;
    background: var(--bg-page);
}

.md-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Hero Section ──────────────────────────────────────────── */
.md-hero {
    padding: 80px 0 72px;
    background: var(--bg-page);
    overflow: hidden;
}

.md-hero__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 56px;
}

.md-hero__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.md-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px 5px 8px;
    border-radius: var(--radius-pill);
    background: var(--green-light);
    border: 1px solid var(--green-mid);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 22px;
    letter-spacing: 0.1px;
}

.md-hero__badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--secondary);
    flex-shrink: 0;
}

.md-hero__headline {
    font-family: var(--font-head);
    font-size: 52px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: var(--text-head);
    margin-bottom: 20px;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    animation: none;
}

.md-hero__headline span {
    color: var(--primary);
}

.md-hero__sub {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 36px;
    max-width: 480px;
}

.md-hero__ctas {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.1px;
    box-shadow: none;
    -webkit-text-fill-color: unset;
    background-image: none;
}

.md-btn-primary {
    background: var(--primary);
    color: #fff !important;
    border-color: var(--primary);
}

.md-btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: #fff !important;
}

.md-btn-secondary {
    background: #fff;
    color: var(--primary) !important;
    border-color: var(--primary);
}

.md-btn-secondary:hover {
    background: var(--green-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    color: var(--primary) !important;
}

.md-btn-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* Hero image */
.md-hero__image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.md-hero__image-frame {
    position: relative;
    z-index: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    width: 100%;
    aspect-ratio: 3/2;
    background: var(--bg-surface);
}

.md-hero__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform: scale(1.05);
    transform-origin: center center;
    transition: transform 0.3s ease;
}

/* Decorative dot grids */
.md-hero__image-wrap::before {
    content: '';
    position: absolute;
    top: -16px;
    right: -16px;
    width: 120px;
    height: 120px;
    background-image: radial-gradient(circle, var(--border) 1.5px, transparent 1.5px);
    background-size: 14px 14px;
    border-radius: 8px;
    z-index: 0;
    opacity: 0.6;
}

.md-hero__image-wrap::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: -16px;
    width: 80px;
    height: 80px;
    background-image: radial-gradient(circle, var(--border) 1.5px, transparent 1.5px);
    background-size: 14px 14px;
    border-radius: 8px;
    z-index: 0;
    opacity: 0.6;
}

/* ── Section Header ─────────────────────────────────────────── */
.md-section {
    padding: 72px 0;
}

.md-section + .md-section {
    padding-top: 0;
}

.md-section__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin-bottom: 10px;
}

.md-section__title {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 800;
    color: var(--text-head);
    letter-spacing: -0.8px;
    margin-bottom: 10px;
    line-height: 1.2;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    animation: none;
    text-align: left;
}

.md-section__sub {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 520px;
}

/* ── Quran Ayah ─────────────────────────────────────────────── */
.md-ayah-wrap {
    background: var(--bg-surface);
    padding: 48px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.md-ayah {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    padding: 0 24px;
}

.md-ayah__ar {
    font-size: 22px;
    line-height: 2;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: 0.2px;
    direction: rtl;
}

.md-ayah__en {
    font-size: 15px;
    color: var(--text-body);
    line-height: 1.75;
    margin-bottom: 14px;
}

.md-ayah__ref {
    font-size: 11px;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* ── Services Grid ──────────────────────────────────────────── */
.md-services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* ── Service Card ───────────────────────────────────────────── */
.md-service-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 28px 28px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-decoration: none !important;
    color: var(--text-body) !important;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    -webkit-text-fill-color: unset;
    background-image: none;
}

.md-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s ease;
}

.md-service-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    color: var(--text-body) !important;
}

.md-service-card:hover::before {
    transform: scaleX(1);
}

.md-service-card__icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: var(--green-light);
    border: 1px solid var(--green-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 20px;
    flex-shrink: 0;
    transition: var(--transition);
}

.md-service-card:hover .md-service-card__icon-wrap {
    background: var(--primary);
    border-color: var(--primary);
}

.md-service-card__title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-head);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.md-service-card__desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 22px;
}

.md-service-card__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary) !important;
    text-decoration: none !important;
    letter-spacing: 0.1px;
    -webkit-text-fill-color: unset;
}

.md-service-card__link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.18s ease;
}

.md-service-card:hover .md-service-card__link svg {
    transform: translateX(3px);
}

/* ── Footer ─────────────────────────────────────────────────── */
.md-dashboard .site-footer {
    background: var(--bg-surface) !important;
    border-top: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    font-size: 13px;
    text-align: center;
    padding: 24px 40px;
}

.md-dashboard .site-footer p {
    color: var(--text-muted) !important;
    margin: 3px 0;
}

/* ── Floating AI Widget override for white page ─────────────── */
.md-dashboard .floating-ai-widget {
    background: var(--primary) !important;
    border-color: var(--secondary) !important;
    box-shadow: 0 8px 24px rgba(15,93,74,0.25), 0 2px 6px rgba(0,0,0,0.1) !important;
}

.md-dashboard .floating-ai-widget:hover {
    background: var(--primary-hover) !important;
    box-shadow: 0 12px 32px rgba(15,93,74,0.35) !important;
}

.md-dashboard .ai-glow-ring {
    border-color: rgba(15,93,74,0.35) !important;
}

.md-dashboard .ai-widget-badge {
    background: var(--secondary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

.md-dashboard .ai-widget-tooltip {
    background: #fff !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
}

.md-dashboard .ai-widget-tooltip::after {
    background: #fff !important;
    border-color: var(--border) !important;
}

.md-dashboard .ai-widget-tooltip strong {
    color: var(--primary) !important;
}

.md-dashboard .ai-widget-tooltip span {
    color: var(--text-muted) !important;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .md-services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .md-navbar__inner {
        padding: 0 28px;
    }

    .md-container {
        padding: 0 28px;
    }

    .md-hero {
        padding: 60px 0 56px;
    }

    .md-hero__grid {
        gap: 40px;
    }

    .md-hero__headline {
        font-size: 42px;
    }

    .md-services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .md-navbar__inner {
        padding: 0 20px;
        height: 60px;
    }

    .md-container {
        padding: 0 20px;
    }

    .md-hero {
        padding: 48px 0 44px;
    }

    .md-hero__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .md-hero__image-wrap {
        order: -1;
    }

    .md-hero__headline {
        font-size: 36px;
        letter-spacing: -1px;
    }

    .md-hero__sub {
        font-size: 16px;
    }

    .md-section {
        padding: 52px 0;
    }

    .md-section__title {
        font-size: 26px;
    }

    .md-services-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .md-hero__image-wrap::before,
    .md-hero__image-wrap::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .md-navbar__name {
        font-size: 17px;
    }

    .md-navbar__links a {
        padding: 6px 11px;
        font-size: 13px;
    }

    .md-hero__headline {
        font-size: 30px;
        letter-spacing: -0.8px;
    }

    .md-hero__sub {
        font-size: 15px;
    }

    .md-btn {
        padding: 12px 22px;
        font-size: 14px;
    }

    .md-hero__ctas {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .md-hero__ctas .md-btn {
        justify-content: center;
        width: 100%;
    }

    .md-section {
        padding: 40px 0;
    }

    .md-service-card {
        padding: 24px 20px 22px;
    }

    .md-ayah__ar {
        font-size: 19px;
    }

    .md-ayah__en {
        font-size: 14px;
    }
}
