/* إعدادات المتغيرات والألوان (Dark Theme) */
:root {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* التنسيقات العامة */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.section-title span {
    color: var(--primary-color);
}

section {
    padding: 100px 8%;
}

/* الأزرار */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.secondary-btn {
    background-color: transparent;
    border-color: var(--text-muted);
    color: var(--text-light);
}

.secondary-btn:hover {
    border-color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.05);
}

/* شريط التنقل (Navbar) */
header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 8%;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-light);
    text-decoration: none;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
}

/* القسم الرئيسي (Hero) */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 120px;
}

.hero .subtitle {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: block;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero .highlight {
    color: var(--primary-color);
}

.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* المهارات والمشاريع (Grid Layouts) */
.skills-grid, .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card, .project-card {
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.skill-card:hover, .project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.3);
}

.skill-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.skill-card h3, .project-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.skill-card p, .project-card p {
    color: var(--text-muted);
}

.project-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* نموذج التواصل */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--surface-color);
    padding: 3rem;
    border-radius: 15px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.input-group {
    display: flex;
    gap: 1.5rem;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* التذييل */
footer {
    text-align: center;
    padding: 2rem 8%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    color: var(--text-muted);
    font-size: 1.5rem;
    margin: 0 10px;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
}

/* التجاوب مع الجوال (Responsive Design) */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0; /* Changed from right to left for proper RTL flow */
        width: 100%;
        background-color: var(--surface-color);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 1.5rem;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease-out;
    }

    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .input-group {
        flex-direction: column;
    }
    
    section {
        padding: 80px 5%;
    }
}

/* حركات الظهور عند التمرير */
.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.show {
    opacity: 1;
    transform: translateY(0);
}