/* الأساسيات */
:root {
  --primary-color: #F05454;    /* لون أحمر فاتح */
  --secondary-color: #30475E;  /* لون أزرق غامق */
  --dark-color: #222831;       /* لون داكن */
  --light-color: #E8E8E8;      /* لون فاتح */
  --text-color: #222831;
  --text-light: #666;
  --white: #fff;
  --black: #000;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--light-color);
  color: var(--text-color);
  line-height: 1.6;
  font-family: 'Noto Sans Arabic', sans-serif;
  direction: rtl;
  transition: opacity 0.5s ease;
}

body[lang="en"] {
  font-family: 'Poppins', sans-serif;
  direction: ltr;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

section {
  padding: 80px 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: var(--text-color);
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn.secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  margin-right: 15px;
}

body[lang="en"] .btn.secondary {
  margin-right: 0;
  margin-left: 15px;
}

.btn.secondary:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

.section-title {
  font-size: 36px;
  margin-bottom: 50px;
  text-align: center;
  position: relative;
  color: var(--dark-color);
}

.section-title span {
  color: var(--primary-color);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  right: 50%;
  transform: translateX(50%);
  width: 80px;
  height: 3px;
  background-color: var(--primary-color);
}

body[lang="en"] .section-title::after {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}

/* تأثيرات AOS */
[data-aos="fade-up"] {
  opacity: 0;
  transform: translateY(20px);
}

[data-aos="fade-up"].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* تأثيرات Fade-in */
.fade-in {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* تأثيرات الحركة */
.service-card, .portfolio-item, .tool {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Header */
header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: var(--transition);
}

header.scrolled {
  padding: 10px 0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark-color);
}

.logo span {
  color: var(--primary-color);
}

nav ul {
  display: flex;
  align-items: center;
}

nav ul li {
  margin-right: 25px;
}

body[lang="en"] nav ul li {
  margin-right: 0;
  margin-left: 25px;
}

nav ul li a {
  font-weight: 600;
  position: relative;
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

body[lang="en"] nav ul li a::after {
  right: auto;
  left: 0;
}

nav ul li a:hover::after {
  width: 100%;
}

nav ul li a.active {
  color: var(--primary-color);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.language-switcher {
  position: relative;
}

.lang-toggle-wrapper {
  display: flex;
  border-radius: 25px;
  overflow: hidden;
  background-color: var(--dark-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lang-btn {
  padding: 8px 20px;
  background-color: var(--dark-color);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.lang-btn.active {
  background-color: var(--primary-color);
}

.lang-btn:hover:not(.active) {
  background-color: var(--secondary-color);
}

.menu-toggle {
  font-size: 24px;
  cursor: pointer;
  display: none;
}

/* الصفحة الرئيسية */
.home {
  padding-top: 150px;
  background-color: var(--light-color);
}

.home .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-content {
  flex: 1;
  padding-left: 50px;
}

body[lang="en"] .home-content {
  padding-left: 0;
  padding-right: 50px;
}

.home-content h1 {
  font-size: 48px;
  margin-bottom: 15px;
}

.home-content h1 span {
  color: var(--primary-color);
}

.home-content h2 {
  font-size: 24px;
  color: var(--text-light);
  margin-bottom: 20px;
  font-weight: 500;
}

.home-content p {
  margin-bottom: 30px;
  font-size: 18px;
  color: var(--text-light);
}

.social-links .links {
  display: flex;
  gap: 10px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--white);
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--primary-color);
  transform: translateY(-5px);
}

.social-links a:hover svg {
  fill: var(--white);
}

.home-image {
  flex: 1;
  text-align: center;
}

.home-image .img-box {
  max-width: 400px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
}

/* صفحة من أنا */
.about-content {
  display: flex;
  align-items: center;
  gap: 50px;
  margin-top: 50px;
}

.about-text {
  flex: 1;
}

.about-text h3 {
  font-size: 28px;
  margin-bottom: 20px;
}

.about-text p {
  margin-bottom: 20px;
  color: var(--text-light);
}

.skills {
  margin-top: 30px;
}

.skills h3 {
  font-size: 22px;
  margin-bottom: 20px;
}

.skill {
  margin-bottom: 20px;
}

.skill-name {
  margin-bottom: 10px;
  font-weight: 600;
}

.skill-bar {
  height: 10px;
  background-color: #ddd;
  border-radius: 5px;
  overflow: hidden;
}

.skill-level {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 5px;
}

.about-tools {
  flex: 1;
}

.about-tools h3 {
  font-size: 22px;
  margin-bottom: 20px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.tool {
  background-color: var(--white);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.tool:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.tool i {
  font-size: 40px;
  color: var(--primary-color);
  margin-bottom: 15px;
  display: block;
}

.tool span {
  font-weight: 600;
}

/* صفحة أعمالي */
.portfolio-filter {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 20px;
  background-color: var(--white);
  color: var(--dark-color);
  border: 1px solid var(--light-color);
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 240px;
  gap: 25px;
  grid-auto-flow: dense;
}

.portfolio-item {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  position: relative;
  background-color: var(--white);
  transition: opacity 0.3s ease;
}

.portfolio-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.portfolio-img {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.portfolio-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.portfolio-item:hover .portfolio-img img {
  transform: scale(1.08);
  filter: brightness(90%);
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(240, 84, 84, 0.9);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px;
  color: var(--white);
  text-align: center;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.portfolio-overlay p {
  font-size: 14px;
  margin-bottom: 15px;
  max-width: 90%;
}

.view-btn {
  padding: 8px 20px;
  background-color: var(--white);
  color: var(--primary-color);
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.view-btn:hover {
  background-color: var(--secondary-color);
  color: var(--white);
}

.portfolio-caption {
  padding: 12px;
  text-align: center;
  background-color: var(--white);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.portfolio-caption h4 {
  font-size: 16px;
  margin-bottom: 5px;
  color: var(--dark-color);
  font-weight: 600;
}

.portfolio-caption p {
  font-size: 13px;
  color: var(--text-light);
}

.portfolio-item.featured {
  grid-column: span 2;
  grid-row: span 2;
}

/* صفحة الخدمات */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

.service-card {
  background-color: var(--white);
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-icon {
  width: 70px;
  height: 70px;
  background-color: rgba(240, 84, 84, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--primary-color);
  font-size: 30px;
}

.service-card h3 {
  font-size: 22px;
  margin-bottom: 15px;
}

.service-card p {
  color: var(--text-light);
  margin-bottom: 20px;
}

.service-card ul {
  text-align: right;
  margin-bottom: 20px;
}

body[lang="en"] .service-card ul {
  text-align: left;
}

.service-card ul li {
  margin-bottom: 10px;
  position: relative;
  padding-right: 20px;
}

body[lang="en"] .service-card ul li {
  padding-right: 0;
  padding-left: 20px;
}

.service-card ul li::before {
  content: '→';
  position: absolute;
  right: 0;
  color: var(--primary-color);
}

body[lang="en"] .service-card ul li::before {
  content: '←';
  right: auto;
  left: 0;
}

.service-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 20px;
}

/* صفحة تواصل معي */
.contact-content {
  display: flex;
  gap: 50px;
  margin-top: 50px;
}

.contact-info {
  flex: 1;
}

.contact-info h3 {
  font-size: 24px;
  margin-bottom: 30px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 25px;
}

.info-item i {
  font-size: 20px;
  color: var(--primary-color);
  margin-left: 15px;
  margin-top: 5px;
}

body[lang="en"] .info-item i {
  margin-left: 0;
  margin-right: 15px;
}

.info-item h4 {
  font-size: 18px;
  margin-bottom: 5px;
}

.info-item p {
  color: var(--text-light);
}

.social-links h3 {
  font-size: 24px;
  margin: 30px 0 15px;
}

.contact-form {
  flex: 1;
  background-color: var(--white);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  transition: var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(240, 84, 84, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* الفوتر */
footer {
  background-color: var(--dark-color);
  color: var(--white);
  padding: 60px 0 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo .logo {
  color: var(--white);
  font-size: 24px;
  margin-bottom: 20px;
  display: block;
}

.footer-logo p {
  color: #aaa;
  margin-bottom: 20px;
}

.footer-links h3,
.footer-services h3 {
  font-size: 20px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-links h3::after,
.footer-services h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 2px;
  background-color: var(--primary-color);
}

body[lang="en"] .footer-links h3::after,
body[lang="en"] .footer-services h3::after {
  right: auto;
  left: 0;
}

.footer-links ul li,
.footer-services ul li {
  margin-bottom: 10px;
}

.footer-links ul li a,
.footer-services ul li a {
  color: #aaa;
  transition: var(--transition);
}

.footer-links ul li a:hover,
.footer-services ul li a:hover {
  color: var(--primary-color);
  padding-right: 5px;
}

body[lang="en"] .footer-links ul li a:hover,
body[lang="en"] .footer-services ul li a:hover {
  padding-right: 0;
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #aaa;
  font-size: 14px;
}

/* زر العودة للأعلى */
.back-to-top {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

body[lang="en"] .back-to-top {
  left: auto;
  right: 30px;
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--secondary-color);
  transform: translateY(-5px);
}

/* رسائل النجاح والخطأ */
.success-message,
.error-message {
  position: fixed;
  bottom: 20px;
  right: 20px;
  color: white;
  padding: 15px 20px;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.5s ease;
}

body[lang="en"] .success-message,
body[lang="en"] .error-message {
  right: auto;
  left: 20px;
}

.success-message {
  background-color: #28a745;
}

.error-message {
  background-color: #dc3545;
}

/* تحسين التباين */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* الاستجابة */
@media (max-width: 992px) {
  .menu-toggle {
    display: block;
  }
  
  nav {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 80%;
    max-width: 350px;
    height: calc(100vh - 80px);
    background-color: var(--white);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    z-index: 999;
  }
  
  body[lang="en"] nav {
    right: auto;
    left: -100%;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
  }
  
  nav.active {
    right: 0;
  }
  
  body[lang="en"] nav.active {
    right: auto;
    left: 0;
  }
  
  nav ul {
    flex-direction: column;
    padding: 30px;
  }
  
  nav ul li {
    margin: 0 0 20px;
  }
  
  .header-right {
    gap: 10px;
  }
  
  .lang-toggle-wrapper {
    flex-direction: row;
  }
  
  .lang-btn {
    padding: 10px 15px;
  }
  
  .home .container {
    flex-direction: column-reverse;
  }
  
  .home-content {
    padding-left: 0;
    margin-top: 50px;
    text-align: center;
  }
  
  body[lang="en"] .home-content {
    padding-right: 0;
  }
  
  .home-content .btn {
    margin-bottom: 15px;
  }
  
  .social-links .links {
    justify-content: center;
  }
  
  .about-content {
    flex-direction: column;
  }
  
  .contact-content {
    flex-direction: column;
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 220px;
    gap: 20px;
  }
  
  .portfolio-item.featured {
    grid-column: span 1;
    grid-row: span 1;
  }
  
  .portfolio-overlay h3 {
    font-size: 18px;
  }
  
  .portfolio-overlay p {
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }
  
  .section-title {
    font-size: 30px;
  }
  
  .home-content h1 {
    font-size: 36px;
  }
  
  .home-content h2 {
    font-size: 20px;
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 200px;
    gap: 15px;
  }
  
  .portfolio-caption h4 {
    font-size: 14px;
  }
  
  .portfolio-caption p {
    font-size: 12px;
  }
  
  .portfolio-overlay {
    padding: 10px;
  }
  
  .view-btn {
    padding: 6px 15px;
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  .home {
    padding-top: 120px;
  }
  
  .home-content h1 {
    font-size: 30px;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 250px;
    gap: 10px;
  }
  
  .portfolio-filter {
    gap: 10px;
  }
  
  .filter-btn {
    padding: 8px 15px;
    font-size: 13px;
  }
}