/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --secondary-color: #3730a3;
    --text-color: #f8fafc;
    --bg-color: rgba(15, 23, 42, 0.9);
    --accent-color: rgba(79, 70, 229, 0.1);
    --gradient-start: #4f46e5;
    --gradient-end: #3730a3;
    --card-bg: rgba(30, 41, 59, 0.8);
    --nav-bg: rgba(15, 23, 42, 0.95);
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* تحويل المظهر */
    --transition-speed: 0.3s;
}

/* متغيرات الوضع الفاتح */
.light-mode {
    --primary-color: #4f46e5;
    --secondary-color: #3730a3;
    --text-color: #000000;
    --bg-color: rgba(248, 250, 252, 0.9);
    --accent-color: rgba(79, 70, 229, 0.1);
    --gradient-start: #4f46e5;
    --gradient-end: #3730a3;
    --card-bg: rgba(255, 255, 255, 0.8);
    --nav-bg: rgba(248, 250, 252, 0.95);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
    background: linear-gradient(135deg, var(--bg-color), rgba(23, 31, 50, 0.9));
    position: relative;
    transition: background var(--transition-speed) ease;
}

.light-mode body::before {
    background: 
        linear-gradient(45deg, transparent 48%, rgba(79, 70, 229, 0.05) 50%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(79, 70, 229, 0.05) 50%, transparent 52%);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 48%, rgba(79, 70, 229, 0.1) 50%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(79, 70, 229, 0.1) 50%, transparent 52%);
    background-size: 30px 30px;
    pointer-events: none;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
    transition: background var(--transition-speed) ease;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes rotateIn {
    from { transform: rotate(-180deg) scale(0); opacity: 0; }
    to { transform: rotate(0) scale(1); opacity: 1; }
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Enhanced Navbar Styles */
.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
    transition: all 0.3s var(--animation-timing);
}

.navbar.scrolled {
    padding: 1rem 4rem;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
    box-shadow: 0 4px 20px rgba(100, 255, 218, 0.1);
}

.nav-links a {
    background: linear-gradient(135deg, #64ffda, #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #64ffda, #4f46e5);
    transition: width 0.3s ease;
}

.nav-links a:hover::before {
    width: 100%;
}

.nav-links a:hover {
    transform: translateY(-1px);
}

.nav-links a.active::before {
    width: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #64ffda, #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #64ffda, #4f46e5);
    border-radius: 50%;
    bottom: 5px;
    right: -12px;
    box-shadow: 
        0 0 10px rgba(100, 255, 218, 0.5),
        0 0 20px rgba(79, 70, 229, 0.3);
    animation: dotPulse 2s infinite ease-in-out;
    -webkit-background-clip: padding-box;
    background-clip: padding-box;
    border: 1px solid transparent;
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s var(--animation-timing);
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    opacity: 0;
    transition: opacity 0.3s var(--animation-timing);
    z-index: -1;
    border-radius: 8px;
}

.nav-link:hover::before {
    opacity: 0.1;
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-link:hover {
    transform: translateY(-2px);
}

.contact-btn {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s var(--animation-timing);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.menu-btn {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 1100;
}

.menu-btn span {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s var(--animation-timing);
}

.menu-btn span:first-child {
    top: 0;
}

.menu-btn span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.menu-btn span:last-child {
    bottom: 0;
}

.menu-btn.active span:first-child {
    transform: rotate(45deg);
    top: 9px;
}

.menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active span:last-child {
    transform: rotate(-45deg);
    bottom: 9px;
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 2rem;
        background: rgba(15, 23, 42, 0.98);
    }

    .menu-btn {
        display: block;
        width: 24px;
        height: 20px;
        position: relative;
        cursor: pointer;
        z-index: 1001;
    }

    .menu-btn span {
        position: absolute;
        width: 100%;
        height: 2px;
        background: #64ffda;
        transition: all 0.3s ease;
    }

    .menu-btn span:first-child { top: 0; }
    .menu-btn span:nth-child(2) { top: 50%; transform: translateY(-50%); }
    .menu-btn span:last-child { bottom: 0; }

    .nav-links {
        position: fixed;
        top: 55px;
        right: 20px;
        width: 120px;
        height: auto;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        padding: 0.5rem;
        display: none !important;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.4rem;
        z-index: 999;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links li {
        width: 100%;
        text-align: right;
        list-style: none;
    }

    .nav-links a {
        display: block;
        padding: 0.35rem 0.8rem;
        font-size: 0.9rem;
        width: 100%;
        text-align: right;
        background: linear-gradient(135deg, #64ffda, #4f46e5) !important;
        -webkit-background-clip: text !important;
        background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        text-decoration: none;
        border-radius: 4px;
    }

    .nav-links a:hover,
    .nav-links a:active,
    .nav-links a:focus {
        background: linear-gradient(135deg, #64ffda, #4f46e5) !important;
        -webkit-background-clip: text !important;
        background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        transform: none !important;
    }

    .nav-links a::before,
    .nav-links a::after {
        display: none !important;
    }

    .menu-btn.active span:first-child {
        transform: rotate(45deg);
        top: 9px;
    }

    .menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-btn.active span:last-child {
        transform: rotate(-45deg);
        bottom: 9px;
    }
}

/* Hero Section */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--accent-color) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    animation: float 6s ease-in-out infinite;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.hero-content h1::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    filter: blur(20px);
    opacity: 0.3;
    z-index: -1;
}

.typing-container {
    display: inline-flex;
    align-items: center;
    font-size: 2rem;
    margin: 1rem 0;
    min-height: 50px;
}

.static-text {
    margin-right: 0.5rem;
    color: var(--text-color);
}

.dynamic-text {
    color: #64ffda;
    border-right: 3px solid #64ffda;
    padding-right: 5px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { border-color: transparent }
    50% { border-color: #64ffda }
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes erasing {
    from { width: 100% }
    to { width: 0 }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-color);
    border-radius: 15px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 8px;
    background: var(--text-color);
    left: 50%;
    transform: translateX(-50%);
    top: 8px;
    border-radius: 2px;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 20px); opacity: 0; }
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    z-index: 1001;
    box-shadow: 0 0 10px var(--primary-color);
    transition: width 0.1s var(--animation-timing);
}

/* Custom Cursor */
.cursor {
    display: inline-block;
    width: 2px;
    background: #4f46e5; /* match your theme's accent color */
    animation: blink 0.8s infinite;
    margin-left: 2px;
    vertical-align: middle;
  }
  
  .custom-pointer {
    width: 10px;
    height: 10px;
    background: #4f46e5;
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.1s ease;
}


  @keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
  }

.cursor-clicked {
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s var(--animation-timing);
    margin: 0.5rem;
    position: relative;
    overflow: hidden;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
}

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

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

.btn.primary::before {
    display: none;
}

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

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

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.skill-category {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s var(--animation-timing);
    transform: perspective(1000px);
}

.skill-category:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.skill-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

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

.skill-category:hover .progress {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px var(--primary-color); }
    50% { box-shadow: 0 0 15px var(--primary-color); }
    100% { box-shadow: 0 0 5px var(--primary-color); }
}

.progress {
    position: relative;
    overflow: hidden;
}

.progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shine 2s infinite;
}

/* Projects Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.project-card {
    position: relative;
    overflow: hidden;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s var(--animation-timing);
    transform-style: preserve-3d;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--mouse-x) var(--mouse-y),
        rgba(79, 70, 229, 0.3) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s var(--animation-timing);
}

.project-card:hover {
    transform: translateY(-10px) rotateX(5deg);
}

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

.project-content {
    padding: 2rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.project-tech span {
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Contact Section */
.contact-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.contact-info {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-details {
    margin-top: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.contact-item i {
    color: var(--primary-color);
}

.contact-item a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--primary-color);
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    backdrop-filter: blur(10px);
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    font-family: inherit;
    transition: all 0.3s var(--animation-timing);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

.form-group input:focus ~ .focus-border,
.form-group textarea:focus ~ .focus-border {
    width: 100%;
}

.form-group .focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    transition: width 0.3s var(--animation-timing);
}

input, textarea {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.social-links a {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s var(--animation-timing);
}

.social-links a::before {
    content: '';
    position: absolute;
    inset: -5px;
    background: radial-gradient(circle at center, var(--primary-color) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s var(--animation-timing);
}

.social-links a:hover {
    transform: translateY(-5px);
}

.social-links a:hover::before {
    opacity: 0.5;
    animation: pulse 1.5s infinite;
}

/* Experience Timeline */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent,
        var(--primary-color),
        transparent
    );
    left: 50%;
    transform: translateX(-50%);
    top: 0;
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
    width: 50%;
    padding: 0 2rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-content {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s var(--animation-timing);
    transform-style: preserve-3d;
}

.timeline-content:hover {
    transform: scale(1.02) rotateX(2deg);
}

.timeline-content::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary-color);
    top: 50%;
    transform: translateY(-50%);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -42px;
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -42px;
}

.timeline-date {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0.5rem 0;
}

.timeline-details {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.timeline-details li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.timeline-details li::before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* Skills Bars */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-bar {
    width: 100%;
}

.skill-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.bar {
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    height: 8px;
    border-radius: 4px;
}

.progress {
    position: relative;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    box-shadow: 0 0 10px var(--primary-color);
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s ease;
}

.progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shine 2s infinite;
}

/* Section Transitions */
section {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s var(--animation-timing);
}

section.hidden {
    opacity: 0;
    transform: translateY(30px);
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .nav-links {
        display: none;
    }

    .menu-btn {
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
    }

    .menu-btn span {
        width: 25px;
        height: 2px;
        background: var(--text-color);
        transition: 0.3s;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .typing-text {
        font-size: 1.4rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 2rem;
    }

    .timeline-item:nth-child(odd) .timeline-content::before,
    .timeline-item:nth-child(even) .timeline-content::before {
        left: -32px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}

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

section {
    position: relative;
    z-index: 1;
    animation: fadeIn 1s ease-out;
    padding: 6rem 1rem;
}

section:nth-child(even) {
    background: var(--bg-color);
}

/* Notification Animation */
.notification {
    animation: slideInRight 0.3s var(--animation-timing),
               slideOutRight 0.3s var(--animation-timing) 2.7s forwards;
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading Animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* زر تبديل المظهر */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text-color);
    border: none;
    cursor: pointer;
    margin-left: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 1.2rem;
    transition: transform 0.5s ease;
}

.theme-toggle:focus {
    outline: none;
}

@media (max-width: 768px) {
    .theme-toggle {
        margin-right: 50px;
    }
}

/* تعديلات إضافية للوضع الفاتح */
.light-mode .navbar {
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(79, 70, 229, 0.2);
}

.light-mode .navbar.scrolled {
    background: var(--nav-bg);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.1);
}

.light-mode body {
    background: linear-gradient(135deg, var(--bg-color), rgba(240, 245, 250, 0.9));
}

.light-mode .hero::before {
    background: radial-gradient(circle at center, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
}

.light-mode .skill-category,
.light-mode .project-card,
.light-mode .timeline-content,
.light-mode .form-group input,
.light-mode .form-group textarea,
.light-mode .social-links a {
    background: var(--card-bg);
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.light-mode .menu-btn span {
    background: var(--text-color);
}

.light-mode footer {
    background: var(--nav-bg);
    border-top: 1px solid rgba(79, 70, 229, 0.1);
}

.light-mode .scroll-indicator .mouse {
    border-color: var(--text-color);
}

.light-mode .scroll-indicator .mouse::before {
    background: var(--text-color);
}

.light-mode .static-text {
    color: var(--text-color);
}

.light-mode .contact-item a,
.light-mode .contact-item span {
    color: var(--text-color);
}

.light-mode .btn.secondary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.light-mode .btn {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.light-mode .btn:hover,
.light-mode .btn.primary:hover,
.light-mode .btn.secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* تعديلات إضافية للعناوين والنصوص */
.light-mode h2,
.light-mode h3,
.light-mode p,
.light-mode li,
.light-mode .skill-label,
.light-mode .timeline-date,
.light-mode .timeline-details li,
.light-mode .skill-item span {
    color: var(--text-color);
}

.light-mode .form-group input::placeholder,
.light-mode .form-group textarea::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.light-mode .form-group input,
.light-mode .form-group textarea {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.5);
}

.light-mode .scroll-indicator p {
    color: var(--text-color);
}

.light-mode footer p {
    color: var(--text-color);
}

.light-mode .skill-item span {
    color: var(--text-color);
}

.light-mode .dynamic-text {
    color: #4f46e5; /* لون بنفسجي غامق ليكون أكثر وضوحاً في الوضع الفاتح */
    border-right-color: #4f46e5;
}

.light-mode .form-group input::placeholder,
.light-mode .form-group textarea::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

/* Certificates Section Styles */
.certificates {
    padding: 6rem 1rem;
    background: var(--bg-color);
}

.certificates h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #64ffda, #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.certificates h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #64ffda, #4f46e5);
    border-radius: 2px;
}

.certificates-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.certificate-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid rgba(100, 255, 218, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s var(--animation-timing);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

.certificate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(100, 255, 218, 0.05), rgba(79, 70, 229, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.certificate-card:hover {
    transform: translateY(-10px);
    border-color: rgba(100, 255, 218, 0.3);
    box-shadow: 0 20px 40px rgba(100, 255, 218, 0.1);
}

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

.certificate-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #64ffda, #4f46e5);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.certificate-icon i {
    font-size: 1.8rem;
    color: white;
}

.certificate-content {
    position: relative;
    z-index: 1;
}

.certificate-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.certificate-issuer {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.certificate-date {
    color: rgba(100, 255, 218, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.certificate-description {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.certificate-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.certificate-skills span {
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Light mode specific styles for certificates */
.light-mode .certificates {
    background: var(--bg-color);
}

.light-mode .certificate-card {
    background: var(--card-bg);
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.light-mode .certificate-content h3,
.light-mode .certificate-description,
.light-mode .certificate-date {
    color: var(--text-color);
}

.light-mode .certificate-issuer {
    color: var(--primary-color);
}

.light-mode .certificate-date {
    color: var(--primary-color);
    opacity: 0.8;
}

/* Responsive design for certificates */
@media (max-width: 768px) {
    .certificates-container {
        grid-template-columns: 1fr;
        padding: 0 1rem;
        gap: 1.5rem;
    }
    
    .certificate-card {
        padding: 1.5rem;
    }
    
    .certificates h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .certificate-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }
    
    .certificate-icon i {
        font-size: 1.5rem;
    }
    
    .certificate-content h3 {
        font-size: 1.2rem;
    }
}

/* Certificate Button Styles */
.certificate-btn {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.certificate-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: left 0.5s;
}

.certificate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.certificate-btn:hover::before {
    left: 100%;
}

.certificate-btn i {
    font-size: 0.8rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    height: 90%;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(79, 70, 229, 0.2);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    border-radius: 15px 15px 0 0;
    position: relative;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.modal-body {
    padding: 0;
    height: calc(100% - 120px);
    overflow: hidden;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-body img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8f9fa;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.modal-body img:hover {
    transform: scale(1.02);
}

.modal-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border-top: 1px solid rgba(79, 70, 229, 0.1);
    display: flex;
    justify-content: center;
}

/* Light mode modal styles */
.light-mode .modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.light-mode .modal-body img {
    background: #ffffff;
}

.light-mode .modal-footer {
    background: var(--card-bg);
    border-top: 1px solid rgba(79, 70, 229, 0.1);
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }
    
    .modal-header {
        padding: 0.8rem 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .close {
        right: 1rem;
        font-size: 1.5rem;
        width: 30px;
        height: 30px;
    }
    
    .modal-footer {
        padding: 0.8rem 1rem;
    }
    
    .certificate-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
}
