* {
  margin: 0;
  padding: 0;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.header-list {
  margin: 15px 20px;
}

.div-list {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.ul-list {
  list-style: none;
  display: flex;
  gap: 3rem;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 10px 25px;
  border-radius: 25px;
}

.ul-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 25px;
  transition: 0.3s;
}

.ul-list li a {
  font-family: "Montserrat", sans-serif;
  text-decoration: none;
  color: black;
}

.ul-list li.active {
  background-color: black;
  padding: 10px 15px;
}

.ul-list li.active a,
.ul-list li.active i {
  color: white;
}

/* fine header  */

.home {
  margin: 160px 200px;
}

.home-container {
  display: flex;
  gap: 6rem;
}

.home-p {
  color: black;
  background-color: rgba(128, 128, 128, 0.214);
  display: inline-block;
  border-radius: 25px;
  padding: 5px 10px;
  margin-bottom: 30px;
}

.home-s {
  font-weight: bold;
  color: green;
}

.info-home h1 {
  font-size: 70px;
  font-family: "Raleway", sans-serif;
  margin-bottom: 20px;
}

.info-home h3 {
  font-size: 40px;
  font-family: "Playfair Display", serif;
  margin-bottom: 20px;
}

.info-p {
  color: #222;
  font-family: "Roboto", sans-serif;
  padding-bottom: 20px;
}

.info-p p {
  padding-bottom: 5px;
}

.info-p2 {
  display: flex;
  gap: 1rem;
  color: #2c2c2c;
  font-size: 14px;
  padding-bottom: 20px;
}

.btnn {
  display: flex;
  gap: 1rem;
  padding-bottom: 30px;
}

.btn-home1 {
  background-color: #000000;
  color: rgb(255, 255, 255);
  border: none;
  border-radius: 10px;
  padding: 10px 10px;
  cursor: pointer;
}

.btn-home2 {
  background-color: transparent;
  border: 2px solid black;
  border-radius: 10px;
  padding: 10px 10px;
  cursor: pointer;
  transition: 0.4s;
}

.btn-home2:hover{
    background-color: #000000;
    color: #fff;
}

hr {
  width: 90%;
  font-weight: bold;
  color: gray;
}

.hhr {
  padding-bottom: 30px;
}

.follow {
  display: flex;
  gap: 1rem;
}

.follow ul {
  display: flex;
  gap: 2rem;
  font-size: 20px;
}

.follow ul li {
  list-style: none;
}

.follow ul a {
  text-decoration: none;
  color: #000000;
}

.home img {
  width: 400px;
  border-radius: 10px;
}

/* fine home  */

.about{
    margin: 160px 200px;
}

.about p{
    padding-bottom: 30px;
    font-size: 13px;
    color: rgb(50, 50, 50);
}

.about h1{
    font-family: "Open Sans", sans-serif;
}

.title{
    padding-bottom: 20px;
}

.about .hrrr{
    width: 30%;
    padding-bottom: 40px;
}

.info-about{
    display: flex;
    flex-direction: column;
}

.about-container{
    display: flex;
    gap: 2rem;
}

.about img{
    position: relative;
    bottom: 85px;
    width: 400px;
    height: 400px;
    border-radius: 15px;
    border: 1px solid black;
}

.about h2{
    padding-bottom: 30px;
}

.card{
    display: flex;
    gap: 2rem;
}

.c1{
    display: flex;
    align-content: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border: 2px solid black;
    padding: 5px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.c1 h3{
    padding-top: 10px;
    padding-bottom: 10px;
}

.c1:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: #ff3333;               
  background-color: #fff5f5;               
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);  
  cursor: pointer;                         
}


.project{
    margin: 160px 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.project p{
    padding-bottom: 20px;
    font-size: 13px;
    color: rgb(50, 50, 50); 
}

.project h1{
    font-family: "Open Sans", sans-serif;
    padding-bottom: 10px;
}

.project hr{
    width: 10%;
}

.info-pro{
    padding-top: 20px;
}

.info-pro p{
    padding-bottom: 10px;
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  max-width: 1100px;
  margin: auto;
}

.project-card {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
}

.project-card img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 15px;
}

.project-card h3 {
  color: #1e40af;
  margin-bottom: 8px;
}

.project-card p {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.skills {
  margin-bottom: 15px;
}

.skills a {
  display: inline-block;
  background: #e0e7ff;
  color: #1e3a8a;
  text-decoration: none;
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 6px;
  margin: 3px;
  transition: background 0.3s;
}

.skills a:hover {
  background: #c7d2fe;
}

.btns {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.btn {
  background: #1e40af;
  color: white;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 25px;
  font-size: 0.9rem;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  background: #2563eb;
  border-radius: 25px;

}

.services{
    margin: 160px 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.services p{
    padding-bottom: 20px;
    font-size: 13px;
    color: rgb(50, 50, 50); 
}

.services h1{
    font-family: "Open Sans", sans-serif;
    padding-bottom: 10px;
}

.services hr{
    width: 10%;
}

.services-container {
  padding-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  max-width: 1100px;
  margin: auto;
}

.service-card {
  background: #fff;
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: 0.5s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.service-card img {
  width: 100px;
  margin-bottom: 15px;
  z-index: 1;
  position: relative;
}

.service-card h3 {
  color: #1e40af;
  margin-bottom: 10px;
  transition: color 0.5s;
  position: relative;
  z-index: 1;
}

.service-card p {
  color: #555;
  font-size: 0.9rem;
  transition: color 0.5s;
  position: relative;
  z-index: 1;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: #474af0;
  z-index: 0;
  transition: 0.5s;
}

.service-card:hover::before {
  left: 0;
}

.service-card:hover h3,
.service-card:hover p {
  color: #fff;
}

.contact{
    margin: 160px 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.contact p{
    padding-bottom: 20px;
    font-size: 13px;
    color: rgb(50, 50, 50); 
}

.contact h1{
    font-family: "Open Sans", sans-serif;
    padding-bottom: 10px;
}

.contact hr{
    width: 10%;
}

.contact-content {
  padding-top: 50px;
  display: flex;
  gap: 50px;
  flex-wrap: wrap;
  justify-content: center;
}

.contact-info {
  flex: 1;
  min-width: 300px;
}

.contact-info p {
  font-size: 16px;
  margin-bottom: 25px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #222;
}

.contact-item i {
  font-size: 20px;
  color: #474af0;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-link {
  width: 50px;
  height: 50px;
  background: #f0f0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
  font-size: 20px;
  transition: all 0.3s ease;
}

.social-link:hover {
  transform: translateY(-5px);
  color: #fff;
}

.social-link[href*="github"]:hover {
  background: #000;
}

.social-link[href*="linkedin"]:hover {
  background: #0A66C2;
}

.social-link[href*="wa.me"]:hover {
  background: #25D366;
}

/* Form */
.contact-form {
  flex: 1;
  min-width: 300px;
}

.contact-form .form-group {
  margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  transition: border 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #474af0;
}

.btn-send {
  background: #474af0;
  color: #fff;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.3s;
}

.btn-send:hover {
  background: #2c36d9;
}

/* Responsive */
@media (max-width: 900px) {
  .contact-content {
    flex-direction: column;
  }
}


.footer {
  background-color: #000;
  color: #fff;
  padding: 40px 20px;
  text-align: center;
  overflow-x: hidden;
}

.footer-container {
  max-width: 1200px;
  margin: auto;
}

.footer-logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-links li a:hover {
  color: #474af0;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.footer-social a {
  color: #fff;
  font-size: 18px;
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: #474af0;
}

.footer-copy {
  font-size: 12px;
  color: #aaa;
}

.reveal {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.reveal[data-reveal="up"]    { transform: translateY(55px); }
.reveal[data-reveal="left"]  { transform: translateX(-70px); }
.reveal[data-reveal="right"] { transform: translateX(70px); }
.reveal[data-reveal="zoom"]  { transform: scale(0.82); }
.reveal[data-reveal="fade"]  { transform: translateY(15px); }

.reveal.active-reveal {
  opacity: 1;
  transform: translateX(0) translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; transform: none; opacity: 1; }
}

body {
  margin:0;
  padding:0;
  font-family: sans-serif;
}

#loading-screen {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background-color: #000;
  display:flex;
  justify-content:center;
  align-items:center;
  flex-direction:column;
  z-index:9999;
  overflow:hidden;
  color:#00f0ff;
  text-align:center;
}

.hidden {
  opacity: 0;
  transform: translateY(-200px);
}

.fall {
  animation: fall 0.9s forwards;
}

@keyframes fall {
  0% {
    opacity:0;
    transform: translateY(-200px);
  }
  60% {
    opacity:1;
    transform: translateY(20px);
  }
  100% {
    transform: translateY(0);
  }
}

.loading-content h1,
.loading-content h2,
.loading-content i {
  margin: 20px 0;
}

.sub-icons {
  display:flex;
  justify-content:center;
  gap: 25px;
  margin-bottom: 20px;
}

#main-page {
  opacity:0;
  transition: opacity 1s ease;
}

#main-page.visible {
  opacity:1;
}

/* Responsive for tablets and phones */
@media (max-width: 1024px) {
  .home, .about, .project, .services, .contact {
    margin: 120px 50px;
  }

  .home-container, .about-container {
    flex-direction: column;
    gap: 3rem;
  }

  .home img, .about img {
    width: 100%;
    height: auto;
  }

  .ul-list {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 8px 15px;
  }
}

/* Phone layout */
@media (max-width: 768px) {
  header {
    display: none;
  }

  .home, .about, .project, .services, .contact {
    margin: 100px 20px;
  }

  .home-container, .about-container, .contact-content {
    flex-direction: column;
    gap: 2rem;
  }

  .projects-container, .services-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .home img, .about img {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .btn-home1, .btn-home2, .btn, .btn-send {
    width: 100%;
    text-align: center;
  }
  
  .follow ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .footer-links {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 1024px) {

  header {
    display: none;
  }

  .home, .about, .project, .services, .contact {
    margin: 20px auto;
    padding: 0 15px;
    text-align: center;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .home-container,
  .about-container,
  .services-container,
  .projects-container,
  .contact-content,
  .card {
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
  }

  .about img {
    width: 100%;
    max-width: 220px; 
    height: auto;
    margin-bottom: 20px;
    position: relative;
    z-index: 1; 
  }

  .card .c1 {
    width: 100%;
    max-width: 300px;
    text-align: center;
    margin: 0 auto;
  }

  .home img,
  .project-card img,
  .service-card img {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
    object-fit: cover;
  }

  .info-home h1 { font-size: 26px; }
  .info-home h3 { font-size: 18px; }
  .info-p, .info-p2, .home-p, .about p, .project p, .service-card p, .contact p {
    font-size: 14px;
  }
  .project-card h3, .service-card h3 { font-size: 16px; }

  .contact-content {
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .contact-info, .contact-form {
    width: 100%;
    max-width: 400px;
  }

  html, body {
    overflow-x: hidden;
  }
}

/* ==========================================================================
   Dark Mode + Language Switch + Coder-style background
   ========================================================================== */

:root{
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --text: #111111;
  --text-muted: #555555;
  --border: #000000;
  --accent: #474af0;
  --nav-bg: #ffffff;
  --card-bg: #ffffff;
  --card-shadow: rgba(0,0,0,0.1);
  --code-line: rgba(71,74,240,0.08);
  --code-dot: rgba(71,74,240,0.18);
}

html[data-theme="dark"]{
  --bg: #0b0f19;
  --bg-elevated: #111726;
  --text: #e8eaf2;
  --text-muted: #9aa3b8;
  --border: #2a3350;
  --accent: #6c72ff;
  --nav-bg: #111726;
  --card-bg: #131a2b;
  --card-shadow: rgba(0,0,0,0.5);
  --code-line: rgba(108,114,255,0.10);
  --code-dot: rgba(108,114,255,0.22);
}

html, body{
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* coder-style ambient background: dot grid + faint code lines */
body{
  background-image:
    linear-gradient(var(--code-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--code-line) 1px, transparent 1px),
    radial-gradient(var(--code-dot) 1px, transparent 1px);
  background-size: 42px 42px, 42px 42px, 14px 14px;
  background-position: 0 0, 0 0, 0 0;
}

#code-rain{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
}

.header-list, .ul-list{ background-color: var(--nav-bg); }
.ul-list{ box-shadow: 0 2px 8px var(--card-shadow); }
.ul-list li a{ color: var(--text); }
.ul-list li.active{ background-color: var(--accent); }
.ul-list li.active a, .ul-list li.active i{ color: #fff; }

.info-home h1, .info-home h3, .about h1, .about h2, .project h1, .services h1, .contact h1{
  color: var(--text);
}

.home-p{ color: var(--text); }
.info-p, .info-p2, .about p, .project p, .services p, .contact p, .info-pro p, .about-info p{
  color: var(--text-muted);
}

.info-home h3{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 28px;
  color: var(--accent);
}
.info-home h3 .cursor{
  display: inline-block;
  margin-left: 2px;
  animation: blink 0.9s steps(1) infinite;
  color: var(--accent);
}
@keyframes blink{ 50%{ opacity: 0; } }

.btn-home2{ border-color: var(--text); color: var(--text); }
.btn-home2:hover{ background-color: var(--accent); border-color: var(--accent); color:#fff; }
.btn-home1{ background-color: var(--accent); }

.follow ul a{ color: var(--text); }

.c1{ border-color: var(--border); background-color: var(--card-bg); color: var(--text); }
.c1 p{ color: var(--text-muted); }
.c1:hover{ border-color: var(--accent); background-color: var(--code-line); box-shadow: 0 4px 15px var(--card-shadow); }

.project-card, .service-card{ background: var(--card-bg); box-shadow: 0 5px 15px var(--card-shadow); color: var(--text); }
.project-card h3{ color: var(--accent); }
.project-card p{ color: var(--text-muted); }

.skills a{ background: var(--code-line); color: var(--accent); }
.skills a:hover{ background: var(--code-dot); }

.btn{ background: var(--accent); }
.btn:hover{ background: var(--accent); filter: brightness(1.15); }

.service-card h3{ color: var(--accent); }
.service-card p{ color: var(--text-muted); }
.service-card::before{ background: var(--accent); }

.contact-item{ color: var(--text); }
.contact-item i{ color: var(--accent); }
.social-link{ background: var(--code-line); color: var(--text); }

.contact-form input, .contact-form textarea{
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}
.contact-form input:focus, .contact-form textarea:focus{ border-color: var(--accent); }
.btn-send{ background: var(--accent); }
.btn-send:hover{ filter: brightness(1.15); }

.footer{ background-color: var(--bg-elevated); color: var(--text); border-top: 1px solid var(--border); }
.footer-links li a{ color: var(--text); }
.footer-links li a:hover{ color: var(--accent); }
.footer-social a{ color: var(--text); }
.footer-social a:hover{ color: var(--accent); }

/* ---- floating controls (dark mode + language) ---- */
#ui-controls{
  position: fixed;
  bottom: 40px;
  left: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1001;
}

#theme-toggle, #lang-toggle{
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--card-shadow);
  transition: transform 0.25s ease, background 0.3s ease;
}

#theme-toggle:hover, #lang-toggle:hover{ transform: scale(1.12); }

@media (max-width: 768px){
  #ui-controls{ left: 16px; bottom: 16px; }
  #theme-toggle, #lang-toggle{ width: 42px; height: 42px; font-size: 12px; }
}

/* ---- Arabic / RTL support ---- */
html[lang="ar"] body{
  font-family: 'Tajawal', 'Cairo', sans-serif;
}
html[lang="ar"] .info-home h1,
html[lang="ar"] .about h1,
html[lang="ar"] .about h2,
html[lang="ar"] .project h1,
html[lang="ar"] .services h1,
html[lang="ar"] .contact h1,
html[lang="ar"] .project-card h3,
html[lang="ar"] .service-card h3{
  font-family: 'Cairo', 'Tajawal', sans-serif;
}
html[lang="ar"] .info-home h3{
  font-family: 'JetBrains Mono', 'Tajawal', monospace;
}
html[lang="ar"] .ul-list{ gap: 2.2rem; }
html[lang="ar"] .btnn, html[lang="ar"] .info-p2, html[lang="ar"] .btns, html[lang="ar"] .skills{
  direction: rtl;
}

#loading-screen{ background-color: #05060a; }

/* ---- Download CV as anchor (matches button style) ---- */
.btn-home2{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

/* ==========================================================================
   Skills Section
   ========================================================================== */
.skills-section{
  margin: 160px 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.skills-section p{
  padding-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 2px;
}

.skills-section h1{
  font-family: "Open Sans", sans-serif;
  padding-bottom: 10px;
  color: var(--text);
}

.skills-section hr{ width: 10%; }

.skills-grid{
  padding-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  max-width: 1000px;
  width: 100%;
  margin: auto;
}

.skill-item{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 5px 15px var(--card-shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-item:hover{
  transform: translateY(-5px);
  border-color: var(--accent);
}

.skill-head{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.skill-icon{
  font-size: 20px;
  color: var(--accent);
  width: 24px;
  text-align: center;
}

.skill-name{
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.skill-percent{
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.skill-bar-track{
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: var(--code-line);
  overflow: hidden;
}

.skill-bar-fill{
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), #8b8fff);
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-item.in-view .skill-bar-fill{
  width: var(--percent);
}

@media (max-width: 1024px){
  .skills-section{ margin: 20px auto; padding: 0 15px; text-align: center; }
  .skills-grid{ grid-template-columns: 1fr; }
}
