/* ============================================
   شركة البستنجي للحلول البرمجية والتدريب — Company Profile
   ============================================ */

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

:root {
    --primary: #4B0F87;
    --primary-dark: #2E0656;
    --primary-light: #6D2BA8;
    --accent: #D4AF37;
    --accent-light: #F4D75E;
    --bg-soft: #F6F0FB;
    --bg-page: #FFFFFF;
    --text-dark: #1A1A2E;
    --text-mid: #4A4A68;
    --text-light: #8A8AA8;
    --border: #E8E2EF;
    --gradient: linear-gradient(135deg, #4B0F87 0%, #6D2BA8 60%, #8B4EC9 100%);
    --gradient-soft: linear-gradient(135deg, #F6F0FB 0%, #FFFFFF 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

html, body {
    background: #E5E5E5;
    font-family: 'Cairo', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* ============ Page Setup ============ */
.page {
    width: 210mm;
    height: 297mm;
    margin: 12mm auto;
    background: var(--bg-page);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    page-break-after: always;
    page-break-inside: avoid;
    break-after: page;
    break-inside: avoid;
}

.page-content {
    padding: 16mm 14mm;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    overflow: hidden;
    box-sizing: border-box;
}

.page-number {
    position: absolute;
    bottom: 8mm;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Cairo', sans-serif;
    font-size: 10pt;
    color: var(--text-light);
    z-index: 3;
}

.page-footer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6mm;
    background: var(--gradient);
    z-index: 1;
}

/* ============ Cover Page ============ */
.cover {
    background: var(--gradient);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 25mm 22mm 30mm;
    box-sizing: border-box;
}

.cover .cover-logo-wrap {
    margin-bottom: 22px;
}

.cover h1.brand-title-primary {
    margin-bottom: 10px;
}

.cover .tagline-divider {
    margin: 16px 0;
}

.cover::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.cover::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212,175,55,0.12) 0%, transparent 70%);
    border-radius: 50%;
}

.cover-logo-wrap {
    width: 200px;
    height: 200px;
    background: white;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

.cover-logo-wrap img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.cover h1.brand-title-primary {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 22pt;
    line-height: 1.35;
    max-width: 88%;
    margin: 0 auto 14px;
    z-index: 2;
}

.cover p.brand-sub-en {
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 12pt;
    letter-spacing: 1px;
    margin-bottom: 28px;
    opacity: 0.92;
    z-index: 2;
}

.cover .tagline-divider {
    width: 80px;
    height: 3px;
    background: var(--accent);
    margin: 20px 0;
    z-index: 2;
}

.cover .tagline-en {
    font-family: 'Cairo', sans-serif;
    font-weight: 400;
    font-size: 13pt;
    letter-spacing: 1.5px;
    text-transform: none;
    opacity: 0.9;
    margin-bottom: 6px;
    z-index: 2;
}

.cover .tagline-ar {
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 17pt;
    opacity: 0.95;
    z-index: 2;
}

.cover-footer {
    position: absolute;
    bottom: 22mm;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
}

.cover-footer .label {
    font-family: 'Cairo', sans-serif;
    font-size: 10pt;
    letter-spacing: 4px;
    opacity: 0.7;
    text-transform: uppercase;
}

/* ============ Common Section Headings ============ */
.section-header {
    margin-bottom: 16px;
    position: relative;
}

.section-tag {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--primary);
    padding: 5px 14px;
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 9pt;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.section-title-ar {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 24pt;
    color: var(--primary);
    line-height: 1.1;
    margin-bottom: 2px;
}

.section-title-en {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 14pt;
    color: var(--text-light);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.section-divider {
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 8px 0 14px;
    border-radius: 2px;
}

/* ============ Header Strip (Top of inner pages) ============ */
.page-header-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-soft);
    margin-bottom: 25px;
}

.page-header-strip .mini-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header-strip .mini-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.page-header-strip .mini-logo span.mini-brand-name {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 8.5pt;
    line-height: 1.2;
    max-width: 52mm;
    color: var(--primary);
    text-align: right;
    direction: rtl;
}

.contact-page .mini-logo span.mini-brand-name {
    color: #ffffff;
}

.page-header-strip .page-name {
    font-family: 'Cairo', sans-serif;
    font-size: 9pt;
    color: var(--text-light);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ============ Two Column Bilingual Layout ============ */
.bilingual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 15px;
}

.col-ar {
    direction: rtl;
    font-family: 'Cairo', sans-serif;
    text-align: right;
}

.col-en {
    direction: ltr;
    font-family: 'Cairo', sans-serif;
    text-align: left;
}

.col-ar h3, .col-en h3 {
    font-weight: 700;
    font-size: 14pt;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg-soft);
}

.col-ar p, .col-en p {
    font-size: 11pt;
    line-height: 1.8;
    color: var(--text-mid);
    margin-bottom: 12px;
}

/* ============ Table of Contents ============ */
.toc-list {
    list-style: none;
    margin-top: 30px;
}

.toc-list li {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border);
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

.toc-num {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 12pt;
    margin-left: 16px;
    flex-shrink: 0;
}

.toc-title {
    flex: 1;
}

.toc-title-ar {
    font-weight: 700;
    font-size: 13pt;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.toc-title-en {
    font-family: 'Cairo', sans-serif;
    font-weight: 400;
    font-size: 9pt;
    color: var(--text-light);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    direction: ltr;
    text-align: right;
}

.toc-page {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    color: var(--primary);
    font-size: 12pt;
}

/* ============ CEO Message ============ */
.ceo-quote {
    background: var(--bg-soft);
    padding: 25px 30px;
    border-radius: 12px;
    position: relative;
    margin-bottom: 25px;
    border-right: 5px solid var(--primary);
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

.ceo-quote::before {
    content: '“';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 80pt;
    color: var(--primary);
    opacity: 0.15;
    font-family: serif;
    line-height: 1;
}

.ceo-quote p {
    font-size: 11pt;
    line-height: 1.9;
    color: var(--text-mid);
    margin-bottom: 12px;
    text-align: justify;
}

.ceo-signature {
    margin-top: 30px;
    text-align: left;
    direction: ltr;
}

.ceo-signature .name {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 16pt;
    color: var(--primary);
}

.ceo-signature .title {
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 11pt;
    color: var(--text-mid);
}

/* ============ Values / Cards Grid ============ */
.values-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.value-card {
    background: white;
    border: 1.5px solid var(--bg-soft);
    border-radius: 12px;
    padding: 12px 11px 14px;
    text-align: center;
}

.value-card .value-icon {
    width: 38px;
    height: 38px;
    background: var(--gradient);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    color: white;
    font-size: 16pt;
    font-weight: bold;
}

.value-card h4 {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 11.5pt;
    color: var(--primary);
    margin-bottom: 2px;
    line-height: 1.2;
}

.value-card .value-en {
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 7.5pt;
    color: var(--text-light);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.value-card p {
    font-family: 'Cairo', sans-serif;
    font-size: 8.5pt;
    color: var(--text-mid);
    line-height: 1.45;
    direction: rtl;
}

/* ============ Vision / Mission Boxes ============ */
.vm-box {
    background: white;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 10px;
    border-right: 4px solid var(--primary);
    box-shadow: 0 3px 10px rgba(75, 15, 135, 0.05);
    direction: rtl;
}

.vm-box.accent {
    border-right-color: var(--accent);
}

.vm-box h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.vm-box h3 .vm-ar {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 15pt;
    color: var(--primary);
}

.vm-box h3 .vm-en {
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 9pt;
    color: var(--text-light);
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-right: auto;
    direction: ltr;
}

.vm-box p {
    font-family: 'Cairo', sans-serif;
    font-size: 10.5pt;
    color: var(--text-mid);
    line-height: 1.75;
    text-align: justify;
}

/* ============ Services Grid ============ */
.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.service-card {
    background: white;
    border: 1.5px solid var(--bg-soft);
    border-radius: 12px;
    padding: 11px 14px 12px;
    direction: rtl;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 36px 1fr;
    column-gap: 10px;
    align-items: start;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: var(--gradient);
}

.service-card .service-icon {
    grid-row: 1 / span 2;
    width: 36px;
    height: 36px;
    background: var(--bg-soft);
    color: var(--primary);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 14pt;
    font-weight: bold;
}

.service-card h4 {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 11.5pt;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.2;
    align-self: center;
}

.service-card .service-en {
    display: none;
}

.service-card p {
    grid-column: 1 / -1;
    font-family: 'Cairo', sans-serif;
    font-size: 9pt;
    color: var(--text-mid);
    line-height: 1.5;
    margin-top: 6px;
}

/* ============ Why Choose Us ============ */
.why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 15px;
}

.why-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--bg-soft);
    border-radius: 12px;
    direction: rtl;
}

.why-item .why-num {
    width: 44px;
    height: 44px;
    background: var(--gradient);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 16pt;
    flex-shrink: 0;
}

.why-item h4 {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 12pt;
    color: var(--primary);
    margin-bottom: 2px;
}

.why-item .why-en {
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 8pt;
    color: var(--text-light);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.why-item p {
    font-family: 'Cairo', sans-serif;
    font-size: 9.5pt;
    color: var(--text-mid);
    line-height: 1.55;
}

/* ============ Process / Methodology ============ */
.process-line {
    position: relative;
    padding: 30px 0;
}

.process-step {
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
    direction: rtl;
}

.process-step .step-circle {
    width: 56px;
    height: 56px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 18pt;
    color: var(--primary);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.process-step .step-body {
    flex: 1;
    padding-top: 6px;
}

.process-step .step-body h4 {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 14pt;
    color: var(--primary);
    margin-bottom: 4px;
}

.process-step .step-body .step-en {
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 9pt;
    color: var(--text-light);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.process-step .step-body p {
    font-family: 'Cairo', sans-serif;
    font-size: 10.5pt;
    color: var(--text-mid);
    line-height: 1.7;
}

/* ============ Portfolio ============ */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.project-card {
    background: white;
    border: 1.5px solid var(--bg-soft);
    border-radius: 12px;
    padding: 11px 14px 12px;
    direction: rtl;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.project-card .project-name {
    order: 1;
    width: 100%;
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 12.5pt;
    color: var(--primary);
    margin-bottom: 4px;
    direction: rtl;
    text-align: right;
    line-height: 1.3;
}

.project-card .project-tag {
    order: 2;
    display: inline-block;
    background: var(--gradient);
    color: white;
    padding: 2px 10px;
    border-radius: 18px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 6.5pt;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.project-card .project-name-en {
    display: none;
}

.project-card p {
    order: 3;
    width: 100%;
}

.project-card p {
    font-family: 'Cairo', sans-serif;
    font-size: 9pt;
    color: var(--text-mid);
    line-height: 1.5;
    margin-bottom: 0;
}

/* ============ Achievements / Numbers ============ */
.achievements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.achievement-card {
    background: var(--gradient);
    color: white;
    border-radius: 18px;
    padding: 28px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.achievement-card .ach-number {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 56pt;
    line-height: 1;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.achievement-card .ach-label-ar {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 14pt;
    margin-bottom: 2px;
    position: relative;
    z-index: 2;
}

.achievement-card .ach-label-en {
    font-family: 'Cairo', sans-serif;
    font-weight: 400;
    font-size: 9pt;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.85;
    position: relative;
    z-index: 2;
}

/* ============ Contact Page ============ */
.contact-page {
    background: var(--gradient);
    color: white;
}

.contact-page .page-content {
    color: white;
    padding: 22mm 18mm 65mm;
}

.contact-page .section-header {
    margin-bottom: 22px;
}

.contact-page .contact-grid {
    margin-top: 18px;
}

.contact-page .section-tag {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.contact-page .section-title-ar,
.contact-page .section-title-en {
    color: white;
}

.contact-page .section-divider {
    background: var(--accent);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 30px;
}

.contact-item {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: center;
    direction: rtl;
}

.contact-item .contact-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22pt;
    flex-shrink: 0;
}

.contact-item .contact-info {
    flex: 1;
}

.contact-item .contact-label {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 11pt;
    margin-bottom: 4px;
    opacity: 0.85;
}

.contact-item .contact-value {
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 11pt;
    direction: ltr;
    text-align: right;
    word-break: break-all;
}

.contact-footer {
    position: absolute;
    bottom: 24mm;
    left: 0;
    right: 0;
    text-align: center;
}

.contact-footer .thanks-ar {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 32pt;
    margin-bottom: 6px;
}

.contact-footer .thanks-en {
    font-family: 'Cairo', sans-serif;
    font-weight: 300;
    font-size: 14pt;
    letter-spacing: 6px;
    opacity: 0.85;
}

/* ============ Decorative Elements ============ */
.deco-circle-top-right {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 280px;
    height: 280px;
    background: var(--bg-soft);
    border-radius: 50%;
    z-index: 0;
    opacity: 0.6;
}

.deco-circle-bottom-left {
    position: absolute;
    bottom: -120px;
    left: -120px;
    width: 320px;
    height: 320px;
    background: linear-gradient(135deg, var(--bg-soft) 0%, transparent 100%);
    border-radius: 50%;
    z-index: 0;
    opacity: 0.7;
}

/* ============ Print Settings ============ */
@page {
    size: 210mm 297mm;
    margin: 0;
}

@media print {
    html, body {
        background: white;
        width: 210mm;
        height: 297mm;
        margin: 0;
        padding: 0;
    }
    .page {
        width: 210mm;
        height: 297mm;
        margin: 0;
        box-shadow: none;
        page-break-after: always;
        page-break-inside: avoid;
        break-after: page;
        break-inside: avoid;
        overflow: hidden;
    }
    .page:last-child {
        page-break-after: auto;
        break-after: auto;
    }
    .page-content {
        height: 297mm;
        overflow: hidden;
        box-sizing: border-box;
    }
    .no-print {
        display: none !important;
    }
}

/* ============ Helper / Top Bar ============ */
.print-helper {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 12pt;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(75, 15, 135, 0.4);
    z-index: 1000;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.print-helper:hover {
    background: var(--primary-dark);
    transform: translateX(-50%) translateY(-3px);
}
