html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a1a, #333);
    color: #fff;
}

.header {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
}

hr{
    border: none;
    height: 1px; /* سمك الخط */
    background-color: #e24147; /* اللون الأساسي للنيون */
    box-shadow: 0 0 10px #e24147, 0 0 20px #e24147, 0 0 30px #e24147; /* تأثير التوهج */
    margin: 10px 0; /* مسافة فوق وتحت */
}


.logo {
    font-size: 24px;
    font-weight: bold;
}

.nav {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav a {
    color: #fff;
    text-decoration: none;
    transition: 0.3s;
}

.nav a:hover {
    color: #e24147;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 80px;
}

.hero-text h1 {
    font-size: 50px;
    margin-bottom: 20px;
}

.hero-text p {
    width: 80%;
    font-size: 20px;
    opacity: 0.8;
}

.hero-img img {
    width: 260px;
    border-radius: 20px;
    box-shadow: 0 0 20px #000;
}

.about, .skills, .projects, .contact {
    padding: 60px 80px;
}

.about {
    text-align: center; /* توسيط المحتوى */
}

.about p {
    font-size: 1.1rem; /* استخدام وحدة rem أفضل من % للخطوط */
    line-height: 1.5; /* مسافة سطر مناسبة لراحة القراءة */
    margin: 0.5em 0; /* مساحة صغيرة فوق وتحت كل فقرة */
}

.skills .skill {
    margin: 25px 0;
}

.skill h2 {
    margin-bottom: 5px;
}

.skill p {
    opacity: 0.8;
    margin-bottom: 10px;
}

.bar {
    width: 100%;
    height: 8px;
    background: #444;
    border-radius: 4px;
    overflow: hidden;
}

.bar span {
    display: block;
    height: 100%;
    background: #e24147;
    border-radius: 4px;
}

.projects .project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.project {
    background: #222;
    padding: 20px;
    border-radius: 15px;
    transition: 0.3s;
}

.project:hover {
    transform: translateY(-5px);
    background: #2a2a2a;
}

.contact p {
    margin: 10px 0;
}

.section {
    border-bottom: 1px solid #444;
    padding-bottom: 60px;
    margin-bottom: 60px;
}

/* Fade-in Effect */
section, .hero, .header {
    animation: fadeIn 1.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.project-card {
    background: #222;
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 0 20px #000;
    text-align: center;
    transition: 0.3s ease-in-out;
}

.project-card:hover {
    transform: translateY(-7px);
    background: #2a2a2a;
    box-shadow: 0 0 15px #812326;
}

.project-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 15px;
}

.project-card h2 {
    margin: 10px 0 8px;
}

.project-card p {
    opacity: 0.8;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.project-btn {
    display: inline-block;
    padding: 10px 18px;
    background: #e24147;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    transition: 0.3s;
    font-weight: bold;
}

.project-btn:hover {
    background: #c7373c;
    transform: scale(1.05);
}

.footer {
    text-align: center;
    padding: 20px;
    background: #111;
    margin-top: 40px;
    opacity: 0.7;
}


#typing {
    border-right: 2px solid #e24147; /* المؤشر */
    padding-right: 5px;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    font-weight: bold;
}

.contact {
    text-align: center;
    padding: 50px 20px;
    color: #fff; /* النصوص بيضاء لتكون واضحة */
    font-family: 'Arial', sans-serif;
}

.contact h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #fff; /* لون العنوان أبيض */
}

.contact p {
    font-size: 1.1rem;
    margin: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.contact a {
    color: #fff; /* روابط بيضاء */
    text-decoration: none;
    transition: color 0.3s;
}

.contact a:hover {
    color: #e24147; /* اللون عند المرور */
}

.social-icons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-icons a {
    font-size: 1.5rem;
    color: #fff; /* أيقونات بيضاء */
    transition: color 0.3s, transform 0.3s;
}

.social-icons a:hover {
    color: #e24147; /* تأثير الهوفر */
    transform: scale(1.2);
}

/* =========================================
   RESPONSIVE FIXES
========================================= */

/* الشاشات أقل من 992px (تابلت) */
@media (max-width: 992px) {

    .header {
        padding: 15px 20px;
    }

    .hero {
        padding: 40px 20px;
        gap: 40px;
    }

    .hero-text h1 {
        font-size: 38px;
    }

    .hero-text p {
        width: 100%;
        font-size: 18px;
    }

    .hero-img img {
        width: 220px;
    }

    .about, .skills, .projects, .contact {
        padding: 40px 20px;
    }
}

/* الشاشات أقل من 768px (موبايل) */
@media (max-width: 768px) {

    /* الهيدر */
    .header {
        flex-wrap: wrap;
        text-align: center;
        gap: 15px;
    }

    .nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }

    .hero-text h1 {
        font-size: 32px;
    }

    .hero-text p {
        width: 100%;
        font-size: 16px;
    }

    .hero-img img {
        width: 180px;
    }

    .about p {
        font-size: 1rem;
    }

    .skills .skill p {
        font-size: 0.95rem;
    }

    .project {
        padding: 15px;
    }

    .contact h1 {
        font-size: 2rem;
    }

    .social-icons a {
        font-size: 1.3rem;
    }
}


@media (max-width: 480px) {

    .hero-text h1 {
        font-size: 26px;
    }

    .hero-text p {
        font-size: 15px;
    }

    .hero-img img {
        width: 150px;
    }

    .logo {
        font-size: 20px;
    }

    .nav a {
        font-size: 0.9rem;
    }

    .about, .skills, .projects, .contact {
        padding: 30px 15px;
    }
}
