/* Variables for Theme Colors */
:root {
    --bg-dark: #0a0f16;
    --bg-card: #131a26;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* Typography & Titles */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: transparent;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(10, 15, 22, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo { font-size: 1.5rem; font-weight: 800; }
.logo .dot { color: var(--accent-purple); }

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--accent-blue); }

/* Language Button Styles */
.lang-toggle {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--text-primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
}

.lang-toggle:hover { background: var(--accent-blue); color: #fff; }

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5%;
    padding-top: 5rem;
    background: radial-gradient(circle at top, #1a2235 0%, var(--bg-dark) 70%);
}

.hero-content { max-width: 800px; }
.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; }
.hero h1 .highlight { color: transparent; background: var(--gradient); -webkit-background-clip: text; background-clip: text; }
.hero h2 { font-size: 1.5rem; color: var(--text-secondary); margin-bottom: 1.5rem; font-weight: 500; }
.hero p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 2rem; }

.btn {
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5); }
.btn-secondary { background: transparent; color: var(--text-primary); border: 2px solid var(--accent-blue); }

html[dir="ltr"] .btn-secondary { margin-right: 1rem; margin-left: 0; }
html[dir="rtl"] .btn-secondary { margin-left: 1rem; margin-right: 0; }
.btn-secondary:hover { background: rgba(59, 130, 246, 0.1); transform: translateY(-3px); }

/* Skills Grid */
.skills { padding: 5rem 5%; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.skill-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}
.skill-card i { font-size: 2.5rem; color: var(--accent-blue); margin-bottom: 1rem; }
.skill-card:hover { transform: translateY(-10px); box-shadow: 0 10px 30px rgba(59, 130, 246, 0.1); border-color: var(--accent-purple); }
.skill-card h3 { margin-bottom: 1rem; }
.skill-card p { color: var(--text-secondary); font-size: 0.95rem; }

/* ---------------------------------------------------
   MODERN CONNECTED EXPERIENCE SECTION
------------------------------------------------------ */
.experience {
    padding: 5rem 10%;
    background: rgba(19, 26, 38, 0.4);
}

.modern-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 2rem; 
    border-left: 2px solid rgba(139, 92, 246, 0.3); 
}

html[dir="rtl"] .modern-timeline {
    padding-left: 0;
    padding-right: 2rem;
    border-left: none;
    border-right: 2px solid rgba(139, 92, 246, 0.3);
}

.modern-exp-card {
    position: relative;
    margin-bottom: 3rem;
}

.exp-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--bg-dark);
    border: 3px solid var(--accent-blue);
    border-radius: 50%;
    top: 5px;
    left: -2.6rem;
    box-shadow: 0 0 10px var(--accent-blue);
    transition: all 0.3s ease;
}

html[dir="rtl"] .exp-dot {
    left: auto;
    right: -2.6rem;
}

.modern-exp-card:hover .exp-dot {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px var(--accent-purple);
    transform: scale(1.2);
}

.exp-content {
    background: rgba(19, 26, 38, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.modern-exp-card:hover .exp-content {
    background: rgba(19, 26, 38, 0.9);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateX(5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

html[dir="rtl"] .modern-exp-card:hover .exp-content {
    transform: translateX(-5px);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.exp-header h3 { color: var(--accent-blue); font-size: 1.4rem; margin-bottom: 0.3rem; }
.exp-header h4 { color: var(--text-primary); font-weight: 500; font-size: 1rem; }
.exp-date {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.exp-bullets { list-style: none; padding: 0; margin-bottom: 1.5rem;}
.exp-bullets li {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 1.5rem;
}
html[dir="rtl"] .exp-bullets li { padding-left: 0; padding-right: 1.5rem; }
.exp-bullets li::before { content: '▹'; position: absolute; left: 0; color: var(--accent-blue); font-size: 1.2rem;}
html[dir="rtl"] .exp-bullets li::before { left: auto; right: 0; }

.exp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.exp-tags span {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s;
}

.modern-exp-card:hover .exp-tags span {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

/* ---------------------------------------------------
   MODERN EDUCATION SECTION
------------------------------------------------------ */
.education { padding: 5rem 5%; position: relative; z-index: 1; background: rgba(19, 26, 38, 0.2); }
.education-container { max-width: 700px; margin: 0 auto; }

.modern-edu-card {
    position: relative;
    background: rgba(19, 26, 38, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.4s ease;
    overflow: hidden;
}

.modern-edu-card::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 4px;
    background: var(--gradient);
    border-radius: 0 0 10px 10px;
    transition: width 0.4s ease;
}

.modern-edu-card:hover {
    transform: translateY(-10px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(139, 92, 246, 0.1);
}

.modern-edu-card:hover::before {
    width: 100%;
    border-radius: 0;
}

.edu-icon-wrapper {
    width: 80px; height: 80px;
    margin: 0 auto 1.5rem auto;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.4s ease;
}

.modern-edu-card:hover .edu-icon-wrapper {
    background: var(--gradient);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.edu-icon-wrapper i {
    font-size: 2.5rem;
    color: var(--accent-blue);
    transition: color 0.4s ease;
}

.modern-edu-card:hover .edu-icon-wrapper i {
    color: #fff;
}

.edu-date-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s;
}

.modern-edu-card:hover .edu-date-badge {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
}

.edu-details h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.edu-details h4 {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Projects Section */
.projects { padding: 5rem 5%; background: rgba(19, 26, 38, 0.3); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.project-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s ease;
    text-align: center;
}
.project-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--gradient); transform: scaleX(0); transform-origin: right; transition: transform 0.4s ease; }
html[dir="ltr"] .project-card::before { transform-origin: left; }
.project-card:hover::before { transform: scaleX(1); }
.project-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(139, 92, 246, 0.15); }
.project-card h3 { margin-bottom: 1rem; font-size: 1.3rem; }
.project-card p { color: var(--text-secondary); }

/* Contact Section */
.contact { padding: 5rem 5%; text-align: center; background: radial-gradient(circle at bottom, #1a2235 0%, var(--bg-dark) 70%); }

.contact-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.contact-card {
    background: rgba(19, 26, 38, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem 1.5rem;
    border-radius: 15px;
    text-decoration: none;
    color: var(--text-primary);
    width: 260px;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.contact-card:hover::before {
    transform: scaleX(1);
}

.contact-card:hover {
    transform: translateY(-10px);
    background: rgba(19, 26, 38, 0.9);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.15);
}

.contact-card i {
    font-size: 2.8rem;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    transition: transform 0.3s;
}

.contact-card:hover i {
    transform: scale(1.1);
    color: var(--accent-purple);
}

.contact-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

footer { text-align: center; padding: 2rem; border-top: 1px solid rgba(255, 255, 255, 0.05); color: var(--text-secondary); }

/* Animations & Responsiveness */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 2.5rem; }
    .hero-buttons .btn { display: block; margin: 1rem 0; }
    .modern-timeline { padding-left: 1.5rem; }
    html[dir="rtl"] .modern-timeline { padding-right: 1.5rem; padding-left: 0; }
    .exp-dot { left: -2.1rem; }
    html[dir="rtl"] .exp-dot { right: -2.1rem; left: auto;}
    .contact-card { width: 100%; max-width: 300px; }
}