/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e5a;
    --secondary-color: #4a5f7a;
    --accent-color: #d4949a;
    --dark-bg: #1a1f2e;
    --dark-secondary: #232937;
    --light-bg: #f5f7fa;
    --text-dark: #2c3e5a;
    --text-light: #8892a0;
    --text-white: #f5f7fa;
    --pastel-navy: #4a5f7a;
    --pastel-red: #d4949a;
    --pastel-pink: #e5b4b8;
    --soft-blue: #6b7b95;
    --gradient-primary: linear-gradient(135deg, #2c3e5a 0%, #4a5f7a 100%);
    --gradient-accent: linear-gradient(135deg, #d4949a 0%, #e5b4b8 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(212, 148, 154, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(44, 62, 90, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(74, 95, 122, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 31, 46, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    position: relative;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    transition: var(--transition);
}

.nav-logo:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
    box-shadow: 0 0 20px rgba(200, 150, 78, 0.5);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-white);
    margin: 3px 0;
    transition: var(--transition);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 2rem;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--text-white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
}

.lang-btn:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
}

.lang-btn.active {
    background: var(--primary-color);
    color: var(--dark-bg);
}

/* RTL Support */
body[dir="rtl"] {
    font-family: 'Amiri', 'Poppins', sans-serif;
}

body[dir="rtl"] .nav-menu {
    direction: rtl;
}

body[dir="rtl"] .container {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .hero-buttons {
    justify-content: center;
}

body[dir="rtl"] .timeline {
    padding-right: 2rem;
    padding-left: 0;
}

body[dir="rtl"] .timeline::before {
    right: 0;
    left: auto;
}

body[dir="rtl"] .timeline-marker {
    right: -2.5rem;
    left: auto;
}

body[dir="rtl"] .contact-item {
    justify-content: flex-end;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6rem 2rem 2rem;
    position: relative;
    background: radial-gradient(ellipse at top, #2a2a2a 0%, #1a1a1a 50%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234a5f7a' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: arabesque-float 20s ease-in-out infinite;
}

@keyframes arabesque-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.hero-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.hero-greeting {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.hero-name {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    font-family: 'Space Grotesk', sans-serif;
}

.hero-title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--text-white);
    margin-bottom: 1.5rem;
}

.typing::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

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

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


.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.scroll-indicator span {
    width: 3px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}

/* Section Styles */
.section {
    padding: 4rem 0;
}

#experience, #education, #skills, #certifications, #contact {
    padding: 5rem 0;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
}

.section-title::before,
.section-title::after {
    content: '✦';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.5rem;
}

.section-title::before {
    left: -3rem;
}

.section-title::after {
    right: -3rem;
}

.title-number {
    color: var(--primary-color);
    font-size: 1.2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* About Section */
.about {
    background: var(--dark-secondary);
    position: relative;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: repeating-linear-gradient(
        90deg,
        var(--primary-color),
        var(--primary-color) 10px,
        transparent 10px,
        transparent 20px
    );
}

.about::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: repeating-linear-gradient(
        90deg,
        var(--primary-color),
        var(--primary-color) 10px,
        transparent 10px,
        transparent 20px
    );
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    line-height: 1.8;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

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

.highlight-item h4 {
    font-size: 1.5rem;
    color: var(--text-white);
}

.highlight-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}


/* Experience Section */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--primary-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 3rem;
}

.timeline-marker {
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 1rem;
    height: 1rem;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--dark-bg);
    position: relative;
}

.timeline-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
}

.timeline-content {
    background: var(--dark-secondary);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

.timeline-date {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.timeline-content h3 {
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

.timeline-content h4 {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.tech-stack {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tech-stack span {
    background: rgba(212, 148, 154, 0.1);
    color: var(--accent-color);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* Education Section */
.education {
    background: var(--dark-secondary);
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.education-card {
    background: var(--dark-bg);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 30%, var(--primary-color) 30%, var(--primary-color) 32%, transparent 32%),
        linear-gradient(-45deg, transparent 30%, var(--primary-color) 30%, var(--primary-color) 32%, transparent 32%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.education-card > * {
    position: relative;
    z-index: 1;
}

.education-card:hover::before {
    opacity: 0.05;
}

.education-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.education-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.education-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.education-card h4 {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.education-card p {
    color: var(--pastel-red);
    font-size: 0.9rem;
}

/* Skills Section */
.skills {
    background: var(--dark-bg);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--dark-bg);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.skill-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--pastel-red), var(--primary-color));
    border-radius: 10px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.skill-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.skill-card:hover::after {
    opacity: 0.3;
}

.skill-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.skill-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.skill-level {
    width: 100%;
    height: 8px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 1s ease;
}

.skills-subtitle {
    font-size: 1.5rem;
    margin: 3rem 0 2rem;
    text-align: center;
    color: var(--primary-color);
}

.tech-skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.tech-skill-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--dark-secondary);
    border-radius: 10px;
    transition: var(--transition);
}

.tech-skill-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tech-skill-item i {
    font-size: 2.5rem;
    color: var(--pastel-red);
    margin-bottom: 1rem;
}

.tech-skill-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.tech-skill-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Certifications Section */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.cert-card {
    background: var(--dark-secondary);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.cert-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--gradient-primary);
    opacity: 0;
    transform: rotate(45deg);
    transition: var(--transition);
}

.cert-card:hover::before {
    opacity: 0.1;
}

.cert-icon {
    font-size: 2.5rem;
    color: var(--pastel-red);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.cert-card h4 {
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.cert-card p {
    color: var(--text-light);
    position: relative;
    z-index: 1;
}

/* Contact Section */
.contact {
    background: var(--dark-secondary);
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

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

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

/* Contact CTA */
.contact-cta {
    margin-top: 2rem;
}

.cta-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background: var(--dark-bg);
    padding: 3rem 0;
    text-align: center;
}

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

.social-links a {
    color: var(--text-light);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Additional spacing fixes */
.timeline-item:last-child {
    padding-bottom: 0;
}

.section-title {
    padding-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--dark-bg);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }
    
    .language-switcher {
        margin-left: auto;
        margin-right: 1rem;
    }

    .hero-content {
        text-align: center;
    }

    .about-content,
    .contact-content {
        padding: 0 1rem;
    }

    .about-highlights {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    body[dir="rtl"] .language-switcher {
        margin-right: auto;
        margin-left: 1rem;
    }
}

/* Arabic Pattern Decorations */
.arabic-pattern {
    position: absolute;
    width: 100px;
    height: 100px;
    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='M50 5L61.6 38.2H95.1L68.8 58.2L80.4 91.5L50 71.5L19.6 91.5L31.2 58.2L4.9 38.2H38.4L50 5Z' fill='%234a5f7a' fill-opacity='0.1'/%3E%3C/svg%3E");
    opacity: 0.5;
    animation: rotate-pattern 30s linear infinite;
}

@keyframes rotate-pattern {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.islamic-border {
    position: relative;
    padding: 2rem;
    margin: 2rem 0;
}

.islamic-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--primary-color);
    border-image: repeating-linear-gradient(
        45deg,
        var(--primary-color),
        var(--primary-color) 10px,
        transparent 10px,
        transparent 15px
    ) 3;
}

/* Geometric Islamic Patterns */
.geometric-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 50% 50%, transparent 40%, var(--primary-color) 41%, var(--primary-color) 42%, transparent 43%),
        radial-gradient(circle at 0% 0%, transparent 40%, var(--primary-color) 41%, var(--primary-color) 42%, transparent 43%),
        radial-gradient(circle at 100% 0%, transparent 40%, var(--primary-color) 41%, var(--primary-color) 42%, transparent 43%),
        radial-gradient(circle at 100% 100%, transparent 40%, var(--primary-color) 41%, var(--primary-color) 42%, transparent 43%),
        radial-gradient(circle at 0% 100%, transparent 40%, var(--primary-color) 41%, var(--primary-color) 42%, transparent 43%);
    background-size: 50px 50px;
    background-position: 25px 25px, 0 0, 50px 0, 50px 50px, 0 50px;
    opacity: 0.03;
}

/* Animation classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}