/* =====================================
   1. الخطوط والألوان الأساسية
===================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
    --navy: #142d4e;
    --navy-light: #203f63;
    --teal: #36b9a5;
    --teal-light: #e8f8f5;
    --background: #f3f6fa;
    --white: #ffffff;
    --text: #27364a;
    --muted: #718096;
    --border: #e4eaf1;
    --shadow: 0 15px 45px rgba(20, 45, 78, 0.08);
}

/* =====================================
   2. الإعدادات العامة
===================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    direction: rtl;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.8;
    padding: 35px 16px;
    font-size: 13px;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font-family: inherit;
}

/* =====================================
   3. الحاوية الرئيسية
===================================== */

.resume {
    max-width: 920px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* =====================================
   4. رأس السيرة الذاتية
===================================== */

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        125deg,
        var(--navy) 0%,
        var(--navy-light) 100%
    );
    color: var(--white);
    padding: 38px 45px;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 24px;
}

.profile-icon {
    width: 92px;
    height: 92px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.09);
    color: var(--teal);
    font-size: 39px;
}

.eyebrow {
    color: var(--teal);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.identity h1 {
    font-size: 31px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 3px;
}

.identity h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
}

.specialization {
    color: #cbd8e8;
    font-size: 12px;
}

.hero-decoration {
    position: absolute;
    left: -35px;
    bottom: -65px;
    display: flex;
    gap: 12px;
    transform: rotate(35deg);
    opacity: 0.13;
}

.hero-decoration span {
    display: block;
    width: 55px;
    height: 230px;
    border: 2px solid var(--teal);
    border-radius: 30px;
}

/* =====================================
   5. المحتوى والأقسام
===================================== */

.content {
    padding: 30px 40px 20px;
}

.section {
    margin-bottom: 29px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 15px;
}

.section-heading h3 {
    color: var(--navy);
    font-size: 17px;
    font-weight: 700;
}

.section-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--teal-light);
    color: #178f80;
    font-size: 15px;
}

.about-text {
    padding-right: 15px;
    border-right: 3px solid var(--teal);
    color: #526174;
    font-size: 13px;
    line-height: 2.1;
    text-align: justify;
}

/* =====================================
   6. بطاقات المهارات
===================================== */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.skill-card {
    position: relative;
    padding: 16px 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.skill-card:hover {
    transform: translateY(-3px);
    border-color: var(--teal);
    box-shadow: 0 8px 20px rgba(20, 45, 78, 0.06);
}

.skill-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: var(--teal-light);
    color: #178f80;
    font-size: 11px;
    font-weight: 700;
    direction: ltr;
}

.skill-card h4 {
    margin-bottom: 5px;
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
}

.skill-card p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.9;
}

/* =====================================
   7. المشاريع
===================================== */

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.project-card {
    display: flex;
    align-items: stretch;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.project-marker {
    width: 4px;
    min-width: 4px;
    border-radius: 10px;
    background: var(--teal);
}

.project-content {
    flex: 1;
    min-width: 0;
}

.project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 7px;
}

.project-title-row h4 {
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
}

.project-type {
    flex-shrink: 0;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--teal-light);
    color: #168878;
    font-size: 10px;
    font-weight: 600;
}

.project-type.planned {
    background: #fff4df;
    color: #97681a;
}

.project-content > p {
    margin-bottom: 6px;
    color: #657386;
    font-size: 12px;
    line-height: 1.9;
}

.project-content ul {
    padding-right: 18px;
    color: #526174;
    font-size: 11px;
    line-height: 2;
}

.project-content li::marker {
    color: var(--teal);
}

/* =====================================
   8. التعليم
===================================== */

.education-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: linear-gradient(
        135deg,
        #ffffff,
        #f8fbfd
    );
}

.education-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--navy);
    color: var(--teal);
    font-size: 22px;
}

.education-content {
    flex: 1;
    min-width: 0;
}

.education-content h4 {
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.9;
}

.university {
    color: #344a64;
    font-weight: 600;
    font-size: 12px;
}

.study-mode {
    display: inline-block;
    margin-top: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    background: #eef2f8;
    color: #526174;
    font-size: 10px;
}

.education-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 18px;
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid var(--border);
}

.education-details div {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.9;
}

.education-details i {
    margin-top: 5px;
    color: #1c9f8d;
    flex-shrink: 0;
}

.education-details strong {
    color: var(--navy);
}

/* =====================================
   9. قسم التواصل وواتساب
===================================== */

.contact-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 23px;
    border-radius: 17px;
    background: #f0f8f7;
    border: 1px solid #dcefeb;
}

.contact-content {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.contact-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: var(--white);
    color: #178f80;
    font-size: 20px;
}

.contact-text h3 {
    color: var(--navy);
    font-size: 15px;
    font-weight: 700;
}

.contact-text > p {
    margin-top: 3px;
    color: #627387;
    font-size: 11px;
    line-height: 1.8;
}

.email {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow-wrap: anywhere;
}

.email i {
    color: #178f80;
}

.whatsapp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-shrink: 0;
    padding: 13px 18px;
    border-radius: 12px;
    background: #1fa968;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(31, 169, 104, 0.18);
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.whatsapp-button > i:first-child {
    font-size: 19px;
}

.whatsapp-button:hover {
    background: #188954;
    transform: translateY(-2px);
}

.arrow-icon {
    font-size: 11px;
}

/* =====================================
   10. التذييل
===================================== */

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 19px 40px;
    border-top: 1px solid var(--border);
    background: #fbfcfe;
}

.footer p {
    color: #8290a1;
    font-size: 10px;
    line-height: 1.8;
}

.footer p i {
    color: var(--teal);
    margin-left: 5px;
}

.print-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid #d8e1eb;
    border-radius: 9px;
    background: #fff;
    color: var(--navy);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.print-button:hover {
    background: #edf3f9;
}

/* =====================================
   11. الشاشات المتوسطة
===================================== */

@media (max-width: 760px) {

    body {
        padding: 18px 10px;
    }

    .resume {
        border-radius: 16px;
    }

    .hero {
        padding: 30px 24px;
    }

    .hero-content {
        gap: 16px;
    }

    .profile-icon {
        width: 72px;
        height: 72px;
        border-radius: 19px;
        font-size: 31px;
    }

    .identity h1 {
        font-size: 25px;
    }

    .identity h2 {
        font-size: 14px;
    }

    .content {
        padding: 25px 22px 18px;
    }

    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-section {
        align-items: flex-start;
        flex-direction: column;
    }

    .whatsapp-button {
        width: 100%;
    }

    .footer {
        padding: 18px 22px;
    }
}

/* =====================================
   12. الشاشات الصغيرة
===================================== */

@media (max-width: 420px) {

    body {
        padding: 8px;
        font-size: 12px;
    }

    .hero {
        padding: 25px 17px;
    }

    .hero-content {
        align-items: flex-start;
        gap: 12px;
    }

    .profile-icon {
        width: 52px;
        height: 52px;
        border-radius: 14px;
        font-size: 23px;
    }

    .identity h1 {
        font-size: 21px;
        overflow-wrap: anywhere;
    }

    .identity h2 {
        font-size: 12px;
    }

    .specialization {
        font-size: 10px;
    }

    .content {
        padding: 22px 14px 16px;
    }

    .section-heading h3 {
        font-size: 15px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .skill-card {
        padding: 13px;
    }

    .skill-card h4 {
        font-size: 12px;
    }

    .skill-card p {
        font-size: 11px;
    }

    .project-card {
        padding: 12px;
        gap: 10px;
    }

    .project-title-row {
        flex-direction: column;
        gap: 6px;
    }

    .project-title-row h4 {
        font-size: 12px;
    }

    .project-type {
        align-self: flex-start;
    }

    .education-card {
        padding: 13px;
        gap: 10px;
    }

    .education-symbol {
        width: 39px;
        height: 39px;
        font-size: 17px;
    }

    .education-content h4 {
        font-size: 12px;
    }

    .education-details {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .contact-section {
        padding: 16px 12px;
    }

    .contact-content {
        align-items: flex-start;
    }

    .contact-icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 16px 13px;
    }

    .print-button {
        width: 100%;
    }
}

/* =====================================
   13. إعدادات الطباعة وحفظ PDF
===================================== */

@page {
    size: A4;
    margin: 8mm;
}

@media print {

    html,
    body {
        width: 100%;
        margin: 0;
        padding: 0;
        background: #fff;
        font-size: 9pt;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .resume {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .hero {
        padding: 20px 25px;
    }

    .profile-icon {
        width: 65px;
        height: 65px;
        font-size: 28px;
    }

    .identity h1 {
        font-size: 24px;
    }

    .identity h2 {
        font-size: 13px;
    }

    .content {
        padding: 17px 24px 10px;
    }

    .section {
        margin-bottom: 17px;
        break-inside: avoid;
    }

    .section-heading {
        margin-bottom: 9px;
    }

    .section-heading h3 {
        font-size: 14px;
    }

    .section-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .about-text {
        font-size: 10px;
        line-height: 1.8;
    }

    .skills-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .skill-card {
        padding: 9px;
        break-inside: avoid;
    }

    .skill-card h4 {
        font-size: 10px;
    }

    .skill-card p {
        font-size: 9px;
        line-height: 1.6;
    }

    .skill-number {
        width: 22px;
        height: 22px;
        margin-bottom: 4px;
        font-size: 9px;
    }

    .projects-list {
        gap: 8px;
    }

    .project-card {
        padding: 10px;
        break-inside: avoid;
    }

    .project-title-row h4 {
        font-size: 10px;
    }

    .project-content > p,
    .project-content ul {
        font-size: 9px;
        line-height: 1.65;
    }

    .project-type {
        font-size: 8px;
        padding: 2px 6px;
    }

    .education-card {
        padding: 12px;
        break-inside: avoid;
    }

    .education-content h4 {
        font-size: 11px;
    }

    .education-details {
        gap: 5px 12px;
        margin-top: 9px;
        padding-top: 8px;
    }

    .education-details div {
        font-size: 9px;
    }

    .contact-section {
        margin-top: 15px;
        padding: 12px;
        flex-direction: row;
        break-inside: avoid;
    }

    .contact-text h3 {
        font-size: 12px;
    }

    .contact-text > p {
        font-size: 9px;
    }

    .whatsapp-button {
        padding: 9px 12px;
        font-size: 10px;
        box-shadow: none;
    }

    .footer {
        padding: 10px 24px;
    }

    .footer p {
        font-size: 8px;
    }

    .print-button {
        display: none !important;
    }

    .hero-decoration {
        display: none;
    }

    a {
        color: inherit;
        text-decoration: none;
    }
}