/* --- Variables & Reset --- */
:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8; /* Bright Blue */
    --accent-hover: #0ea5e9;
    --border: #334155;
    --gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navigation --- */
.navbar {
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 30px; }

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--accent); }

.btn-contact {
    border: 1px solid var(--accent);
    padding: 8px 20px;
    border-radius: 50px;
    color: var(--accent) !important;
    transition: all 0.3s;
}

.btn-contact:hover {
    background: var(--accent);
    color: white !important;
}

.hamburger { display: none; color: var(--text-main); font-size: 1.5rem; cursor: pointer; }

/* --- Hero Section --- */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding-top: 20px;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin: 20px 0;
}

.hero-text h1 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.hero-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-btns { display: flex; gap: 15px; margin-bottom: 30px; }

.btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-main);
}

.social-links { display: flex; gap: 20px; }
.social-links a {
    color: var(--text-muted);
    font-size: 1.5rem;
    transition: color 0.3s;
}
.social-links a:hover { color: var(--accent); }

.hero-img {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-img img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--card-bg);
    box-shadow: 0 20px 50px rgba(56, 189, 248, 0.2);
}

.experience-badge {
    position: absolute;
    bottom: 20px;
    right: 40px;
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    border: 1px solid var(--border);
}

.experience-badge span {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
}

.experience-badge p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Section Styling --- */
.section { padding: 40px 0; }
.section-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* --- About & Skills --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.languages-box h3, .skills-content h3 { margin-bottom: 20px; }

.lang-item { margin-bottom: 15px; }
.lang-item span { display: block; margin-bottom: 5px; font-size: 0.9rem; }
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.progress {
    height: 100%;
    background: var(--gradient);
}

.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tags span {
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

/* --- Experience Timeline --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 30px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    border: 4px solid var(--bg-color);
}
.date {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 5px;
    font-weight: 600;
}
.timeline-item h3 { font-size: 1.25rem; margin-bottom: 5px; }
.timeline-item h4 { color: var(--text-muted); font-size: 1rem; margin-bottom: 10px; }
.timeline-item p { color: var(--text-muted); font-size: 0.95rem; }

/* --- Projects --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.project-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: transform 0.3s, border-color 0.3s;
}
.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}
.card-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 20px;
}
.project-card h3 { margin-bottom: 10px; }
.project-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 15px; }
.tag {
    display: inline-block;
    font-size: 0.75rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 5px;
}

/* --- Contact --- */
.contact-wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.contact-box {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    width: 250px;
    text-align: center;
    border: 1px solid var(--border);
}
.contact-box i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 15px;
}
.contact-box h3 { margin-bottom: 10px; font-size: 1.1rem; }
.contact-box p { color: var(--text-muted); font-size: 0.9rem; }

footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 20px;
}

/* --- Language Switcher Button --- */
.lang-switch {
    cursor: pointer;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 5px 15px;
    border-radius: 20px;
    transition: 0.3s;
}
.lang-switch:hover {
    background: var(--card-bg);
    color: white;
}

/* --- RTL (Arabic) Support --- */
html[dir="rtl"] {
    font-family: 'Cairo', sans-serif !important;
}

/* FIX: Apply Cairo only to text elements, NOT icons */
html[dir="rtl"] body,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, 
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6,
html[dir="rtl"] p, html[dir="rtl"] a, html[dir="rtl"] span, 
html[dir="rtl"] button, html[dir="rtl"] input, html[dir="rtl"] textarea {
    font-family: 'Cairo', sans-serif;
}

/* Flip Layouts for RTL */
html[dir="rtl"] .nav-links { gap: 30px; }
html[dir="rtl"] .timeline::before { right: 20px; left: auto; }
html[dir="rtl"] .timeline-item { padding-right: 60px; padding-left: 0; text-align: right; border-left: none; }
html[dir="rtl"] .timeline-item::before { right: 11px; left: auto; }
html[dir="rtl"] .hero-text { text-align: right; }
html[dir="rtl"] .hero-btns { justify-content: flex-start; }
html[dir="rtl"] .experience-badge { left: 40px; right: auto; }
html[dir="rtl"] .section-title::after { margin: 10px auto 0; }
html[dir="rtl"] .contact-box { text-align: center; }
html[dir="rtl"] .tag { margin-left: 5px; margin-right: 0; }

/* Mobile RTL Nav */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.active { display: flex; }
    .hamburger { display: block; }
    
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-text h1 { font-size: 2.5rem; }
    .hero-btns { justify-content: center; }
    .social-links { justify-content: center; margin-bottom: 40px; }
    .hero-img img { width: 250px; height: 250px; }
    .about-grid { grid-template-columns: 1fr; }
    .timeline::before { left: 0; }
    .timeline-item { padding-left: 30px; }
    .timeline-item::before { left: -9px; }
    
    /* Extra tight mobile spacing */
    .section { padding: 30px 0; } 
    .section-title { font-size: 2rem; margin-bottom: 25px; }

    html[dir="rtl"] .nav-links { text-align: right; }
}

