/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Luxury Royal Blue Theme */
    --royal-blue: #003366;
    --royal-blue-light: #004080;
    --royal-blue-dark: #002244;
    --royal-green: #1a472a;
    --royal-green-light: #2d5a3d;
    --royal-green-dark: #0d2818;
    
    /* Light Mode Colors */
    --primary-color: var(--royal-blue);
    --primary-light: var(--royal-blue-light);
    --primary-dark: var(--royal-blue-dark);
    --accent-color: var(--royal-green);
    --text-dark: #1a1a1a;
    --text-light: #666666;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-section: #fafbfc;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 51, 102, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 51, 102, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Colors */
body.dark-mode {
    --primary-color: #4a90e2;
    --primary-light: #6ba3f0;
    --primary-dark: #2e5c8a;
    --accent-color: #5cb85c;
    --text-dark: #e0e0e0;
    --text-light: #b0b0b0;
    --bg-white: #1a1a1a;
    --bg-light: #242424;
    --bg-section: #2a2a2a;
    --border-color: #404040;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', 'Noto Sans', 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body[dir="rtl"] {
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.dark-mode .navbar {
    background: rgba(26, 26, 26, 0.98);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-brand h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    font-family: 'Sansation', 'Montserrat', sans-serif;
    margin: 0;
}

.nav-subtitle {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
    margin-top: -5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    font-size: 0.95rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Navigation Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
}

.lang-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: rotate(15deg) scale(1.1);
}

.theme-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: var(--transition);
    display: block;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: var(--transition);
    border-radius: 2px;
}

/* Hero/Intro Section */
.hero-intro {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 80px;
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-dark) 100%);
    position: relative;
    overflow: hidden;
}

.dark-mode .hero-intro {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
}

.hero-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.intro-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
    color: white;
}

.intro-image {
    text-align: center;
}

.profile-img {
    width: 380px;
    height: 380px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.profile-img:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.intro-text {
    color: white;
}

.intro-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    font-family: 'Sansation', 'Montserrat', sans-serif;
}

.intro-subtitle {
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    color: rgba(255, 255, 255, 0.9);
}

.intro-description {
    font-size: 1.15rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    line-height: 1.8;
    max-width: 600px;
}

.intro-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn {
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    border: 2px solid transparent;
    font-size: 1rem;
}

.btn-primary {
    background: white;
    color: var(--royal-blue);
}

.btn-primary:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-secondary:hover {
    background: white;
    color: var(--royal-blue);
    transform: translateY(-2px);
}

.intro-quick-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    opacity: 0.9;
}

.quick-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.separator {
    color: rgba(255, 255, 255, 0.5);
}

/* Page Sections */
.page-section {
    padding: 120px 0 80px;
    background: var(--bg-white);
    min-height: calc(100vh - 80px);
}

.page-title {
    font-size: 3.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-dark);
    position: relative;
    font-family: 'Sansation', 'Montserrat', sans-serif;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-dark);
    font-family: 'Sansation', 'Montserrat', sans-serif;
}

/* About Page */
.about-content {
    max-width: 1100px;
    margin: 0 auto;
}

.about-image-section {
    text-align: center;
    margin-bottom: 3rem;
}

.about-profile-img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.about-text-section {
    max-width: 900px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    line-height: 1.8;
}

.skills-section {
    margin-top: 4rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    padding: 10px 20px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: var(--transition);
}

.skill-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-white);
    transform: translateY(-2px);
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 3rem;
}

.timeline-marker {
    position: absolute;
    left: -1.5rem;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 4px solid var(--bg-white);
    box-shadow: 0 0 0 3px var(--primary-color);
}

.dark-mode .timeline-marker {
    border-color: var(--bg-white);
}

.timeline-content {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.timeline-content:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(5px);
    border-color: var(--primary-color);
}

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: baseline;
    margin-bottom: 1rem;
    justify-content: space-between;
}

.timeline-company-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.company-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-light);
    padding: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.company-logo:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.timeline-company-info h3 {
    font-size: 1.75rem;
    color: var(--text-dark);
    font-weight: 600;
    margin: 0;
}

.timeline-header h3 {
    font-size: 1.75rem;
    color: var(--text-dark);
    font-weight: 600;
}

.timeline-company {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.2rem;
    display: block;
    margin-top: 0.25rem;
    text-decoration: none;
    transition: var(--transition);
}

.timeline-company:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.education-content h4 a,
.cert-card p a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.education-content h4 a:hover,
.cert-card p a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.company-logo,
.logo-img,
.logo-img-small {
    transition: var(--transition);
}

a:hover .company-logo,
a:hover .logo-img,
a:hover .logo-img-small {
    transform: scale(1.05);
    opacity: 0.9;
}

.timeline-date {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-left: auto;
}

.timeline-location {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: block;
}

.timeline-content p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Education Grid */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.education-card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border-color);
}

.education-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    border-color: var(--primary-color);
}

.education-icon {
    margin-bottom: 1.5rem;
}

.logo-img {
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
}

.education-content h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.education-content h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.education-specialty {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: block;
}

.education-period {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Certifications Section */
.certifications-section {
    margin-top: 5rem;
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.cert-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    border: 1px solid var(--border-color);
}

.cert-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.cert-icon {
    margin-bottom: 1.5rem;
}

.logo-img-small {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.cert-card h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.cert-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.cert-date {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.cert-hidden {
    display: none;
}

.cert-hidden.show {
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

.show-more-container {
    text-align: center;
    margin-top: 3rem;
}

.show-more-btn {
    padding: 14px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.show-more-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.show-more-btn.hidden {
    display: none;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.project-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    border-color: var(--primary-color);
}

.project-header {
    margin-bottom: 1.5rem;
}

.project-header h3 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-tech span {
    padding: 6px 16px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.project-card p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1rem;
}

/* Contact Section */
.contact-subtitle {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 4rem;
    color: var(--text-light);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.contact-content {
    max-width: 900px;
    margin: 0 auto;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.contact-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.contact-link:hover {
    background: var(--bg-white);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.contact-item:hover {
    background: var(--bg-white);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.contact-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: var(--transition);
}

.contact-item:hover .contact-logo {
    transform: scale(1.1);
}

.contact-details h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
}

.contact-details a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1rem;
}

.contact-details a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.contact-details span {
    color: var(--text-light);
    font-size: 1rem;
    display: block;
}

/* Footer */
.footer {
    background: var(--royal-blue);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.dark-mode .footer {
    background: #0f0f1e;
}

.footer p {
    margin: 0.5rem 0;
}

.footer-subtitle {
    opacity: 0.8;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 968px) {
    .intro-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .intro-title {
        font-size: 3rem;
    }

    .intro-subtitle {
        font-size: 1.5rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--bg-white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        gap: 1rem;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item {
        padding-left: 2rem;
    }

    .timeline-marker {
        left: -1rem;
    }

    .company-logo {
        width: 50px;
        height: 50px;
    }

    .timeline-company-info h3 {
        font-size: 1.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    .hero-intro {
        padding: 100px 20px 60px;
    }

    .intro-title {
        font-size: 2.5rem;
    }

    .intro-subtitle {
        font-size: 1.25rem;
    }

    .intro-description {
        font-size: 1rem;
    }

    .profile-img {
        width: 280px;
        height: 280px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .page-section {
        padding: 100px 0 60px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .education-grid,
    .certifications-grid {
        grid-template-columns: 1fr;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .nav-controls {
        gap: 0.5rem;
    }

    .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
    }
}

/* RTL Support for Arabic */
body[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 2rem;
}

body[dir="rtl"] .timeline::before {
    left: auto;
    right: 0;
}

body[dir="rtl"] .timeline-item {
    padding-left: 0;
    padding-right: 3rem;
}

body[dir="rtl"] .timeline-marker {
    left: auto;
    right: -1.5rem;
}

body[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}