/* Global Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #7c3aed;
    --accent-color: #10b981;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f9fafb;
    --bg-dark: #111827;
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --transition: all 0.3s ease;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-dark: #3b82f6;
    --primary-light: #93c5fd;
    --secondary-color: #a78bfa;
    --accent-color: #34d399;
    --text-color: #f3f4f6;
    --text-light: #9ca3af;
    --bg-color: #1e293b;
    --bg-dark: #334155;
    --card-bg: rgba(71, 85, 105, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(100, 116, 139, 0.3);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

body.rtl {
    direction: rtl;
    text-align: right;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* Tech Background Animation */
.tech-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(37, 99, 235, 0.05) 25%, transparent 25%) -50px 0,
        linear-gradient(225deg, rgba(37, 99, 235, 0.05) 25%, transparent 25%) -50px 0,
        linear-gradient(315deg, rgba(37, 99, 235, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, rgba(37, 99, 235, 0.05) 25%, transparent 25%);
    background-size: 100px 100px;
    background-color: var(--bg-color);
    z-index: -1;
    opacity: 0.8;
}

/* Glassmorphism Effect */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px 0 rgba(31, 38, 135, 0.2);
}

/* Header Styles */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(37, 99, 235, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

body.rtl .glass-header {
    left: auto;
    right: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

body.rtl .header-content {
    /* Only keep text direction for RTL, no layout changes */
    direction: rtl;
}

/* Unify logo container for both LTR and RTL */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* Unify tagline for both LTR and RTL */
.tagline {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Unify main navigation for both LTR and RTL */
.main-nav {
    width: 100%;
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
}

/* Unify nav links for both LTR and RTL */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* Unify nav actions for both LTR and RTL */
.nav-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

body.rtl .logo-container {
    flex-direction: row-reverse;
    margin-bottom: 0;
}

.code-icon {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: white;
    font-size: 1.8rem;
    margin: 0;
}

.tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid white;
    animation: typing 4s steps(30, end) infinite, blink-caret 0.75s step-end infinite;
}

.cursor {
    opacity: 0;
    animation: blink 1s infinite;
}

@keyframes typing {
    0% { width: 0 }
    50% { width: 100% }
    100% { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: white }
}

@keyframes blink {
    0%, 100% { opacity: 1 }
    50% { opacity: 0 }
}

/* Navigation */
.main-nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}



.nav-links {
    display: flex;
    gap: 1.5rem;
}



.nav-link {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link span {
    transition: var(--transition);
}

.nav-link:hover span {
    transform: translateX(3px);
}

body.rtl .nav-link:hover span {
    transform: translateX(-3px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: white;
    transition: var(--transition);
}

body.rtl .nav-link::after {
    left: auto;
    right: 0;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

body.rtl .nav-actions {
    flex-direction: row-reverse;
    margin-left: 0;
    margin-right: auto;
}

#theme-toggle, #lang-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

#theme-toggle:hover, #lang-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 13rem 4rem 2rem;
}

/* Hero Section */
#hero {
    padding: 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

body.rtl .hero-content {
    flex-direction: row-reverse;
}

.hero-text {
    flex: 1;
}

.hero-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.hero-text p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

body.rtl .hero-actions {
    flex-direction: row-reverse;
}

.hero-image {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-frame {
    width: 300px;
    height: 300px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.personal-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    transition: var(--transition);
}

.photo-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.photo-decoration .circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
}

.photo-decoration .circle:nth-child(1) {
    width: 100px;
    height: 100px;
    top: -20px;
    left: -20px;
}

.photo-decoration .circle:nth-child(2) {
    width: 150px;
    height: 150px;
    bottom: -40px;
    right: -40px;
}

.photo-decoration .circle:nth-child(3) {
    width: 60px;
    height: 60px;
    bottom: 20px;
    left: 50px;
}

.tech-badge {
    margin-top: 1.5rem;
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tech-stack {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stack-item {
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    position: relative;
    cursor: default;
}

.stack-item:hover {
    transform: translateY(-5px) scale(1.1);
    color: var(--primary-dark);
}

.stack-item::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    white-space: nowrap;
}

.stack-item:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: -35px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Section Styles */
.section {
    margin-bottom: 4rem;
    scroll-margin-top: 6rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    font-size: 2rem;
    color: var(--primary-color);
}

.section-title span {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
}

.section-title span::before,
.section-title span::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 50px;
    height: 2px;
    background: var(--primary-color);
}

body.rtl .section-title span::before {
    right: 100%;
    left: auto;
}

body.rtl .section-title span::after {
    left: 100%;
    right: auto;
}

.section-footer {
    text-align: center;
    margin-top: 2rem;
}

/* Expertise Grid */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.expertise-card {
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    border-radius: 12px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.expertise-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.expertise-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.expertise-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.expertise-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.3rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.skill {
    margin-bottom: 1.5rem;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.skill-level {
    color: var(--primary-color);
    font-weight: 600;
}

.skill-bar-container {
    height: 8px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.skill-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    width: 0;
    transition: width 1.5s ease-in-out;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
}

body.rtl .timeline::before {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-date {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

body.rtl .timeline-date {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

.timeline-content {
    width: calc(50% - 2rem);
    padding: 1.5rem;
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
    left: 0;
}

body.rtl .timeline-item:nth-child(odd) .timeline-content {
    left: auto;
    right: 0;
}

.timeline-item:nth-child(even) .timeline-content {
    left: calc(50% + 2rem);
}

body.rtl .timeline-item:nth-child(even) .timeline-content {
    left: auto;
    right: calc(50% + 2rem);
}

.timeline-badge {
    position: absolute;
    top: 1.5rem;
    right: -25px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.rtl .timeline-badge {
    right: auto;
    left: -25px;
}

body.rtl .timeline-item:nth-child(even) .timeline-badge {
    left: auto;
    right: -25px;
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.timeline-content p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    overflow: hidden;
    transition: var(--transition);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.project-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

body.rtl .project-tech {
    flex-direction: row-reverse;
}

.project-tech span {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-actions {
    display: flex;
    gap: 1rem;
}

body.rtl .project-actions {
    flex-direction: row-reverse;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.contact-info {
    padding: 2rem;
}

.contact-info h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.contact-info h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
}

body.rtl .contact-info h3::after {
    left: auto;
    right: 0;
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

body.rtl .contact-item {
    flex-direction: row-reverse;
    text-align: right;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.contact-text {
    flex: 1;
}

.contact-text strong {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

body.rtl .social-links {
    flex-direction: row-reverse;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.contact-form {
    padding: 2rem;
}

.contact-form h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.contact-form h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
}

body.rtl .contact-form h3::after {
    left: auto;
    right: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 4rem 1rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

body.rtl .footer-content {
    direction: rtl;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

body.rtl .footer-logo {
    align-items: flex-end;
}

.footer-logo .code-icon {
    margin-bottom: 1rem;
}

.footer-logo h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.footer-links h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-links h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

body.rtl .footer-links h4::after {
    left: auto;
    right: 0;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

body.rtl .footer-links a:hover {
    padding-left: 0;
    padding-right: 5px;
}

.footer-contact h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-contact h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

body.rtl .footer-contact h4::after {
    left: auto;
    right: 0;
}

.footer-contact p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.rtl .footer-contact p {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.footer-bottom {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column-reverse;
        align-items: center;
    }
    
    body.rtl .hero-content {
        flex-direction: column-reverse;
        align-items: center;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    body.rtl .timeline::before {
        left: auto;
        right: 30px;
    }
    
    .timeline-date {
        position: relative;
        left: 0;
        transform: none;
        margin-bottom: 1rem;
        display: inline-block;
    }
    
    body.rtl .timeline-date {
        right: 0;
        left: auto;
    }
    
    .timeline-content {
        width: calc(100% - 80px);
        left: 80px !important;
    }
    
    body.rtl .timeline-content {
        left: auto !important;
        right: 80px !important;
    }
    
    .timeline-badge {
        left: 5px !important;
        right: auto !important;
    }
    
    body.rtl .timeline-badge {
        left: auto !important;
        right: 5px !important;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 1rem 0.5rem;
    }
    
    body.rtl .header-content {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    body.rtl .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-title span::before,
    .section-title span::after {
        width: 30px;
    }
    
    .hero-text h2 {
        font-size: 2rem;
    }
    
    .photo-frame {
        width: 250px;
        height: 250px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Header fixes for small screens */
    .header-content {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 1rem 0.5rem;
    }
    .logo-container {
        margin-bottom: 0.5rem;
    }
    .tagline {
        margin: 0.5rem 0;
        font-size: 1rem;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .main-nav {
        width: 100%;
        margin-top: 0.5rem;
    }
    .nav-links {
        justify-content: center;
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .header-content {
        padding: 0.8rem 0.5rem;
        text-align: center;
    }
    
    body.rtl .header-content {
        padding: 0.5rem;
        text-align: center;
    }
    
    .logo-container {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    body.rtl .logo-container {
        flex-direction: column;
        margin-bottom: 0.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .nav-links {
        gap: 0.5rem;
        flex-wrap: nowrap;
        justify-content: center;
    }
    
    body.rtl .nav-links {
        gap: 0.5rem;
        flex-wrap: nowrap;
        justify-content: center;
    }
    
    .nav-link span {
        display: none;
    }
    
    body.rtl .nav-link span {
        display: none;
    }
    
    .nav-actions {
        margin-top: 0.5rem;
        justify-content: center;
    }
    
    body.rtl .nav-actions {
        margin-top: 0.5rem;
        justify-content: center;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    body.rtl .hero-actions {
        flex-direction: column;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .skills-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 320px) {
    .header-content {
        padding: 0.5rem 0.3rem;
    }
    
    body.rtl .header-content {
        padding: 0.3rem;
        flex-direction: column;
        align-items: center;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    body.rtl .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-actions {
        margin-top: 0.5rem;
    }
    
    body.rtl .nav-actions {
        margin-top: 0.5rem;
    }
}