:root {
  --bg-color: #f8f9fa8d;
  --text-color: #333;
  --card-bg: #ffffff;
  --nav-bg: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
  --primary: #d16af4;
  --secondary: #542a62;
  --accent: #f1c40f;
  --muted: #666;
  --border: #ddd;
  --particle-color: #3498db;
  --particle-line-color: #3498db;
  --footer-color: #804096b7;
}

[data-theme="dark"] {
  --bg-color: #00000089;
  --text-color: #e0e0e0;
  --card-bg: #2d2d2d;
  --nav-bg: #2d2d2d;
  --shadow: rgba(0, 0, 0, 0.3);
  --primary: #24f4f6;
  --secondary: #24f4f6;
  --accent: #ffb74d;
  --muted: #b0b0b0;
  --border: #444;
  --particle-color: #542a62;
  --particle-line-color: #542a62;
  --footer-color: #24f4f6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Particles Background */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  background: var(--bg-color);
}

/* Ensure content stays above particles */
body {
  position: relative;
  z-index: 1;
}

/* Navigation */
.navbar {
  background-color: var(--nav-bg);
  box-shadow: 0 2px 10px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding-left: 2rem;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.nav-logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.3s;
  padding-right: 2rem;
}

.theme-toggle:hover {
  background-color: var(--border);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: var(--text-color);
  margin: 3px 0;
  transition: 0.3s;
}

/* Hero Section */
.hero {
  padding: 5rem 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  position: relative;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 150px;
  flex-wrap: wrap;
  
}

.hero-content {
  max-width: 600px;
  flex: 1;  
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-content h1 span {
  color: var(--primary);
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  max-width: 600px;
  color: var(--muted);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary);
  color: black;
}

.btn-primary:hover {
  background-color: var(--secondary);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-accent {
  background-color: var(--accent);
  color: #000000 !important; 
  border: 2px solid var(--accent);
  font-weight: 700;
}

.btn-accent:hover {
  background-color: transparent;
  color: var(--accent) !important;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 320px;
}

.hero-image img {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.hero-image img:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Sections */
section {
  padding: 5rem 0;
  background-color: var(--bg-color);
  position: relative;
  z-index: 2;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--secondary);
}

/* Introduction Section */
.intro p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.intro-card {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px var(--shadow);
  transition: transform 0.3s;
  border: 1px solid var(--border);
}

.intro-card:hover {
  transform: translateY(-10px);
}

.intro-card h3 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  margin-top: 1rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.read-more i {
  margin-left: 0.5rem;
  transition: transform 0.3s;
}

.read-more:hover i {
  transform: translateX(5px);
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px var(--shadow);
  text-align: center;
  transition: transform 0.3s;
  border: 1px solid var(--border);
}

.project-card:hover {
  transform: translateY(-10px);
}

.project-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.project-card h3 {
  margin-bottom: 1rem;
  color: var(--secondary);
}

.project-card p {
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.project-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s;
}

.project-link:hover {
  border-color: var(--primary);
}

.loading {
  text-align: center;
  grid-column: 1 / -1;
  padding: 2rem;
  color: var(--muted);
}

/* --- Main Projects Section Fix --- */

.mainprojects {
  width: 100%;
  padding: 5rem 0; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
}

.mainprojectscards {
  background-color: var(--card-bg);
  width: 90%; 
  max-width: 1180px; 
  min-height: 500px; 
  border-radius: 20px; 
  display: flex;
  flex-direction: row; 
  align-items: stretch; 
  border: 1px solid var(--border);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  box-shadow: 0 10px 30px var(--shadow);
  /* السر الأول: مبطن الكارت بالكامل عشان الصورة متلمسش الحواف */
  padding: 20px; 
}

.mainprojectscards:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px var(--shadow);
}

.mainprojecttext {
  width: 55%; 
  /* ظبطنا المسافات عشان الكلام ميبقاش لازق في الصورة */
  padding: 30px 40px 30px 20px; 
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mainprojecttext h1 {
  color: var(--secondary);
  font-size: 2rem; 
  margin-bottom: 1.5rem;
  line-height: 1.4;
  font-weight: 700;
}

.mainprojecttext p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-color);
  opacity: 0.85;
}

.mainproject-actions {
  margin-top: 2rem;
}

.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  padding: 0.8rem 1.8rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.github-btn i {
  font-size: 1.3rem;
}

/* =========================================
   التصميم الجديد للصورة (Floating Image)
   ========================================= */
.mainprojectimage {
  width: 45%; 
  background-image: url("./media/ttt.jpeg");
  background-position: center;
  /* لو لقيت أطراف الرسمة البيانية مقصوصة، غير cover لكلمة contain */
  background-size: contain; 
  background-repeat: no-repeat;
  background-color: #ffffff; /* عشان الرسمة البيانية تبان نضيفة لو استخدمت contain */
  
  /* السر التاني: حواف ناعمة، شادو، ومسافات للصورة نفسها */
  border-radius: 16px; 
  box-shadow: 0 8px 25px rgba(0,0,0,0.15); 
  margin: 15px 15px 15px 0; 
  min-height: 350px; 
  transition: transform 0.3s ease;
}

.mainprojectimage:hover {
  transform: scale(1.03); /* زووم خفيف ولطيف للصورة لما تقف عليها */
}

/* تظبيط مقاسات الموبايل والتابلت */
@media (max-width: 992px) {
  .mainprojectscards {
    flex-direction: column-reverse; 
    padding: 15px; /* قللنا الـ padding على الموبايل */
  }

  .mainprojecttext {
    width: 100%; 
    padding: 20px 10px; 
  }

  .mainprojectimage {
    width: 100%; 
    height: 300px; 
    margin: 0; /* لغينا المارجن عشان الصورة تاخد مساحتها على الموبايل */
    border-radius: 12px;
  }

  .mainprojecttext h1 {
    font-size: 1.6rem; 
  }
  
  .mainprojecttext p {
    font-size: 1rem;
  }
}
/* Skills Section */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.skill-category h3 {
  text-align: left;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  
}

.skill-tag {
  background-color: var(--card-bg);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: transform 0.3s ;
}

.skill-tag:hover{
    transform: translateY(-10px);

}

/* Footer */
.footer {
  background-color: var(--footer-color);
  color: #000000;
  padding: 3rem 0 1rem;
  position: relative;
  z-index: 2;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.footer-info h3 {
  margin-bottom: 0.5rem;
  color: black;
}

.footer-info p {
  color: black;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: black;
  font-size: 1.5rem;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid #000000;
  font-size: 0.9rem;
  color: black;
}

/* About Page */
.page-header {
  padding: 3rem 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  text-align: center;
  
  position: relative;
  z-index: 2;
}

.page-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.about-content {
  background-color: var(--bg-color);
  position: relative;
  z-index: 2;
}

.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text h2 {
  text-align: left;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.about-text h2:first-of-type {
  margin-top: 0;
}

.about-text p {
  margin-bottom: 1.5rem;
}

.education {
  margin-top: 2rem;
}

.education h3 {
  color: var(--secondary);
  margin-bottom: 1rem;
}

.education-item {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}

.education-item h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.edu-image{
  min-width: 300px;
  height: 300px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

#cairo-uni{
  background-image: url("./media/cairo-uni.jpg");
}

#ai{

  background-image: url("./media/udemy22.webp");
}

#Coursera{
  background-image: url("./media/coursera2.png");
}
#nvidia{
  background-image: url("./media/Nvidia.jpg");
}
#datacamp{
  background-image: url("./media/dc3.jpg");
}
#ITI{
  background-image: url("./media/maharatechiti_logo.jpg");
}

.date {
  color: var(--muted);
  font-style: italic;
}

.about-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.about-profile {
  width: 380px;
  height: 380px;
  border-radius: 20px;
  object-fit: cover;
  border: 4px solid var(--primary);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.about-profile:hover {
  transform: scale(1.03);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.about-links {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background-color: var(--card-bg);
  border-radius: 5px;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s;
  border: 1px solid var(--border);
}

.social-link:hover {
  background-color: var(--primary);
  color: white;
}

/* Interests Section */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.interest-card {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px var(--shadow);
  text-align: center;
  transition: transform 0.3s;
  border: 1px solid var(--border);
}

.interest-card:hover {
  transform: translateY(-10px);
}

.interest-card i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.interest-card h3 {
  margin-bottom: 1rem;
  color: var(--secondary);
}

/*certificates page */

.certificate-hero {
  padding: 4rem 0;
  color: var(--text-color);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.certificate-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
}

.certificate-hero h1 {
  color:var(--secondary);
  font-size: 3.5rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.certificate-hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  opacity: 0.9;
}

.certificates-section {
  padding: 5rem 0;
  position: relative;
  z-index: 2;
  background-color: var(--bg-color);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--secondary);
  margin: 0;
  text-align: left;
}

.filter-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-btn {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--primary);
  color: black;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sort-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.sort-btn {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-btn:hover,
.sort-btn.active {
  background-color: var(--primary);
  color: black;
}




/* =========================================
   Featured Highlight Section
   ========================================= */
.featured-section {
  padding: 4rem 0;
  background-color: var(--bg-color);
  position: relative;
  z-index: 2;
}

.featured-card {
  background-color: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--primary);
  box-shadow: 0 10px 30px var(--shadow);
  display: flex;
  overflow: hidden;
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.featured-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(209, 106, 244, 0.15); /* Subtle primary glow */
}

.featured-badge {
  position: absolute;
  top: 25px;
  right: -40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #000;
  padding: 8px 45px;
  transform: rotate(45deg);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 10;
  text-transform: uppercase;
}

.featured-image {
  width: 45%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 350px;
}

.featured-content {
  padding: 3rem;
  width: 55%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-content h3 {
  color: var(--secondary);
  font-size: 2.2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.featured-content p {
  color: var(--text-color);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.7;
  opacity: 0.9;
}

/* Mobile Responsiveness for Featured Card */
@media (max-width: 992px) {
  .featured-card {
    flex-direction: column-reverse;
  }
  .featured-image {
    width: 100%;
    height: 250px;
    min-height: 250px;
  }
  .featured-content {
    width: 100%;
    padding: 2rem;
  }
  .featured-content h3 {
    font-size: 1.8rem;
  }
}

/* Modern Certificate Cards with Images */
.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.certificate-card {
  background-color: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(20px);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.certificate-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px var(--shadow);
}

.certificate-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 3px solid var(--primary);
}

.certificate-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.certificate-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.certificate-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
  font-size: 1.2rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.certificate-title {
  flex-grow: 1;
  margin-left: 1rem;
}

.certificate-category {
  display: inline-block;
  background-color: var(--primary);
  color: black;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.certificate-card h3 {
  margin-bottom: 0.8rem;
  color: var(--secondary);
  font-size: 1.3rem;
  line-height: 1.3;
}

.certificate-card p {
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
  flex-grow: 1;
}

.certificate-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.certificate-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.certificate-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
}

.certificate-link:hover {
  color: var(--secondary);
  transform: translateX(5px);
}

.certificate-rating {
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s, transform 0.6s;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--border);
}





/* Modal for certificate preview */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.modal-image {
  width: 100%;
  height: auto;
  display: block;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s;
}

.modal-close:hover {
  background-color: rgba(0, 0, 0, 0.9);
}



/* Contact Page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info h2 {
  text-align: left;
}

.contact-info > p {
  margin-bottom: 2rem;
  color: var(--muted);
}

.contact-details {
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--primary);
  margin-top: 0.2rem;
}

.contact-item h3 {
  margin-bottom: 0.3rem;
  color: var(--secondary);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background-color: var(--card-bg);
  border-radius: 5px;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s;
  border: 1px solid var(--border);
}

.social-btn:hover {
  background-color: var(--primary);
  color: white;
}

.contact-form {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px var(--shadow);
  border: 1px solid var(--border);
}

.contact-form h2 {
  text-align: left;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s;
  background-color: var(--bg-color);
  color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}



/* Responsive Design */
@media (max-width: 768px) {
  .certificate-hero h1 {
    font-size: 2.5rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .certificates-grid {
    grid-template-columns: 1fr;
  }

  .certificate-header {
    flex-direction: column;
  }

  .certificate-title {
    margin-left: 0;
    margin-top: 1rem;
  }

  /* --- NEW FIXES START HERE --- */

    /* 1. Fix "Soft Skills" button going off-screen */
    .filter-controls {
        flex-wrap: wrap;         /* Forces buttons to stack in multiple lines */
        justify-content: center; /* Centers the buttons */
        gap: 0.5rem;             /* Adds small space between stacked buttons */
    }

    /* 2. Fix About Me: Move Profile Picture to the Top */
    .about-grid {
        display: flex;           /* Changes grid to flexbox for easier ordering */
        flex-direction: column;  /* Stacks items vertically */
    }


    
    /* 1. Force Education Cards to stack vertically (Image on Top) */
    .education-item {
        display: flex !important;
        flex-direction: column-reverse !important; /* This puts the image ABOVE the text */
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
    }

    /* 2. Make the Education Image full width and centered */
    .edu-image {
        width: 100% !important;      /* Fill the card width */
        min-width: 0 !important;     /* Override the desktop 300px limit */
        height: 200px !important;    /* Good height for mobile */
        margin: 0 auto !important;   /* Force horizontal centering */
        border-radius: 8px;
    }

    /* 3. Ensure the text container takes full width */
    .left-edu {
        width: 100% !important;
    }

    /* 4. Fix "About Me" Profile Picture Centering */
    .about-image {
        width: 100% !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto 2rem auto !important;
        order: -1 !important; /* Ensures picture is at the top */
    }

    .about-profile {
        display: block !important;
        margin: 0 auto !important; /* Forces the image to the middle */
        max-width: 80% !important; /* Prevents it from touching edges */
    }

}

/* Proficiency Table Section */
.proficiency-section {
  padding: 5rem 0;
  background-color: var(--bg-color);
}

.table-responsive {
  max-width: 900px;
  margin: 0 auto;
  overflow-x: auto;
  background-color: var(--card-bg);
  border-radius: 15px;
  box-shadow: 0 5px 15px var(--shadow);
  border: 1px solid var(--border);
}

.proficiency-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.proficiency-table th, 
.proficiency-table td {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-color);
}

.proficiency-table th {
  background-color: var(--nav-bg);
  color: var(--secondary);
  font-weight: 700;
  font-size: 1.1rem;
}

.proficiency-table tr:last-child td {
  border-bottom: none;
}

.proficiency-table tbody tr {
  transition: background-color 0.3s;
}

.proficiency-table tbody tr:hover {
  background-color: rgba(209, 106, 244, 0.05); /* لون خفيف جداً لما تقف على الصف */
}

/* Progress Bar inside Table */
.table-progress {
  width: 100%;
  min-width: 150px;
  height: 10px;
  background-color: var(--bg-color);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.table-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 10px;
  width: 0; /* البداية من الصفر */
  transition: width 1.5s cubic-bezier(0.1, 0.5, 0.1, 1);
}

/* Animation trigger */
.table-row-animate {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s, transform 0.5s;
}

.fade-in.table-row-animate {
  opacity: 1;
  transform: translateX(0);
}

.fade-in .table-progress-fill {
  width: var(--progress);
}

/* Experience Timeline */
.experience-timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

.experience-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  height: 100%;
  width: 2px;
  background-color: var(--primary);
}

.experience-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 40px;
}

.exp-dot {
  position: absolute;
  left: 14px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 3px solid var(--bg-color);
  z-index: 1;
}

.exp-content {
  background-color: var(--card-bg);
  padding: 25px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 5px 15px var(--shadow);
  transition: transform 0.3s;
}

.exp-content:hover {
  transform: translateX(10px);
}

.exp-content h3 {
  color: var(--secondary);
  font-size: 1.4rem;
  margin-bottom: 5px;
}

.exp-content h4 {
  color: var(--primary);
  font-size: 1.1rem;
  margin-bottom: 15px;
  font-weight: 500;
}

.exp-content h4 span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

@media (max-width: 768px) {
  .experience-timeline::before {
    left: 10px;
  }
  .exp-dot {
    left: 4px;
  }
  .experience-item {
    padding-left: 40px;
  }
}


@media (max-width: 480px) {
  .certificate-hero {
    padding: 3rem 0;
  }

  .certificate-hero h1 {
    font-size: 2rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }
}

/* Animations */
.intro-card,
.project-card,
.interest-card,
.certificate-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s, transform 0.6s;
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.language,
.stars {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}





/* Responsive Design */
@media (max-width: 992px) {
  .hero-container {
    flex-direction: column;
    text-align: center;

  }

  .hero-content {
    /* Reset to default stacking order for mobile */
    order: unset; 
    /* Reset the padding added for desktop right-side layout */
    padding-left: 0; 
    padding-right: 0;
  }

  .hero-image {
    /* Reset to default stacking order */
    order: unset; 
    /* Ensure image is centered on mobile when stacked */
    justify-content: center; 
  }




  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;

  }

  .nav-container {
    padding: 1rem 0.5rem; 
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: var(--nav-bg);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px var(--shadow);
    padding: 2rem 0;
    gap: 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-link {
    display: block;
    padding: 1rem;
    width: 100%;
  }

  .nav-link.active::after {
    display: none;
  }

  .theme-toggle {
    margin: 1rem auto;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .hero-image img {
    width: 280px;
    height: 280px;
  }

  .about-profile {
    width: 300px;
    height: 300px;
    margin: 0 auto;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-image img {
    width: 240px;
    height: 240px;
  }

  .about-profile {
    width: 260px;
    height: 260px;
  }

  .hero-content h1 {
    font-size: 2.8rem;
  }
}



/* --- TABLET PORTRAIT ALIGNMENT FIX (769px to 991px) --- */
@media (min-width: 769px) and (max-width: 991px) {
    /* * Target the content column when it is in the single-column range,
     * or when it is too narrow to look right in the two-column view.
     */
    .hero-content {
        /* Ensure text is left-aligned in this specific tablet range */
        text-align: left; 
    }
    
    .hero-content h1, 
    .hero-content p {
        /* Force text within content block to align left */
        text-align: left !important;
    }

    .hero-buttons {
        /* Force buttons to align left */
        justify-content: flex-start;
    }

    /* Optional: If the image is still too big on tablet, you can adjust its container */
    .hero-image {
        /* Center the image when in a stacked column on a tablet */
        justify-content: center;
    }
}

/* Mobile Responsiveness for Featured Card */
@media (max-width: 992px) {
  .featured-card {
    /* Changed from column-reverse to column so the image is on top */
    flex-direction: column; 
  }
  
  .featured-image {
    width: 100%;
    height: 200px; /* Slightly smaller height for mobile */
    min-height: 200px;
    /* Optional: helps the logo fit better if it's getting cut off */
    background-size: contain; 
    background-color: #ffffff; /* Keeps the white background clean */
  }
  
  .featured-content {
    width: 100%;
    padding: 2rem;
  }
  
  .featured-content h3 {
    font-size: 1.8rem;
    margin-top: 0.5rem; /* Gives a little breathing room */
  }

  /* Make the badge slightly smaller on mobile so it doesn't take over */
  .featured-badge {
    font-size: 0.75rem;
    padding: 5px 35px;
    top: 15px;
    right: -35px;
  }
}

/* --- IPAD LANDSCAPE / WIDE TABLET ALIGNMENT FIX (e.g., 1024px to 1200px) --- */
@media (min-width: 1024px) and (max-width: 1200px) {
    
    .hero-container {
    flex-direction: column;
    text-align: center;
    gap: 100px;
   }

  
    .hero-content {
        
      text-align: left; 
      
      margin-left: 0;
    }
    
    .hero-content h1, 
    .hero-content p {
        
        text-align: left ;
    }

    .hero-buttons {
        
        justify-content: left; 
    }
    
    
    .hero-image {
        justify-content: right;
    }
}


/* --- SIDEBAR WITH TOP ICON  --- */

@media (max-width: 768px) {

    /* 1. The Menu Container */
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        right: -280px !important;   /* Hidden to the right */
        left: auto !important;      /* Disable left */
        
        width: 280px !important;
        height: 100vh !important;
        
        background-color: var(--nav-bg) !important; 
        box-shadow: -5px 0 20px rgba(0,0,0,0.2) !important;
        
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 2rem !important; /* Increased gap for better spacing */
        z-index: 2000 !important;
        transition: right 0.3s ease-in-out !important;
    }

    /* 2. ADD THE ICON AT THE TOP */
    .nav-menu::before {
        content: "\f0c9";           /* This is the FontAwesome code for a "Menu" icon */
        font-family: "Font Awesome 6 Free" !important;
        font-weight: 900 !important;
        font-size: 3rem !important; /* Make it big */
        color: var(--primary) !important;
        margin-bottom: 1rem !important;
        opacity: 0.8 !important;
    }

    /* 3. Slide In Animation */
    .nav-menu.active {
        right: 0 !important;
    }

    /* 4. The Links */
    .nav-link {
        color: var(--text-color) !important;
        font-size: 1.2rem !important;
        font-weight: 500 !important;
        padding: 0.5rem 1rem !important;
        width: 100% !important;
        text-align: center !important;
        transition: color 0.3s !important;
    }

    .nav-link:hover, .nav-link.active {
        color: var(--primary) !important;
    }

    /* 5. Hamburger on top */
    .hamburger {
        z-index: 2001 !important;
        position: relative;
    }
}

/* =========================================
   تظبيط مقاسات جدول المهارات على كل الموبايلات 
   ========================================= */
@media (max-width: 768px) {
  .table-responsive {
    width: 100%; /* الجدول ياخد العرض كله */
  }

  .proficiency-table th, 
  .proficiency-table td {
    padding: 0.8rem 0.5rem !important; 
    font-size: 0.9rem; 
  }

  .table-progress {
    min-width: 70px; /* نصغر الشريط سِنة عشان يدي مساحة للكلام */
    height: 8px;
  }
}

@media (max-width: 480px) {
  /* دي التظبيطة الخاصة بالشاشات الأصغر من ايفون 11 */
  .proficiency-table th, 
  .proficiency-table td {
    padding: 0.6rem 0.2rem !important; /* نقلل المسافات الفاضية حوالين الكلام */
    font-size: 0.8rem; /* نصغر الخط حاجة بسيطة جداً */
  }
  
  /* السر هنا: بيمنع اسم التكنولوجيا إنه يتكسر على سطرين أبداً */
  .proficiency-table th:first-child,
  .proficiency-table td:first-child {
    white-space: nowrap; 
  }

  .table-progress {
    min-width: 50px; /* الشريط هيبقى مرن أكتر */
  }

  .proficiency-table td i {
    margin-right: 4px !important;
    font-size: 0.85rem;
  }
}

/* Preloader Styles */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #121212; /* Solid dark color - no transparency */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000; /* Ensures it is above everything else */
  transition: opacity 0.6s ease-in-out, visibility 0.6s;
}

.loader-container {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--border);
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

#preloader p {
  color: var(--secondary);
  font-weight: 600;
  letter-spacing: 1px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Class to hide loader */
.loader-hidden {
  opacity: 0;
  visibility: hidden;
}



