/* Base Styles and Variables */
:root {
    --primary-color: #8a2be2;
    --secondary-color: #6a5acd;
    --accent-color: #9370db;
    --highlight-color: #00ffaa;
    --code-green: #4caf50;
    --code-blue: #2196f3;
    --code-purple: #9c27b0;
    --code-orange: #ff9800;
    --background-dark: #0f1118;
    --background-darker: #080a10;
    --background-card: #171b29;
    --terminal-black: #1a1d28;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-terminal: linear-gradient(180deg, var(--terminal-black), #131620);
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Add code-inspired background elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 10% 10%, rgba(138, 43, 226, 0.05), transparent 20%),
        radial-gradient(circle at 90% 90%, rgba(106, 90, 205, 0.05), transparent 20%),
        linear-gradient(to bottom, transparent 0%, transparent 100%);
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='rgba(138, 43, 226, 0.05)' fill-rule='evenodd'/%3E%3C/svg%3E"),
        linear-gradient(to bottom, transparent 0%, transparent 100%);
    opacity: 0.3;
    z-index: -1;
}

/* Floating code elements */
.floating-code-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    /* تقليل z-index لضمان ظهور المحتوى فوقها */
    overflow: hidden;
}

.code-element {
    position: absolute;
    color: rgba(138, 43, 226, 0.1);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    animation: floatUp 15s linear infinite;
}

.code-element:nth-child(1) {
    left: 10%;
    top: 100%;
    animation-delay: 0s;
    color: rgba(0, 255, 170, 0.1);
}

.code-element:nth-child(2) {
    left: 25%;
    top: 100%;
    animation-delay: 2s;
}

.code-element:nth-child(3) {
    left: 40%;
    top: 100%;
    animation-delay: 5s;
    color: rgba(0, 255, 170, 0.1);
}

.code-element:nth-child(4) {
    left: 60%;
    top: 100%;
    animation-delay: 7s;
}

.code-element:nth-child(5) {
    left: 75%;
    top: 100%;
    animation-delay: 9s;
    color: rgba(0, 255, 170, 0.1);
}

.code-element:nth-child(6) {
    left: 15%;
    top: 100%;
    animation-delay: 11s;
}

.code-element:nth-child(7) {
    left: 35%;
    top: 100%;
    animation-delay: 13s;
    color: rgba(0, 255, 170, 0.1);
}

.code-element:nth-child(8) {
    left: 55%;
    top: 100%;
    animation-delay: 15s;
}

.code-element:nth-child(9) {
    left: 70%;
    top: 100%;
    animation-delay: 17s;
    color: rgba(0, 255, 170, 0.1);
}

.code-element:nth-child(10) {
    left: 85%;
    top: 100%;
    animation-delay: 19s;
}

@keyframes floatUp {
    0% {
        top: 120%;
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        top: -20%;
        opacity: 0;
    }
}

.arabic {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-header::before {
    content: '<section>';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    color: rgba(138, 43, 226, 0.2);
    font-size: 1rem;
}

.section-header::after {
    content: '</section>';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    color: rgba(138, 43, 226, 0.2);
    font-size: 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--highlight-color);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    font-weight: 600;
}

.section-header h2::before {
    content: '{ ';
    color: var(--primary-color);
    opacity: 0.7;
}

.section-header h2::after {
    content: ' }';
    color: var(--primary-color);
    opacity: 0.7;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.btn::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: all 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.primary-btn {
    background: var(--terminal-black);
    color: var(--highlight-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--highlight-color);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 255, 170, 0.3);
    background: rgba(0, 255, 170, 0.1);
}

.primary-btn::after {
    content: ' _';
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.secondary-btn {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
    background: rgba(138, 43, 226, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(138, 43, 226, 0.2);
}

.secondary-btn::after {
    content: ' _';
    animation: blink 1s infinite;
}

.small-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
    border-radius: 3px;
}

/* Terminal Header */
.terminal-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: var(--terminal-black);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 10;
    /* تقليل z-index ليكون أقل من العناصر المتحركة */
    border-bottom: 1px solid rgba(138, 43, 226, 0.3);
}

.terminal-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.terminal-control.close {
    background-color: #ff5f56;
}

.terminal-control.minimize {
    background-color: #ffbd2e;
}

.terminal-control.maximize {
    background-color: #27c93f;
}

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    color: var(--highlight-color);
    font-size: 0.9rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.terminal-actions {
    display: flex;
    gap: 15px;
}

.terminal-action {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    transition: color var(--transition-speed) ease;
}

.terminal-action:hover {
    color: var(--text-primary);
}

/* Header */
header {
    position: fixed;
    top: 30px;
    left: 0;
    width: 100%;
    z-index: 15;
    /* تقليل z-index ليكون أقل من العناصر المتحركة */
    background-color: rgba(15, 17, 24, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: all var(--transition-speed) ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    bottom: -5px;
    left: 0;
    transition: width var(--transition-speed) ease;
}

nav ul li a:hover {
    color: var(--primary-color);
}

nav ul li a:hover::after {
    width: 100%;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--highlight-color);
    transition: all var(--transition-speed) ease;
}

.mobile-menu-toggle:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    /* تغيير من center إلى flex-start */
    padding-top: 160px;
    /* زيادة المسافة العلوية أكثر */
    background: var(--background-darker);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(138, 43, 226, 0.15), transparent 40%);
    z-index: 1;
    /* زيادة z-index قليلاً ولكن أقل من المحتوى */
}

.hero .container {
    display: flex;
    align-items: flex-start;
    /* تغيير من center إلى flex-start */
    justify-content: space-between;
    gap: 50px;
    position: relative;
    z-index: 2;
    padding-top: 20px;
    /* إضافة مسافة علوية إضافية */
}

.hero-content {
    flex: 1;
    z-index: 20;
    position: relative;
    padding-top: 20px;
    /* إضافة مسافة علوية إضافية */
    margin-top: 20px;
    /* إضافة هامش علوي */
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    position: relative;
    z-index: 25;
}

/* تنسيق خاص للعناوين الرئيسية في قسم البطل */
.hero-title {
    position: relative;
    z-index: 50 !important;
    /* استخدام z-index عالي جدًا مع !important */
    display: inline-block;
    /* تغيير العرض إلى inline-block */
}

/* تنسيق خاص لحاوية قسم البطل */
.hero-container {
    position: relative;
    z-index: 1;
    /* تقليل z-index */
    margin-top: 30px;
    /* إضافة هامش علوي */
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    position: relative;
    z-index: 25;
    /* زيادة z-index بشكل كبير */
}

.cta-buttons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.code-container {
    background-color: var(--terminal-black);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(138, 43, 226, 0.3);
    animation: codeGlow 4s ease-in-out infinite alternate;
}

@keyframes codeGlow {
    0% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    }

    100% {
        box-shadow: 0 15px 35px rgba(138, 43, 226, 0.3);
    }
}

.code-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: var(--background-darker);
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid rgba(138, 43, 226, 0.3);
}

.code-container::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 15px;
    width: 12px;
    height: 12px;
    background-color: #ff5f56;
    border-radius: 50%;
    box-shadow:
        20px 0 0 #ffbd2e,
        40px 0 0 #27c93f;
}

.code-container pre {
    margin-top: 20px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    overflow-x: auto;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-container code {
    display: block;
    line-height: 1.6;
    position: relative;
}

/* Add line numbers */
.code-container code::before {
    content: attr(data-line);
    position: absolute;
    left: -20px;
    color: var(--text-muted);
    opacity: 0.5;
    font-size: 0.85em;
}

.code-container .function {
    color: var(--code-purple);
    font-weight: 500;
}

.code-container .variable {
    color: var(--code-blue);
}

.code-container .property {
    color: var(--highlight-color);
}

.code-container .comment {
    color: var(--text-muted);
    font-style: italic;
}

.code-container .string {
    color: var(--code-green);
}

/* Add typing animation to the code */
.typing-animation {
    border-right: 2px solid var(--highlight-color);
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--highlight-color)
    }
}

/* About Section */
.about {
    background-color: var(--background-dark);
}

.about-content {
    display: flex;
    gap: 50px;
    align-items: center;
}

.about-image {
    flex: 1;
}

.image-frame {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--background-card), var(--background-darker));
    position: relative;
    overflow: hidden;
}

.image-placeholder::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right,
            rgba(138, 43, 226, 0.1),
            rgba(106, 90, 205, 0.1),
            rgba(147, 112, 219, 0.1));
    transform: rotate(30deg);
    animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
    0% {
        transform: rotate(30deg) translate(-30%, -30%);
    }

    100% {
        transform: rotate(30deg) translate(30%, 30%);
    }
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.about-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.detail {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.detail i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 5px;
}

.detail h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.detail p {
    margin-bottom: 5px;
    color: var(--text-secondary);
}

/* Projects Section */
.projects {
    background-color: var(--background-darker);
    position: relative;
    overflow: hidden;
}

/* Expertise Section */
.expertise {
    background-color: var(--background-dark);
    position: relative;
    overflow: hidden;
}

.expertise::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 50%, rgba(138, 43, 226, 0.15), transparent 40%);
    z-index: 0;
}

.expertise-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 1;
}

.expertise-card {
    background-color: var(--terminal-black);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-speed) ease;
    text-align: center;
    border: 1px solid rgba(138, 43, 226, 0.2);
    position: relative;
    overflow: hidden;
}

.expertise-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(138, 43, 226, 0.2);
    border-color: rgba(138, 43, 226, 0.4);
}

.expertise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg,
            var(--primary-color),
            var(--highlight-color),
            var(--secondary-color));
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.expertise-card:hover::before {
    opacity: 1;
}

.expertise-card::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.2), transparent 70%);
    border-radius: 50%;
    opacity: 0.5;
    transition: all 0.5s ease;
}

.expertise-card:hover::after {
    transform: scale(1.5);
}

.expertise-card i {
    font-size: 3rem;
    color: var(--highlight-color);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 15px rgba(0, 255, 170, 0.3);
    transition: all var(--transition-speed) ease;
}

.expertise-card:hover i {
    transform: scale(1.1);
    text-shadow: 0 0 20px rgba(0, 255, 170, 0.5);
}

.expertise-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.expertise-card h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--highlight-color);
    transition: width var(--transition-speed) ease;
}

.expertise-card:hover h3::after {
    width: 100%;
}

.expertise-card p {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', monospace;
    position: relative;
    text-align: left;
    padding-left: 15px;
    line-height: 1.6;
    font-size: 0.9rem;
}

.expertise-card p::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.projects::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(138, 43, 226, 0.15), transparent 40%);
    z-index: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 1;
}

.project-card {
    background-color: var(--terminal-black);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border: 1px solid rgba(138, 43, 226, 0.2);
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(138, 43, 226, 0.2);
    border: 1px solid rgba(138, 43, 226, 0.4);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: var(--background-darker);
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
    z-index: 1;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 15px;
    width: 10px;
    height: 10px;
    background-color: #ff5f56;
    border-radius: 50%;
    box-shadow:
        18px 0 0 #ffbd2e,
        36px 0 0 #27c93f;
    z-index: 2;
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    margin-top: 30px;
}

.project-image .image-placeholder {
    position: relative;
}

.project-image .image-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            var(--background-card) 25%,
            var(--background-darker) 25%,
            var(--background-darker) 50%,
            var(--background-card) 50%,
            var(--background-card) 75%,
            var(--background-darker) 75%,
            var(--background-darker) 100%);
    background-size: 20px 20px;
    opacity: 0.1;
    animation: backgroundMove 30s linear infinite;
}

@keyframes backgroundMove {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 50px 50px;
    }
}

.project-info {
    padding: 25px;
    position: relative;
}

.project-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25px;
    right: 25px;
    height: 1px;
    background: linear-gradient(to right,
            transparent,
            rgba(138, 43, 226, 0.3),
            transparent);
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--highlight-color);
    font-weight: 600;
}

.project-info p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.6;
    position: relative;
    padding-left: 15px;
    font-size: 0.9rem;
}

.project-info p::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.project-tags span {
    background-color: rgba(138, 43, 226, 0.1);
    color: var(--highlight-color);
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(138, 43, 226, 0.3);
    font-family: 'JetBrains Mono', monospace;
}

.project-links {
    display: flex;
    gap: 15px;
}

/* Skills Section */
.skills {
    background-color: var(--background-dark);
}

.skills-content {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.skills-category h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.skills-category h3::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 3px;
    background: var(--gradient-primary);
    bottom: 0;
    left: 0;
    border-radius: 2px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.skill-item {
    background-color: var(--terminal-black);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-speed) ease;
    border: 1px solid rgba(138, 43, 226, 0.1);
    position: relative;
    overflow: hidden;
}

.skill-item:hover {
    transform: translateY(-5px);
    border-color: rgba(138, 43, 226, 0.3);
    box-shadow: 0 10px 25px rgba(138, 43, 226, 0.1);
}

.skill-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(138, 43, 226, 0.05) 0%,
            transparent 50%,
            rgba(0, 255, 170, 0.05) 100%);
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.skill-item:hover::before {
    opacity: 1;
}

.skill-icon {
    font-size: 2.5rem;
    color: var(--highlight-color);
    margin-bottom: 15px;
    transition: all var(--transition-speed) ease;
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.2);
}

.skill-item:hover .skill-icon {
    transform: scale(1.1);
    text-shadow: 0 0 15px rgba(0, 255, 170, 0.4);
}

.skill-item h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.skill-item h4::before {
    content: '{ ';
    color: var(--primary-color);
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.skill-item h4::after {
    content: ' }';
    color: var(--primary-color);
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.skill-item:hover h4::before,
.skill-item:hover h4::after {
    opacity: 1;
}

.skill-bar {
    width: 100%;
    height: 8px;
    background-color: var(--background-darker);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.skill-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    animation: shimmer 2s infinite linear;
    transform: translateX(-100%);
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.skill-level {
    height: 100%;
    background: linear-gradient(90deg,
            var(--primary-color),
            var(--highlight-color));
    border-radius: 4px;
    position: relative;
    animation: skillFill 2s ease-out forwards;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

@keyframes skillFill {
    from {
        width: 0;
    }
}

/* Contact Section */
.contact {
    background-color: var(--background-darker);
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(138, 43, 226, 0.15), transparent 40%);
    z-index: 0;
}

.contact-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
    position: relative;
    z-index: 1;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 5px;
}

.contact-item h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.contact-item p {
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--background-card);
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: all var(--transition-speed) ease;
}

.social-icon:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

.contact-form {
    background-color: var(--background-card);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Poppins', 'Cairo', sans-serif;
    transition: border-color var(--transition-speed) ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Footer */
footer {
    background-color: var(--background-darker);
    padding: 60px 0 30px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.footer-logo h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    color: var(--text-muted);
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

/* Animation Classes */
.animate-text {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
    animation-delay: calc(var(--index, 0) * 0.2s);
    position: relative;
    z-index: 30 !important;
    /* زيادة z-index بشكل كبير واستخدام !important */
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 3rem;
    }

    .about-content {
        flex-direction: column;
    }

    .image-frame {
        margin: 0 auto 40px;
    }
}

@media (max-width: 768px) {

    /* Header adjustments */
    header {
        padding: 10px 0;
    }

    header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
    }

    .logo {
        margin-bottom: 0;
    }

    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
        z-index: 1001;
    }

    /* Navigation for mobile */
    nav {
        position: fixed;
        top: 30px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 30px);
        background-color: var(--terminal-black);
        border-left: 1px solid rgba(138, 43, 226, 0.3);
        padding: 20px;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        margin: 20px 0;
        gap: 15px;
        align-items: flex-start;
    }

    nav ul li {
        margin: 0;
        width: 100%;
    }

    nav ul li a {
        font-size: 1rem;
        padding: 10px 0;
        display: block;
        width: 100%;
        border-bottom: 1px solid rgba(138, 43, 226, 0.2);
    }

    /* Hero section adjustments */
    .hero .container {
        flex-direction: column;
    }

    .hero-content {
        text-align: center;
        margin-bottom: 50px;
    }

    .cta-buttons {
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    /* Code container adjustments */
    .code-container {
        max-width: 100%;
    }

    /* Projects grid */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Expertise grid */
    .expertise-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    /* Terminal header */
    .terminal-title {
        font-size: 0.8rem;
    }
}

/* Hero section adjustments */
.hero .container {
    flex-direction: column;
}

.hero-content {
    text-align: center;
    margin-bottom: 50px;
}

.cta-buttons {
    justify-content: center;
}

.hero-content h1 {
    font-size: 2.5rem;
}

/* Code container adjustments */
.code-container {
    max-width: 100%;
}

/* Projects grid */
.projects-grid {
    grid-template-columns: 1fr;
    gap: 30px;
}

/* Expertise grid */
.expertise-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Footer */
.footer-content {
    flex-direction: column;
    gap: 30px;
    text-align: center;
}

/* Terminal header */
.terminal-title {
    font-size: 0.8rem;
}
}

@media (max-width: 480px) {

    /* Section headers */
    .section-header h2 {
        font-size: 1.8rem;
    }

    .section-header::before,
    .section-header::after {
        font-size: 0.8rem;
    }

    /* Hero section */
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* Skills grid */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    /* Contact section */
    .contact-content {
        grid-template-columns: 1fr;
    }

    /* Terminal header adjustments for mobile */
    .terminal-title {
        font-size: 0.7rem;
    }

    .terminal-actions {
        display: none;
    }

    /* Code container adjustments */
    .code-container {
        font-size: 0.7rem;
        padding: 15px;
    }

    .code-container pre {
        margin-top: 15px;
        font-size: 0.7rem;
    }

    /* Project cards adjustments */
    .project-card::after {
        left: 10px;
        width: 8px;
        height: 8px;
        box-shadow:
            15px 0 0 #ffbd2e,
            30px 0 0 #27c93f;
    }

    .project-info h3 {
        font-size: 1.3rem;
    }

    .project-info p {
        font-size: 0.8rem;
    }

    .project-tags span {
        font-size: 0.7rem;
        padding: 3px 10px;
    }

    /* Expertise cards adjustments */
    .expertise-card {
        padding: 20px;
    }

    .expertise-card i {
        font-size: 2.5rem;
    }

    .expertise-card h3 {
        font-size: 1.3rem;
    }

    .expertise-card p {
        font-size: 0.8rem;
    }

    /* Floating code elements */
    .floating-code-elements {
        display: none;
        /* Hide on mobile to improve performance */
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .section-header::before,
    .section-header::after {
        font-size: 0.8rem;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    /* Terminal header adjustments for mobile */
    .terminal-title {
        font-size: 0.7rem;
    }

    .terminal-actions {
        display: none;
    }

    /* Code container adjustments */
    .code-container {
        font-size: 0.7rem;
        padding: 15px;
    }

    .code-container pre {
        margin-top: 15px;
        font-size: 0.7rem;
    }

    /* Project cards adjustments */
    .project-card::after {
        left: 10px;
        width: 8px;
        height: 8px;
        box-shadow:
            15px 0 0 #ffbd2e,
            30px 0 0 #27c93f;
    }

    .project-info h3 {
        font-size: 1.3rem;
    }

    .project-info p {
        font-size: 0.8rem;
    }

    .project-tags span {
        font-size: 0.7rem;
        padding: 3px 10px;
    }

    /* Expertise cards adjustments */
    .expertise-card {
        padding: 20px;
    }

    .expertise-card i {
        font-size: 2.5rem;
    }

    .expertise-card h3 {
        font-size: 1.3rem;
    }

    .expertise-card p {
        font-size: 0.8rem;
    }

    /* Floating code elements */
    .floating-code-elements {
        display: none;
        /* Hide on mobile to improve performance */
    }
}