:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #ec4899;
    --secondary-dark: #db2777;
    --text-light: #6b7280;
    --text-dark: #1f2937;
    --bg-light: #ffffff;
    --bg-dark: #111827;
    --card-light: #f9fafb;
    --card-dark: #1f2937;
    --transition: all 0.3s ease;
}

.dark-mode {
    --text-light: #d1d5db;
    --text-dark: #f9fafb;
    --bg-light: #111827;
    --bg-dark: #f9fafb;
    --card-light: #1f2937;
    --card-dark: #f9fafb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: var(--transition);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: var(--bg-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.theme-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.hero {
    padding: 160px 0 80px;
    text-align: center;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 40px;
}

.btn-group {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: white;
}

section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.section-title p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

.about-content h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.about-content p {
    color: var(--text-light);
    margin-bottom: 30px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.skill-card {
    background-color: var(--card-light);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.skill-card h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.skill-item {
    margin-bottom: 15px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.skill-bar {
    height: 10px;
    background-color: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--primary);
}

.timeline-item {
    width: 50%;
    padding: 30px;
    position: relative;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 50px;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 50px;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 50%;
    position: absolute;
    top: 40px;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-content {
    background-color: var(--card-light);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.timeline-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.timeline-content p {
    color: var(--text-light);
    margin-bottom: 10px;
}

.timeline-date {
    font-weight: 600;
    color: var(--primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--card-light);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-content {
    padding: 20px;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.project-content p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.project-tag {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

/* hover contact icons */
.contact-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.social-link {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: #fff;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* النص اللي بيظهر */
.social-link::after {
    content: attr(data-label);
    position: absolute;
    left: 70px;
    /* المسافة من الأيقونة */
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    font-size: 16px;
    color: #333;
    /* الافتراضي Light Mode */
    white-space: nowrap;
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.social-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* لما يكون Dark Mode */
body.dark-mode .social-link::after {
    color: #fff;
}

/* back to top icon  */
#backToTop {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    border: none;
    outline: none;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    font-size: 18px;
    transition: 0.3s ease;
}

#backToTop:hover {
    background-color: #5a2d0c;
}

/* 🌙 Dark Mode */
body.dark-mode #backToTop {
    background-color: #f5f5dc;
    color: #111;
}

body.dark-mode #backToTop:hover {
    background-color: #d2b48c;
}


.contact-text h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.contact-text p {
    color: var(--text-light);
}

.contact-form {
    background-color: var(--card-light);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

footer {
    background-color: var(--card-light);
    padding: 40px 0;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.social-link {
    width: 50px;
    height: 50px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
}

.copyright {
    color: var(--text-light);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        padding: 0 0 30px 50px;
        left: 0 !important;
        text-align: left !important;
    }

    .timeline-item:nth-child(odd) {
        padding-right: 0;
    }

    .timeline-item:nth-child(even) {
        padding-left: 50px;
    }

    .timeline-dot {
        left: 10px !important;
        right: auto !important;
    }
}