:root {
  --primary: #0d0d17;
  --background: #121220;
  --text-color: #f0f0f0;
  --accent: #d4af37;
  --accent-light: #e6c86a;
  --transition: 0.3s ease;
  --section-bg: rgba(26, 26, 42, 0.85);
  --nav-height: 70px;
  --box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

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

body {
  font-family: 'Cairo', sans-serif;
  background: linear-gradient(135deg, #0f0c29, #1a1a3a, #0f0c29);
  background-attachment: fixed;
  color: var(--text-color);
  line-height: 1.7;
  padding-top: var(--nav-height);
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(13, 13, 23, 0.95);
  z-index: 100;
  backdrop-filter: blur(5px);
  box-shadow: var(--box-shadow);
  height: var(--nav-height);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

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

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.nav-logo i {
  font-size: 1.5rem;
  position: relative;
  top: -6px;
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  margin-left: 1.5rem;
  color: #fff;
  text-decoration: none;
  transition: color var(--transition);
  font-weight: 500;
  position: relative;
  font-size: 1.1rem;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active, 
.nav-links a:hover {
  color: var(--accent);
}

.hamburger {
  display: none;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  position: absolute;
  left: 6px;
  transition: transform 0.3s, opacity 0.2s;
}

.hamburger span:nth-child(1) { top: 12px; }
.hamburger span:nth-child(2) { top: 18px; }
.hamburger span:nth-child(3) { top: 24px; }

/* HERO */
header {
  height: 85vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(18, 18, 32, 0.9), rgba(40, 40, 80, 0.7));
  z-index: -1;
}

.hero-content {
  text-align: center;
  padding: 0 1.5rem;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  font-family: 'Tajawal', sans-serif;
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 1px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.4rem;
  color: #fff;
  margin-top: 1.5rem;
  line-height: 1.8;
}

.hero-btns {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s;
  border: 2px solid var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.1);
}

/* SECTIONS */
main {
  padding: 4rem 0;
}

section {
  padding: 4rem 0;
}

section h2 {
  font-family: 'Tajawal', sans-serif;
  font-size: 2.8rem;
  color: var(--accent);
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

/* BASIC BOX */
.about, .skills, .education, .projects, .contact {
  background: var(--section-bg);
  border-radius: 16px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.15);
}

.about:hover, .skills:hover, .education:hover, .projects:hover, .contact:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

/* SKILLS */
.skills ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  list-style: none;
}

.skills li {
  background: rgba(18, 18, 32, 0.5);
  padding: 1.5rem;
  border-left: 4px solid var(--accent);
  font-weight: 500;
  border-radius: 0 12px 12px 0;
  transition: transform 0.3s;
  font-size: 1.1rem;
}

.skills li:hover {
  transform: translateX(8px);
  background: rgba(18, 18, 32, 0.7);
}

/* TIMELINE */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 8px;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--background);
  box-shadow: 0 0 0 3px var(--accent);
}

.timeline-item h3 {
  font-size: 1.5rem;
  margin-bottom: 0.7rem;
  color: var(--accent-light);
}

.timeline-item p {
  color: #aaa;
  font-size: 1.1rem;
}

.timeline-item .date {
  display: inline-block;
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* PROJECTS */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: rgba(18, 18, 32, 0.5);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  transition: all 0.4s;
  border: 1px solid rgba(255,255,255,0.05);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
  border-color: rgba(212, 175, 55, 0.3);
}

.project-img {
  height: 200px;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.project-card:hover .project-img img {
  transform: scale(1.05);
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: var(--accent);
}

.project-content p {
  color: #ccc;
  margin-bottom: 1.2rem;
  min-height: 80px;
}

.project-link {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: var(--primary);
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.project-link:hover {
  background: var(--accent-light);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* CAROUSEL */
.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0 auto 2rem;
  border-radius: 16px;
  box-shadow: var(--box-shadow);
  max-width: 800px;
}

.carousel-track-container {
  overflow: hidden;
  border-radius: 12px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.cert-item {
  min-width: 100%;
  text-align: center;
  padding: 1.5rem;
}

.cert-item img {
  width: 100%;
  max-width: 700px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Carousel buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(13, 13, 23, 0.8);
  border: none;
  color: #fff;
  font-size: 1.8rem;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.carousel-btn:hover {
  background: rgba(13, 13, 23, 0.95);
  transform: translateY(-50%) scale(1.05);
  color: var(--accent);
}

.prev { left: 20px; }
.next { right: 20px; }

.carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.3s;
}

.indicator.active {
  background: var(--accent);
}

/* CONTACT */
.contact-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.contact-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #ccc;
}

.contact-icons {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.contact-icons a {
  color: var(--accent);
  font-size: 2.8rem;
  transition: all 0.3s;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 32, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.contact-icons a:hover {
  color: #fff;
  background: rgba(212, 175, 55, 0.15);
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.2);
}

/* FOOTER */
footer {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 2rem 0;
  font-size: 1.1rem;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
  .hero h1 { font-size: 3.5rem; }
}

@media (max-width: 992px) {
  .hero h1 { font-size: 3rem; }
  .hero p { font-size: 1.2rem; }
  section h2 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }
  
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: rgba(13, 13, 23, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    transform: translateY(-150%);
    transition: transform 0.4s ease;
    z-index: 99;
  }
  
  .nav-links.active {
    transform: translateY(0);
  }
  
  .nav-links a {
    margin: 1rem 0;
    font-size: 1.3rem;
  }
  
  .hamburger {
    display: block;
  }
  
  .hamburger.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
  
  .hero h1 { font-size: 2.5rem; }
  .hero p { font-size: 1.1rem; }
  .hero-btns { flex-direction: column; align-items: center; gap: 1rem; }
  .btn { width: 80%; max-width: 300px; text-align: center; }
  
  section h2 { font-size: 2.2rem; }
  
  .about, .skills, .education, .projects, .contact {
    padding: 2rem;
  }
  
  .skills ul {
    grid-template-columns: 1fr;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-icons a {
    width: 70px;
    height: 70px;
    font-size: 2.2rem;
  }
  
  .carousel-btn {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  
  .carousel-container {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1rem; }
  
  section h2 { font-size: 2rem; }
  
  .container {
    padding: 0 1rem;
  }
  
  .timeline {
    padding-left: 1.5rem;
  }
  
  .timeline-item::before {
    left: -20px;
  }
  
  .cert-item {
    padding: 0.5rem;
  }
  
  .carousel-btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
}