:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --dark-gradient: linear-gradient(
    135deg,
    #0f0c29 0%,
    #302b63 50%,
    #24243e 100%
  );
  --gold-gradient: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);

  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #4facfe;
  --gold-color: #f7971e;
  --text-dark: #1a1a2e;
  --text-light: #f8f9fa;
  --bg-light: #ffffff;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 30px 80px rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  overflow-x: hidden;
  transition: all 0.3s ease;
}

html[dir="rtl"] body {
  font-family: "Poppins", "Cairo", sans-serif;
}

/* Animated Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.animated-bg::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%),
    radial-gradient(circle, rgba(118, 75, 162, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.8rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link {
  font-weight: 500;
  color: var(--text-dark) !important;
  margin: 0 0.5rem;
  position: relative;
  transition: all 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}

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

.lang-switcher {
  background: var(--primary-gradient);
  border: none;
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.lang-switcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* English Layout (Default) - اسم شمال، لينكات يمين */
html[dir="ltr"] .navbar-nav {
  margin-left: auto !important;
  margin-right: 0 !important;
}

/* Arabic Layout - اسم يمين، لينكات شمال */
html[dir="rtl"] .navbar-brand {
  margin-left: auto;
}

html[dir="rtl"] .navbar-nav {
  margin-right: auto !important;
  margin-left: 0 !important;
}

html[dir="rtl"] .navbar-toggler {
  margin-right: auto;
}

/* Fix for language button spacing */
.nav-item.lang-item {
  margin-left: 1rem;
}

html[dir="rtl"] .nav-item.lang-item {
  margin-left: 0;
  margin-right: 1rem;
}

/* Mobile Layout - الايكون والاسم في جنب بعض */
@media (max-width: 991px) {
  .navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* English Mobile - الاسم شمال، الايكون يمين */
  html[dir="ltr"] .navbar-brand {
    order: 1;
  }

  html[dir="ltr"] .navbar-toggler {
    order: 2;
  }

  html[dir="ltr"] .navbar-collapse {
    order: 3;
  }

  /* Arabic Mobile - الاسم يمين، الايكون شمال */
  html[dir="rtl"] .navbar-brand {
    order: 1;
  }

  html[dir="rtl"] .navbar-toggler {
    order: 2;
  }

  html[dir="rtl"] .navbar-collapse {
    order: 3;
  }
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 0 50px;
  position: relative;
}

.hero-content {
  animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-family: "Playfair Display", serif;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: var(--dark-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: #666;
  margin-bottom: 2rem;
  font-weight: 400;
}

.hero-description {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.btn-gradient {
  background: var(--primary-gradient);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  display: inline-block;
  text-decoration: none;
}

.btn-gradient:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
  color: white;
}

.btn-outline-gradient {
  background: transparent;
  color: var(--primary-color);
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  border: 2px solid var(--primary-color);
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
  margin-left: 1rem;
}

.btn-outline-gradient:hover {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-3px);
}

.hero-image {
  position: relative;
  animation: fadeInRight 1s ease;
  margin-top: 70px;
  margin-bottom: 70px;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.profile-image-wrapper {
  position: relative;
  width: 400px;
  height: 400px;
  margin: 0 auto;
}

.profile-image-wrapper::before {
  content: "";
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: var(--primary-gradient);
  border-radius: 50%;
  z-index: -1;
  animation: pulse 3s ease infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.3;
  }
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 8px solid white;
  box-shadow: var(--shadow-xl);
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  font-size: 1.2rem;
  margin-right: 1rem;
  margin-left: 1rem;
  margin-top: 5px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.social-link:hover {
  transform: translateY(-5px);
  color: white;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}
.hero-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* Section Styles */
section {
  padding: 100px 0;
}

.section-title {
  font-family: "Playfair Display", serif;
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

.card {
  border: none;
  border-radius: 15px;
  transition: 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}
#experience .row {
  display: flex;
  flex-wrap: wrap;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.skill-card {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  text-align: center;
}

.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.skill-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--primary-gradient);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  transition: all 0.3s ease;
}

.skill-card:hover .skill-icon {
  transform: rotateY(360deg);
}

.skill-title {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.skill-list {
  list-style: none;
  padding: 0;
}

.skill-list li {
  padding: 0.5rem 0;
  color: #666;
  position: relative;
  padding-left: 1.5rem;
}

html[dir="rtl"] .skill-list li {
  padding-left: 0;
  padding-right: 1.5rem;
}

.skill-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

html[dir="rtl"] .skill-list li::before {
  left: auto;
  right: 0;
}

/* Education Section */
.education-card {
  background: white;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.education-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--gold-gradient);
}

.education-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.education-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
  background: var(--gold-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
}

.education-university {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.education-degree {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.education-gpa {
  font-size: 1.1rem;
  color: var(--gold-color);
  font-weight: 600;
}

/* Contact Section */
.contact-section {
  background: var(--dark-gradient);
  color: white;
}

.contact-info {
  margin-bottom: 3rem;
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

html[dir="rtl"] .contact-item {
  flex-direction: row-reverse;
  text-align: right;
}

.contact-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-right: 1.5rem;
  color: var(--accent-color);
}

html[dir="rtl"] .contact-icon {
  margin-right: 0;
  margin-left: 1.5rem;
}

.contact-form {
  background: rgba(255, 255, 255, 0.1);
  padding: 3rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-color);
  color: white;
  box-shadow: 0 0 0 0.25rem rgba(79, 172, 254, 0.25);
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Footer */
.footer {
  background: #1a1a2e;
  color: white;
  padding: 2rem 0;
  text-align: center;
}

.footer-text {
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  /* مسافة بين الاسم وأيقونة المينيو في الموبايل */
  .navbar-toggler {
    margin-left: 1rem;
  }

  /* ولو الموقع عربي */
  html[dir="rtl"] .navbar-toggler {
    margin-left: 0;
    margin-right: 1rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .profile-image-wrapper {
    width: 300px;
    height: 300px;
  }

  .timeline::before {
    left: 20px;
  }

  html[dir="rtl"] .timeline::before {
    left: auto;
    right: 20px;
  }

  .timeline-item:nth-child(odd) .timeline-content::before,
  .timeline-item:nth-child(even) .timeline-content::before {
    left: -40px;
    right: auto;
  }

  html[dir="rtl"] .timeline-item:nth-child(odd) .timeline-content::before,
  html[dir="rtl"] .timeline-item:nth-child(even) .timeline-content::before {
    right: -40px;
    left: auto;
  }

  .btn-outline-gradient {
    margin-left: 0;
    margin-top: 1rem;
  }
}

/* Scroll to top button */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

html[dir="rtl"] .scroll-top {
  left: 30px;
  right: auto;
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}
@media (max-width: 1100px) {
  .btn-outline-gradient {
    display: none;
  }
}
