/* Global Styles */
:root {
    /* Color Palette */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --accent-primary: #00e5ff;
    --accent-secondary: #0078d7;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-accent: #00e5ff;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-xxl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    /* Animation */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

section {
    padding: var(--space-xxl) 0;
    position: relative;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xl);
    text-align: center;
    position: relative;
    color: var(--text-primary);
    text-shadow: 0 0 5px rgba(0, 120, 215, 0.3);
    animation: titlePulse 3s infinite alternate;
}

@keyframes titlePulse {
    0% {
        text-shadow: 0 0 5px rgba(0, 120, 215, 0.3);
    }
    100% {
        text-shadow: 0 0 15px rgba(0, 120, 215, 0.7), 0 0 30px rgba(0, 120, 215, 0.4);
    }
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-full);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-secondary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

.btn:active {
    transform: scale(0.95);
}

.btn:hover::after {
    left: 100%;
}

.primary-btn {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
    color: var(--bg-primary);
}

.secondary-btn {
    background-color: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.secondary-btn:hover {
    background-color: rgba(0, 229, 255, 0.1);
    color: var(--accent-primary);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(10, 14, 23, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: var(--space-lg);
}

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    padding: var(--space-xs) 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: var(--radius-full);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: linear-gradient(90deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    display: inline-block;
}

.hero-text h1::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, rgba(0, 120, 215, 0), rgba(0, 120, 215, 0.8), rgba(0, 120, 215, 0));
    animation: lineMove 3s infinite;
}

@keyframes lineMove {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.hero-text h2 {
    font-size: 1.5rem;
    color: var(--accent-secondary);
    margin-bottom: var(--space-md);
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    position: relative;
    z-index: 10;
}

/* Download CV button - normal styling */
#download-cv {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Glow effect for interactive elements */
.btn:hover, .skill-tag:hover, .nav-links a:hover, .social-link:hover {
    box-shadow: 0 0 15px rgba(0, 120, 215, 0.6);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-container {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(110, 86, 207, 0.2), rgba(0, 229, 255, 0.2));
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.2);
    overflow: hidden;
    animation: profilePulse 3s infinite alternate;
}

@keyframes profilePulse {
    0% {
        box-shadow: 0 10px 30px rgba(0, 229, 255, 0.2);
        transform: translateY(0);
    }
    100% {
        box-shadow: 0 15px 40px rgba(0, 229, 255, 0.4), 0 0 50px rgba(0, 120, 215, 0.3);
        transform: translateY(-10px);
    }
}

.profile-image {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal), filter var(--transition-normal), brightness var(--transition-normal);
}

.profile-container:hover .profile-image img {
    transform: scale(1.05);
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(0, 120, 215, 0.4);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
    opacity: 0.3;
    perspective: 1000px;
    transform-style: preserve-3d;
    animation: gridAnimation 20s linear infinite;
}

@keyframes gridAnimation {
    0% {
        transform: translateZ(0) rotateX(60deg);
    }
    100% {
        transform: translateZ(100px) rotateX(60deg);
    }
}

/* About Section */
.about {
    background-color: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.skills {
    margin-top: var(--space-lg);
}

.skills h3 {
    font-size: 1.3rem;
    margin-bottom: var(--space-md);
    color: var(--accent-primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.skill-tag {
    background-color: rgba(0, 229, 255, 0.1);
    color: var(--accent-primary);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    border: 1px solid rgba(0, 229, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.skill-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 120, 215, 0.2), transparent);
    transition: left 0.5s ease;
}

.skill-tag:hover::before {
    left: 100%;
    transition: left 0.5s ease;
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    flex: 1;
    min-width: 300px;
    position: relative;
    overflow: hidden;
}

.skills-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: linear-gradient(45deg, rgba(0, 120, 215, 0.05) 25%, transparent 25%, transparent 50%, rgba(0, 120, 215, 0.05) 50%, rgba(0, 120, 215, 0.05) 75%, transparent 75%);
    background-size: 20px 20px;
    animation: skillsBackgroundMove 30s linear infinite;
    z-index: -1;
    opacity: 0.5;
}

@keyframes skillsBackgroundMove {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.skills {
    background-color: rgba(17, 24, 39, 0.7);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.skills-container {
    background-color: rgba(17, 24, 39, 0.7);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.soft-skills,
.programming-languages {
    margin-bottom: var(--space-md);
}

.soft-skills h3,
.programming-languages h3 {
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
    font-size: 1.2rem;
    position: relative;
    padding-left: var(--space-md);
}

.soft-skills h3::before,
.programming-languages h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
}

.stat-item {
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: var(--space-xs);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Projects Section */
.projects {
    background-color: var(--bg-primary);
}

.projects-grid {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
}
.project-card {
    background: rgba(17, 24, 39, 0.7);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
    position: relative;
    width: 350px; /* قم بإضافة هذا السطر */
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-content {
    padding: var(--space-lg);
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.tech-tag {
    background-color: rgba(110, 86, 207, 0.1);
    color: var(--accent-secondary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: 'Fira Code', monospace;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-link i {
    transition: transform 0.3s ease;
}

.project-link:hover i {
    transform: translateX(5px);
}

/* Certifications Section */
.certifications {
    background-color: var(--bg-secondary);
}

.cert-grid {
    display: flex; /* تحويل إلى Flexbox */
    justify-content: center; /* توسيط المحتوى أفقيًا */
    gap: var(--space-xl);
    margin-top: var(--space-xl);
    /* يمكنك حذف الخصائص المتعلقة بـ Grid التي كانت موجودة */
}

.cert-card {
    background: rgba(17, 24, 39, 0.7);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(110, 86, 207, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    width: 350px; /* قم بإضافة هذا السطر لتحديد العرض الثابت */
}

.cert-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 229, 255, 0.2), 0 0 5px rgba(0, 229, 255, 0.5);
    border-color: var(--accent-primary);
}

.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(110, 86, 207, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cert-card::after {
    content: attr(data-id);
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: rgba(0, 229, 255, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cert-card:hover::after {
    opacity: 1;
}

.cert-card:hover::before {
    opacity: 1;
}

.cert-card:nth-child(1) { --cert-id: "0x01"; }
.cert-card:nth-child(2) { --cert-id: "0x02"; }
.cert-card:nth-child(3) { --cert-id: "0x03"; }
.cert-card:nth-child(4) { --cert-id: "0x04"; }
.cert-card:nth-child(5) { --cert-id: "0x05"; }
.cert-card:nth-child(6) { --cert-id: "0x06"; }

.cert-card::after {
    content: var(--cert-id);
}

.cert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    font-size: 2.5rem;
    color: var(--accent-primary);
    background-color: rgba(0, 229, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cert-image {
    display: flex;
    justify-content: center;
    align-items: center;
   
}

.cert-image img {
    /* هنا تتحكم في حجم الصورة نفسها */
    width: 100%;
    max-width: 500px; /* مثال: يمكنك تغيير هذه القيمة للحجم الذي يناسبك */
    height: auto;
}

.cert-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    bottom: 0;
    left: -100%;
    transition: all 0.5s ease;
}

.cert-card:hover .cert-icon::before {
    left: 100%;
}

.cert-icon::after {
    content: '01';
    position: absolute;
    top: 5px;
    right: 5px;
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: rgba(0, 229, 255, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cert-card:nth-child(1) .cert-icon::after { content: '01'; }
.cert-card:nth-child(2) .cert-icon::after { content: '10'; }
.cert-card:nth-child(3) .cert-icon::after { content: '11'; }
.cert-card:nth-child(4) .cert-icon::after { content: '00'; }
.cert-card:nth-child(5) .cert-icon::after { content: '01'; }
.cert-card:nth-child(6) .cert-icon::after { content: '10'; }

.cert-card:hover .cert-icon::after {
    opacity: 1;
}

.cert-card:hover .cert-icon {
    color: var(--accent-secondary);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.cert-content {
    flex: 1;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
}

.cert-content h3 {
    font-size: 1.2rem;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.cert-card:hover .cert-content h3 {
    color: var(--accent-primary);
}

.cert-issuer {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.cert-date {
    color: var(--accent-secondary);
    font-family: 'Fira Code', monospace;
    margin-top: auto;
    font-size: 0.9rem;
}

/* CTF Challenge Section */
.ctf {
    background-color: var(--bg-primary);
    position: relative;
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
    padding: var(--space-lg);
    overflow: hidden;
}

.ctf::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        rgba(0, 229, 255, 0.03),
        rgba(0, 229, 255, 0.03) 10px,
        rgba(0, 120, 215, 0.03) 10px,
        rgba(0, 120, 215, 0.03) 20px
    );
    pointer-events: none;
    z-index: 0;
}

.ctf-content {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    background-color: rgba(17, 24, 39, 0.7);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.soft-skills,
.programming-languages {
    margin-bottom: var(--space-md);
}

.soft-skills h3,
.programming-languages h3 {
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
    font-size: 1.2rem;
    position: relative;
    padding-left: var(--space-md);
}

.soft-skills h3::before,
.programming-languages h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
}

.ctf-description {
    flex: 1;
    min-width: 300px;
}

.ctf-description h3 {
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
}

.ctf-rules {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background-color: rgba(17, 24, 39, 0.7);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ctf-rules h4 {
    margin-bottom: var(--space-sm);
    color: var(--accent-secondary);
}

.ctf-rules ol {
    padding-left: var(--space-lg);
}

.ctf-rules li {
    margin-bottom: var(--space-xs);
}

code {
    font-family: 'Fira Code', monospace;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-size: 0.9rem;
}

.ctf-submission {
    flex: 1;
    min-width: 300px;
    background-color: rgba(17, 24, 39, 0.7);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.ctf-submission::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(0, 229, 255, 0.05), transparent);
    animation: scan-effect 3s infinite linear;
    pointer-events: none;
}

@keyframes scan-effect {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

#flag-input {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    font-family: 'Fira Code', monospace;
    padding: var(--space-md);
    transition: all 0.3s ease;
}

#flag-input:focus {
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    outline: none;
}

#flag-form button {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    font-family: 'Fira Code', monospace;
    font-weight: bold;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#flag-form button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

#flag-form button:hover::after {
    left: 100%;
}

.input-error {
    animation: shake 0.5s linear;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

#flag-result {
    margin-top: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 500;
    display: none;
    font-family: 'Fira Code', monospace;
    position: relative;
    overflow: hidden;
}

#flag-result.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
    animation: pulse-success 2s infinite;
}

#flag-result.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
    animation: glitch-error 0.5s infinite;
}

@keyframes pulse-success {
    0% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.8); }
    100% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.5); }
}

@keyframes glitch-error {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* Contact Section */
.contact {
    background-color: var(--bg-secondary);
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-info h3 {
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
}

.social-links {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.social-links.vertical {
    flex-direction: column;
    gap: var(--space-sm);
}

.social-link {
    display: flex;
    align-items: center;
    width: auto;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.social-link i {
    margin-right: var(--space-md);
}

.social-name {
    font-size: 0.9rem;
}

.social-link:hover {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(0, 229, 255, 0.3);
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-normal);
}

.social-link:hover::before {
    left: 100%;
}

.contact-form {
    flex: 1;
    min-width: 300px;
}

.form-group {
    margin-bottom: var(--space-md);
}

label {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
}

input, textarea {
    width: 100%;
    padding: var(--space-md);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.2);
}

textarea {
    resize: vertical;
}

/* Footer */
footer {
    background-color: var(--bg-primary);
    padding: var(--space-xl) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo p {
    margin-top: var(--space-xs);
    color: var(--text-secondary);
}

.footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    list-style: none;
}

.footer-bottom {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-text {
        margin-bottom: var(--space-xl);
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cert-timeline::before {
        left: 20px;
    }
    
    .cert-year {
        width: 60px;
        text-align: left;
        padding-right: var(--space-md);
    }
    
    .cert-year::after {
        right: auto;
        left: 40px;
    }
    
    .cert-content {
        padding-left: var(--space-lg);
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-text h2 {
        font-size: 1.2rem;
    }
    
    .profile-container {
        width: 250px;
        height: 250px;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--bg-secondary);
        flex-direction: column;
        align-items: center;
        padding: var(--space-lg) 0;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: all 0.5s ease;
        z-index: 999;
    }
    
    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    
    .nav-links li {
        margin: var(--space-sm) 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .menu-toggle.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .profile-container {
        width: 200px;
        height: 200px;
    }
    
    .profile-placeholder i {
        font-size: 3rem;
    }
    
    .hero-cta {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .btn {
        width: 100%;
    }
    
    .cert-content {
        padding-left: var(--space-md);
    }
    
    .cert-content h3 {
        font-size: 1rem;
    }
}

/* Binary Background Effect */
@keyframes float-binary {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

.binary-bit {
    position: absolute;
    color: rgba(0, 229, 255, 0.15);
    font-family: 'Fira Code', monospace;
    font-size: 1.2rem;
    font-weight: 500;
    user-select: none;
    pointer-events: none;
    z-index: 1;
    animation: float-binary 15s linear infinite;
}

/* Security Symbols Effect */
@keyframes float-security {
    0% {
        transform: translateX(-20px);
        opacity: 0;
    }
    20% {
        opacity: 0.7;
    }
    80% {
        opacity: 0.3;
    }
    100% {
        transform: translateX(120%);
        opacity: 0;
    }
}

.security-symbol {
    position: absolute;
    color: rgba(0, 120, 215, 0.05); /* قيمة أقل لحل مشكلة التباين */
    font-family: 'Fira Code', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    animation: float-security 12s linear infinite;
}

/* Network nodes and connections in Projects section */
.projects {
    position: relative;
    overflow: hidden;
}

.network-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.cyber-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.cyber-term {
    position: absolute;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: rgba(0, 229, 255, 0.3);
    white-space: nowrap;
    opacity: 0.3;
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.5);
    animation: float-term 20s infinite linear;
    transform-origin: center;
}

.cyber-term:nth-child(odd) {
    animation-direction: normal;
}

.cyber-term:nth-child(even) {
    animation-direction: reverse;
    color: rgba(255, 0, 128, 0.3);
    text-shadow: 0 0 5px rgba(255, 0, 128, 0.5);
}

.cyber-term:hover {
    opacity: 0.8;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.8);
}

@keyframes float-term {
    0% { transform: translateX(-100%) translateY(0); }
    25% { transform: translateX(-50vw) translateY(10px); }
    50% { transform: translateX(0) translateY(0); }
    75% { transform: translateX(50vw) translateY(-10px); }
    100% { transform: translateX(100vw) translateY(0); }
}

.network-node {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: rgba(110, 86, 207, 0.3);
    border-radius: 50%;
    z-index: 1;
    animation: pulseNode 4s ease-in-out infinite;
}

.network-connection {
    position: absolute;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(110, 86, 207, 0.2), transparent);
    z-index: 0;
}

@keyframes pulseNode {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(110, 86, 207, 0.4);
    }
    50% {
        transform: scale(1.5);
        box-shadow: 0 0 10px rgba(110, 86, 207, 0.7);
    }
}

/* Hex codes in Skills section */
.skills {
    position: relative;
    overflow: hidden;
}

.hex-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hex-code {
    position: absolute;
    font-family: 'Fira Code', monospace;
    color: rgba(110, 86, 207, 0.02);
    font-size: 0.9rem;
    z-index: 0;
    animation: fadeInOut 8s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.1;
    }
    50% {
        opacity: 0.4;
    }
}

/* Encryption elements in Contact section */
.contact {
    position: relative;
    overflow: hidden;
}

.encryption-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.encryption-element {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.2;
    z-index: 0;
    animation: floatEncryption 20s linear infinite;
}

@keyframes floatEncryption {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) translateX(20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) translateX(-15px) rotate(240deg);
    }
    100% {
        transform: translateY(0) translateX(0) rotate(360deg);
    }
}

/* Advanced Background Effect */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0, 120, 215, 0.1) 0%, transparent 50%);
    animation: pulseBackground 8s infinite alternate;
    z-index: 0;
    pointer-events: none;
}

@keyframes pulseBackground {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    100% {
        opacity: 0.7;
        transform: scale(1.5);
    }
}

.cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 50px 50px;
    background-image: 
        linear-gradient(to right, rgba(0, 229, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    animation: grid-animation 20s linear infinite;
    opacity: 0.4;
}

@keyframes grid-animation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* Smooth Scroll Indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    z-index: 1000;
    width: 0%;
    transition: width 0.2s ease;
}

/* Parallax Effect */
.parallax-element {
    transition: transform 0.2s ease-out;
}

/* 3D Scene Container */
.scene-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.rotate-on-scroll {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

/* Floating Animation */
@keyframes floating {
    0% {
        transform: translateY(0px) translateZ(0);
    }
    50% {
        transform: translateY(-10px) translateZ(20px);
    }
    100% {
        transform: translateY(0px) translateZ(0);
    }
}

.floating {
    animation: floating 4s ease-in-out infinite;
}

/* 3D Metallic Effects */
.metallic-effect {
    position: relative;
    overflow: hidden;
}

.metallic-effect::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateZ(0);
    pointer-events: none;
    transition: all 0.6s ease;
    opacity: 0;
    z-index: 1;
}

.metallic-effect:hover::before {
    opacity: 1;
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* الكود الخاص بمتصفحات WebKit (Chrome, Safari, Brave, Edge) */
::-webkit-scrollbar {
  width: 20px;
}

::-webkit-scrollbar-track {
  background: #ff0000;
}

::-webkit-scrollbar-thumb {
  background: #ff0000;

}

::-webkit-scrollbar-thumb:hover {
  background: #ff0000;
}

/* الكود الخاص بمتصفح Firefox */
html {
  scrollbar-color: #00e5ff #0076d710;
  scrollbar-width: auto;
}
