/* =========================
   إعدادات عامة
========================= */

:root {
    --navy: #142b45;
    --navy-light: #203e5e;
    --gold: #c5a46d;
    --gold-light: #e9d8b5;

    --white: #ffffff;
    --background: #f3f5f7;
    --text: #283746;
    --muted: #738091;
    --border: #e3e8ed;

    --card-bg: #f6f8fa;
    --contact-bg: #f7f8fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--background);
    color: var(--text);
    direction: rtl;
    line-height: 1.8;
    padding: 40px 16px;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}


/* =========================
   الحاوية الرئيسية
========================= */

.cv-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(20, 43, 69, 0.08);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}


/* =========================
   زر الوضع الليلي
========================= */

.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;

    border: none;
    border-radius: 10px;

    padding: 11px 16px;

    background: var(--navy);
    color: #ffffff;

    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18);

    transition:
        background 0.3s ease,
        color 0.3s ease,
        transform 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
}


/* =========================
   Header
========================= */

.hero {
    position: relative;
    background: linear-gradient(
        125deg,
        var(--navy),
        var(--navy-light)
    );

    color: var(--white);

    padding: 65px 70px;

    overflow: hidden;

    min-height: 300px;

    display: flex;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.eyebrow {
    display: inline-block;
    color: var(--gold-light);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.5;
    margin-bottom: 2px;
}

.hero h2 {
    color: var(--gold-light);
    font-size: 21px;
    font-weight: 600;
}

.hero-line {
    width: 65px;
    height: 3px;
    background: var(--gold);
    margin: 20px 0;
    border-radius: 10px;
}

.hero-description {
    max-width: 500px;
    color: #dce5ed;
    font-size: 15px;
    line-height: 2;
}

.hero-decoration {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 220px;
    height: 220px;
    pointer-events: none;
}

.decoration-circle {
    position: absolute;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(233, 216, 181, 0.25);
    border-radius: 50%;
    top: 15px;
    left: 15px;
}

.decoration-circle.small {
    width: 130px;
    height: 130px;
    top: 45px;
    left: 45px;
    border-color: rgba(233, 216, 181, 0.45);
}


/* =========================
   الأقسام
========================= */

.section {
    padding: 30px 70px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.section-number {
    color: var(--gold);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
}

.section-heading h3 {
    font-size: 21px;
    color: var(--navy);
    font-weight: 800;
}

.about p {
    font-size: 14px;
    color: var(--muted);
    line-height: 2.2;
    text-align: justify;
}


/* =========================
   المهارات
========================= */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.skill {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 13px 15px;

    background: var(--card-bg);
    border: 1px solid var(--border);

    border-radius: 9px;

    font-size: 13px;
    font-weight: 600;

    color: var(--navy);

    transition:
        background 0.3s ease,
        color 0.3s ease,
        border 0.3s ease,
        transform 0.25s ease;
}

.skill:hover {
    transform: translateY(-2px);
}

.skill-icon {
    color: var(--gold);
    font-size: 17px;
}


/* =========================
   المشاريع
========================= */

.project-card {
    display: flex;
    gap: 18px;

    padding: 15px 0;

    border-bottom: 1px solid var(--border);

    transition: border-color 0.3s ease;
}

.project-card:last-child {
    border-bottom: none;
}

.project-marker {
    flex-shrink: 0;

    width: 10px;
    height: 10px;

    margin-top: 10px;

    background: var(--gold);

    border-radius: 50%;

    box-shadow: 0 0 0 5px #f5f0e7;
}

.project-card h4 {
    color: var(--navy);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
}

.project-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 2;
}


/* =========================
   التعليم
========================= */

.education-card {
    display: flex;
    align-items: center;
    gap: 18px;

    background: var(--card-bg);

    border: 1px solid var(--border);

    padding: 18px;

    border-radius: 10px;
}

.education-icon {
    width: 46px;
    height: 46px;

    background: #e9edf1;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 23px;

    color: var(--gold);
}

.education-card h4 {
    color: var(--navy);
    font-size: 15px;
}

.education-card p {
    color: var(--muted);
    font-size: 12px;
}


/* =========================
   التواصل
========================= */

.contact-section {
    margin-top: 20px;

    background: var(--contact-bg);

    border-top: 1px solid var(--border);

    padding: 40px 70px;

    text-align: center;
}

.contact-label {
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
}

.contact-content h3 {
    color: var(--navy);
    font-size: 22px;
    margin: 8px 0;
}

.contact-content > p {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.contact-details {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 25px;
}

.contact-details a {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--muted);

    font-size: 12px;

    direction: ltr;

    transition: color 0.2s;
}

.contact-details a:hover {
    color: var(--navy);
}

.contact-details span {
    color: var(--gold);
    font-size: 17px;
}


/* =========================
   زر واتساب
========================= */

.whatsapp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    background: #168c58;
    color: #ffffff;

    padding: 13px 28px;

    border-radius: 8px;

    font-size: 14px;
    font-weight: 700;

    box-shadow: 0 5px 15px rgba(22, 140, 88, 0.18);

    transition: 0.25s ease;
}

.whatsapp-button:hover {
    background: #107347;
    transform: translateY(-2px);
}

.whatsapp-button svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}


/* =========================
   التذييل
========================= */

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 16px 70px;

    border-top: 1px solid var(--border);

    background: var(--white);
}

.footer p {
    color: var(--muted);
    font-size: 11px;
}

.footer button {
    border: none;
    background: transparent;

    font-family: inherit;

    color: var(--navy);

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    transition: color 0.2s;
}


/* =========================================================
   🌙 الوضع الليلي
========================================================= */

body.dark-mode {

    --background: #0b1117;

    --white: #151d26;

    --text: #e6edf3;

    --muted: #a9b4bf;

    --border: #2b3744;

    --card-bg: #1b2631;

    --contact-bg: #111a23;

    background: var(--background);

    color: var(--text);
}


/* الحاوية */

body.dark-mode .cv-container {
    background: #151d26;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.55);
}


/* العناوين */

body.dark-mode .section-heading h3 {
    color: #f1f5f9;
}

body.dark-mode .project-card h4 {
    color: #f1f5f9;
}

body.dark-mode .education-card h4 {
    color: #f1f5f9;
}

body.dark-mode .contact-content h3 {
    color: #f1f5f9;
}


/* النصوص */

body.dark-mode .about p {
    color: #b6c1cc;
}

body.dark-mode .project-card p {
    color: #aeb9c5;
}

body.dark-mode .education-card p {
    color: #aeb9c5;
}

body.dark-mode .contact-content > p {
    color: #aeb9c5;
}


/* المهارات */

body.dark-mode .skill {

    background: #1c2833;

    border-color: #33414f;

    color: #e8edf2;
}

body.dark-mode .skill:hover {
    background: #24323e;
}


/* التعليم */

body.dark-mode .education-card {

    background: #1c2833;

    border-color: #33414f;
}

body.dark-mode .education-icon {
    background: #263442;
}


/* المشاريع */

body.dark-mode .project-card {
    border-color: #2b3744;
}


/* التواصل */

body.dark-mode .contact-section {

    background: #111a23;

    border-color: #2b3744;
}


/* معلومات التواصل */

body.dark-mode .contact-details a {
    color: #aeb9c5;
}

body.dark-mode .contact-details a:hover {
    color: #ffffff;
}


/* الفوتر */

body.dark-mode .footer {

    background: #151d26;

    border-color: #2b3744;
}

body.dark-mode .footer p {
    color: #9eabb7;
}

body.dark-mode .footer button {
    color: #e6edf3;
}


/* زر الوضع الليلي يصبح زر الوضع النهاري */

body.dark-mode .theme-toggle {

    background: #e9d8b5;

    color: #142b45;

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.4);
}


/* =========================
   الشاشات المتوسطة
========================= */

@media (max-width: 768px) {

    body {
        padding: 20px 12px;
    }

    .hero {
        padding: 45px 35px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero h2 {
        font-size: 18px;
    }

    .hero-decoration {
        left: -90px;
        opacity: 0.5;
    }

    .section {
        padding: 25px 35px;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-section {
        padding: 35px;
    }

    .footer {
        padding: 15px 35px;
    }
}


/* =========================
   الهواتف
========================= */

@media (max-width: 480px) {

    body {
        padding: 0;
    }

    .cv-container {
        border-radius: 0;
    }

    .hero {
        padding: 40px 24px;
        min-height: 270px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero h2 {
        font-size: 17px;
    }

    .hero-description {
        font-size: 13px;
    }

    .section {
        padding: 25px 24px;
    }

    .section-heading h3 {
        font-size: 18px;
    }

    .about p {
        font-size: 13px;
    }

    .skills-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .skill {
        font-size: 11px;
        padding: 10px;
        gap: 6px;
    }

    .project-card h4 {
        font-size: 14px;
    }

    .project-card p {
        font-size: 12px;
    }

    .contact-section {
        padding: 30px 20px;
    }

    .contact-content h3 {
        font-size: 18px;
    }

    .contact-details {
        flex-direction: column;
        gap: 10px;
    }

    .contact-details a {
        font-size: 11px;
    }

    .whatsapp-button {
        font-size: 13px;
        padding: 12px 20px;
    }

    .footer {
        flex-direction: column;
        gap: 8px;
        padding: 15px;
        text-align: center;
    }

    .theme-toggle {
        top: 12px;
        left: 12px;
        padding: 8px 11px;
        font-size: 11px;
    }
}


/* =========================
   الطباعة
========================= */

@media print {

    @page {
        size: A4;
        margin: 8mm;
    }

    body {

        padding: 0;

        background: white;

        -webkit-print-color-adjust: exact;

        print-color-adjust: exact;
    }

    .cv-container {

        max-width: 100%;

        box-shadow: none;

        border-radius: 0;
    }

    .hero {

        min-height: auto;

        padding: 35px 45px;
    }

    .section {

        padding: 18px 45px;
    }

    .contact-section {

        padding: 25px 45px;
    }

    .footer {

        padding: 12px 45px;
    }

    .footer button {

        display: none;
    }

    .theme-toggle {

        display: none;
    }

    a {

        color: inherit;
    }

    .project-card,
    .education-card,
    .skill {

        break-inside: avoid;
    }
}