/* ==================== CSS VARIABLES ==================== */
:root {
    /* Colors */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #0891b2;
    --accent-color: #f59e0b;
    
    --text-dark: #1f2937;
    --text-medium: #4b5563;
    --text-light: #6b7280;
    
    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #111827;
    
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Poppins', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-white);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-medium);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto var(--spacing-xl);
}

/* ==================== NAVIGATION ==================== */
.navbar {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-base);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    font-family: var(--font-heading);
    transition: color var(--transition-fast);
}

.nav-logo:hover {
    color: var(--primary-dark);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-link {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-base);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all var(--transition-base);
    border-radius: 2px;
}

/* ==================== HERO SECTION ==================== */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--bg-white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.hero-container {
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
    animation: fadeInUp 0.8s ease-out;
}

.highlight {
    color: var(--accent-color);
    position: relative;
}

.hero-subtitle {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero-description {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-xl);
    opacity: 0.95;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.hero-social {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.8s backwards;
}

.hero-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--bg-white);
    font-size: 1.2rem;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

.hero-social a:hover {
    background-color: var(--bg-white);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
    cursor: pointer;
    border: 2px solid transparent;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--bg-white);
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    border-color: var(--bg-white);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--bg-white);
    color: var(--bg-white);
}

.btn-secondary:hover {
    background-color: var(--bg-white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==================== ABOUT SECTION ==================== */
.about {
    padding: var(--spacing-2xl) 0;
    background-color: var(--bg-white);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-medium);
    margin-bottom: var(--spacing-md);
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.highlight-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-light);
    border-radius: 12px;
    transition: all var(--transition-base);
}

.highlight-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.highlight-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.highlight-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.highlight-item p {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin: 0;
    line-height: 1.5;
}

/* ==================== SKILLS SECTION ==================== */
.skills {
    padding: var(--spacing-2xl) 0;
    background-color: var(--bg-light);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.skill-category {
    background-color: var(--bg-white);
    padding: var(--spacing-xl);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    text-align: center;
}

.skill-category:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.skill-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    font-size: 2rem;
}

.skill-category h3 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    justify-content: center;
}

.skill-tags span {
    background-color: var(--bg-light);
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.skill-tags span:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
    transform: scale(1.05);
}

/* ==================== PROFESSIONAL PROJECTS SECTION ==================== */
.projects {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.project-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.featured-project {
    border: 2px solid #2563eb;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

.project-badge-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.featured-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    letter-spacing: 0.5px;
}

.project-header-pro {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 2.5rem 2.5rem 2rem;
}

.featured-project .project-header-pro {
    padding-top: 3.5rem;
}

.project-header-pro h3 {
    font-size: 2rem;
    margin: 0 0 0.75rem 0;
    color: white;
    font-weight: 700;
    line-height: 1.3;
}

.project-category {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.5px;
}

.project-body {
    padding: 2.5rem;
}

.project-summary {
    margin-bottom: 2rem;
}

.project-summary p {
    color: #4b5563;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.project-summary strong {
    color: #1f2937;
    font-weight: 600;
}

/* ==================== PROJECT GALLERY - FIXED NO CROP ==================== */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.project-gallery img {
    width: 100%;
    height: auto; /* الصورة تظهر كاملة بدون crop */
    object-fit: contain; /* contain بدل cover */
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    background: #ffffff; /* خلفية بيضا */
    border: 1px solid #e5e7eb;
    display: block;
}

.project-gallery img:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

/* ==================== TECH STACK ==================== */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0;
    padding: 2rem 0;
    border-top: 2px solid #f3f4f6;
    border-bottom: 2px solid #f3f4f6;
}

.tech-badge {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
}

.tech-badge:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

/* ==================== PROJECT LINKS ==================== */
.project-links-pro {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-github, .btn-docs {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-github {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
}

.btn-github:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-docs {
    background: white;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.btn-docs:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* ==================== CERTIFICATIONS SECTION ==================== */
.certifications {
    padding: var(--spacing-2xl) 0;
    background-color: var(--bg-light);
}

.cert-timeline {
    max-width: 800px;
    margin: var(--spacing-xl) auto 0;
    position: relative;
}

.cert-timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.timeline-item {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.timeline-icon {
    min-width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--bg-white);
    z-index: 1;
    box-shadow: var(--shadow-md);
}

.timeline-icon.education {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.timeline-icon.training {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.timeline-icon.certification {
    background: linear-gradient(135deg, var(--accent-color), #f97316);
}

.timeline-content {
    flex: 1;
    background-color: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.timeline-org {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-date {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.timeline-content p:last-child {
    color: var(--text-medium);
    line-height: 1.6;
    margin-top: 0.5rem;
}

/* ==================== CONTACT SECTION ==================== */
.contact {
    padding: var(--spacing-2xl) 0;
    background-color: var(--bg-white);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.contact-card {
    background-color: var(--bg-light);
    padding: var(--spacing-xl);
    border-radius: 16px;
    text-align: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-white);
}

.contact-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    font-size: 1.8rem;
}

.contact-card h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

.contact-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.contact-card a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.contact-location {
    text-align: center;
    margin-top: var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--text-medium);
    font-size: 1.1rem;
}

.contact-location i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

/* ==================== FOOTER ==================== */
.footer {
    background-color: var(--bg-dark);
    color: var(--bg-light);
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-note {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-white);
        width: 100%;
        text-align: center;
        transition: left var(--transition-base);
        box-shadow: var(--shadow-lg);
        padding: var(--spacing-lg) 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.4rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .about-highlights {
        grid-template-columns: 1fr;
    }
    
    .project-header-pro h3 {
        font-size: 1.5rem;
    }
    
    .project-body {
        padding: 1.5rem;
    }
    
    .project-gallery {
        grid-template-columns: 1fr;
    }
    
    .project-links-pro {
        flex-direction: column;
    }
    
    .btn-github, .btn-docs {
        justify-content: center;
        width: 100%;
    }
    
    .cert-timeline::before {
        left: 20px;
    }
    
    .timeline-icon {
        min-width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .project-header-pro {
        padding: 2rem 1.5rem;
    }
    
    .featured-project .project-header-pro {
        padding-top: 3rem;
    }
    
    .project-header-pro h3 {
        font-size: 1.3rem;
    }
    
    .project-body {
        padding: 1.25rem;
    }
}
