/* ================================================
   صفحة تفاصيل المشروع - الأنماط والتنسيقات
   ================================================ */

:root {
  /* ألوان أساسية */
  --primary-color: #3a7bd5;
  --primary-light: #6fa0e3;
  --primary-dark: #2a5da8;
  --secondary-color: #00d2ff;
  --accent-color: #ff8700;

  /* ألوان وظيفية */
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --info-color: #3498db;

  /* ألوان محايدة */
  --dark-color: #2c3e50;
  --light-color: #ecf0f1;
  --gray-color: #7f8c8d;
  --white-color: #ffffff;

  /* تدرجات لونية */
  --primary-gradient: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  --accent-gradient: linear-gradient(135deg, var(--accent-color), #ffbc4f);

  /* متغيرات التصميم */
  --border-radius-sm: 5px;
  --border-radius: 10px;
  --border-radius-lg: 15px;
  --border-radius-xl: 20px;
  --border-radius-round: 50%;

  /* الظلال */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.2);

  /* تأثيرات الانتقال */
  --transition-fast: 0.2s ease;
  --transition: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* أبعاد القسم */
  --section-padding: 80px 0;
  --section-padding-sm: 60px 0;
}

/* ================================================
   قسم البطاقة الرئيسية
   ================================================ */
.project-hero {
  position: relative;
  padding: 180px 0 100px;
  color: #fff;
  overflow: hidden;
  --project-color: var(--primary-color);
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hero-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(var(--project-color), 0.7) 100%
  );
  z-index: -1;
}

.hero-wave {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 1;
}

.hero-wave svg {
  width: 100%;
  height: 100px;
}

.project-hero-content {
  position: relative;
  z-index: 2;
  padding: 20px 0;
}

.project-category {
  display: inline-block;
  margin-bottom: 15px;
}

.project-category a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 15px;
  border-radius: 30px;
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.project-category a:hover {
  background-color: var(--project-color);
  transform: translateY(-3px);
}

.project-hero .project-title {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.3;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 6px 15px;
  border-radius: 30px;
  font-size: 14px;
}

.project-breadcrumb {
  margin-bottom: 25px;
}

.breadcrumb {
  padding: 10px 0;
  background: transparent;
  margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.7);
}

.breadcrumb-item a {
  color: #fff;
  opacity: 0.8;
  text-decoration: none;
}

.breadcrumb-item.active {
  color: #fff;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 30px;
  font-size: 14px;
  transition: var(--transition);
}

.project-actions .btn-light {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.project-actions .btn-light:hover {
  background-color: #fff;
  color: var(--project-color);
}

.project-stats {
  display: flex;
  gap: 15px;
}

.project-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  opacity: 0.8;
}

/* ================================================
   قسم قبل وبعد
   ================================================ */
.project-before-after {
  padding: var(--section-padding-sm);
  background-color: #f8f9fa;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark-color);
}

.section-subtitle {
  font-size: 16px;
  color: var(--gray-color);
  max-width: 700px;
  margin: 0 auto;
}

.before-after-slider {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.before-image,
.after-image {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.before-image img,
.after-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.after-image {
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.image-label {
  position: absolute;
  top: 20px;
  padding: 5px 15px;
  border-radius: 30px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 14px;
  font-weight: 600;
  z-index: 2;
}

.before-image .image-label {
  right: 20px;
}

.after-image .image-label {
  left: 20px;
}

.slider-handle {
  position: absolute;
  top: 0;
  right: 50%;
  width: 2px;
  height: 100%;
  background-color: #fff;
  cursor: ew-resize;
  z-index: 3;
}

.slider-button {
  position: absolute;
  top: 50%;
  right: 50%;
  transform: translate(50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #fff;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  cursor: ew-resize;
}

/* ================================================
   قسم تفاصيل المشروع
   ================================================ */
.project-details {
  padding: var(--section-padding);
}

.project-content-wrapper {
  background-color: #fff;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  padding: 30px;
  height: 100%;
}

.content-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  color: var(--dark-color);
}

.rich-text {
  line-height: 1.8;
  color: #555;
}

.rich-text p {
  margin-bottom: 15px;
}

.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6 {
  margin-top: 25px;
  margin-bottom: 15px;
  color: var(--dark-color);
}

.rich-text ul,
.rich-text ol {
  padding-right: 20px;
  margin-bottom: 20px;
}

.rich-text li {
  margin-bottom: 8px;
}

.materials-list {
  background-color: #f9f9f9;
  border-radius: var(--border-radius);
  padding: 20px;
}

.material-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #eee;
}

.material-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.material-item i {
  color: var(--success-color);
}

.team-members {
  margin-top: 20px;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.team-member:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.member-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.member-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 0;
}

.gallery-grid {
  margin-top: 20px;
}

.gallery-item {
  display: block;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  height: 200px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  opacity: 0;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.video-wrapper {
  margin-top: 20px;
}

.responsive-iframe {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--border-radius);
}

.responsive-iframe iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.client-testimonial .testimonial-card {
  position: relative;
  padding: 25px;
  background-color: #f9f9f9;
  border-radius: var(--border-radius-lg);
  margin-top: 20px;
}

.testimonial-icon {
  position: absolute;
  top: -15px;
  right: 30px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.testimonial-content {
  font-style: italic;
  line-height: 1.8;
  margin-bottom: 15px;
  color: #555;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.author-name {
  font-weight: 700;
  color: var(--dark-color);
}

.author-location {
  color: var(--gray-color);
  font-size: 14px;
  margin-top: 5px;
}

.project-rating .rating-card {
  padding: 20px;
  border-radius: var(--border-radius);
  background-color: #f9f9f9;
  margin-top: 15px;
}

.rating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.rating-label {
  font-weight: 600;
  color: var(--dark-color);
}

.rating-count {
  color: var(--gray-color);
}

.rating-count i {
  color: var(--danger-color);
}

.rating-stars {
  display: flex;
  justify-content: center;
  font-size: 30px;
  cursor: pointer;
}

.rating-stars .fa-heart {
  color: #ddd;
  transition: var(--transition);
}

.rating-stars .fa-heart:hover,
.rating-stars .fa-heart.fas {
  color: var(--danger-color);
  transform: scale(1.2);
}

.rating-message {
  text-align: center;
  margin-top: 10px;
  min-height: 20px;
  font-size: 14px;
}

.project-cta .cta-card {
  border-radius: var(--border-radius);
  background-color: #f2f7ff;
  padding: 25px;
  border-left: 4px solid var(--primary-color);
}

.cta-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark-color);
}

.cta-text {
  color: var(--gray-color);
  margin-bottom: 0;
}

/* ================================================
   قسم السايدبار
   ================================================ */
.project-sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-card {
  background-color: #fff;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  padding: 25px;
  margin-bottom: 25px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  color: var(--dark-color);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px dashed #eee;
}

.info-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-color);
}

.info-value {
  font-weight: 600;
  color: var(--dark-color);
}

.info-value a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

.info-value a:hover {
  color: var(--primary-dark);
}

.related-services .services-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: var(--border-radius);
  background-color: #f9f9f9;
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

.service-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  background-color: #f2f7ff;
}

.service-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background-color: var(--primary-light);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.service-info {
  flex-grow: 1;
}

.service-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--dark-color);
}

.service-desc {
  font-size: 14px;
  color: var(--gray-color);
  margin-bottom: 0;
}

.share-project .share-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  transition: var(--transition);
  text-decoration: none;
}

.share-btn:hover {
  transform: translateY(-3px);
  color: #fff;
}

.share-btn.facebook {
  background-color: #3b5998;
}

.share-btn.twitter {
  background-color: #1da1f2;
}

.share-btn.whatsapp {
  background-color: #25d366;
}

.share-btn.linkedin {
  background-color: #0077b5;
}

.share-btn.telegram {
  background-color: #0088cc;
}

.contact-card .card-text {
  margin-bottom: 20px;
  color: var(--gray-color);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.contact-info .info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: none;
  padding-bottom: 0;
}

.contact-info i {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: #f2f7ff;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-info a {
  color: var(--dark-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

.contact-info a:hover {
  color: var(--primary-color);
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-block {
  display: block;
  width: 100%;
}

/* ================================================
   قسم المشاريع المشابهة
   ================================================ */
.related-projects {
  background-color: #f8f9fa;
  padding: var(--section-padding-sm);
}

.related-projects-slider {
  padding: 20px 5px 60px;
}

.project-card {
  background-color: #fff;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 100%;
}

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

.project-card .project-image {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.project-card .project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.featured-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: rgba(255, 193, 7, 0.8);
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 30px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0) 50%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: #fff;
  opacity: 0;
  transition: var(--transition);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.overlay-content {
  transform: translateY(20px);
  transition: var(--transition-slow);
}

.project-card:hover .overlay-content {
  transform: translateY(0);
}

.project-card .project-content {
  padding: 20px;
}

.project-card .project-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.project-card .project-title a {
  color: var(--dark-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

.project-card .project-title a:hover {
  color: var(--primary-color);
}

.project-card .project-meta {
  margin-bottom: 0;
  padding: 0;
}

.project-card .meta-item {
  font-size: 13px;
  padding: 4px 10px;
}

.swiper-button-next,
.swiper-button-prev {
  color: var(--primary-color);
  background-color: rgba(255, 255, 255, 0.9);
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 20px;
}

.swiper-pagination-bullet {
  background: var(--primary-color);
}

/* ================================================
   قسم دعوة للعمل (CTA)
   ================================================ */
.cta-section {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary-color) 100%
  );
  padding: 70px 0;
  color: #fff;
}

.cta-wrapper {
  border-radius: var(--border-radius-lg);
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-content h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 15px;
}

.cta-content p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.cta-features {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.cta-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 5px 15px;
  border-radius: 30px;
}

.cta-features i {
  color: #fff;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cta-buttons .btn {
  padding: 12px 25px;
}

.btn-outline-light {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline-light:hover {
  background-color: #fff;
  color: var(--primary-dark);
}

/* ================================================
   نافذة قبل وبعد
   ================================================ */
.before-after-modal-slider {
  height: 500px;
}

/* ================================================
   زر العودة لأعلى
   ================================================ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: var(--shadow);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-dark);
  color: #fff;
  transform: translateY(-5px);
}

/* ================================================
   تحسينات التجاوب
   ================================================ */
@media (max-width: 1199.98px) {
  .project-hero .project-title {
    font-size: 36px;
  }

  .before-after-slider {
    height: 400px;
  }
}

@media (max-width: 991.98px) {
  .project-hero {
    padding: 150px 0 80px;
  }

  .project-hero .project-title {
    font-size: 32px;
  }

  .before-after-slider {
    height: 350px;
  }

  .project-sidebar {
    margin-top: 30px;
    position: static;
  }
}

@media (max-width: 767.98px) {
  .project-hero {
    padding: 130px 0 60px;
  }

  .project-hero .project-title {
    font-size: 28px;
  }

  .before-after-slider {
    height: 300px;
  }

  .section-title {
    font-size: 24px;
  }

  .project-actions {
    flex-direction: column;
    gap: 15px;
  }

  .action-buttons {
    justify-content: center;
  }

  .project-stats {
    justify-content: center;
  }

  .gallery-item {
    height: 150px;
  }
}

@media (max-width: 575.98px) {
  .project-hero {
    padding: 120px 0 50px;
  }

  .project-hero .project-title {
    font-size: 24px;
  }

  .before-after-slider {
    height: 250px;
  }

  .meta-item {
    font-size: 12px;
    padding: 5px 10px;
  }

  .project-content-wrapper {
    padding: 20px;
  }

  .action-buttons {
    gap: 8px;
  }

  .project-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .service-item {
    flex-direction: column;
    text-align: center;
  }

  .gallery-item {
    height: 120px;
  }
}

/* ================================================
   تحسينات الأداء والوصولية
   ================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .project-hero {
    padding: 20px 0;
    color: #000;
    background: none !important;
  }

  .project-hero .project-title {
    font-size: 24px;
  }

  .hero-bg,
  .hero-overlay,
  .hero-wave,
  .project-actions,
  .project-breadcrumb,
  .before-after-slider,
  .project-gallery,
  .project-rating,
  .project-cta,
  .related-projects,
  .cta-section,
  .back-to-top,
  .share-project,
  .contact-card,
  footer {
    display: none !important;
  }

  .project-content-wrapper,
  .sidebar-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .project-meta {
    display: block;
  }

  .meta-item {
    display: inline-block;
    background: none;
    padding: 0;
    margin-right: 15px;
  }
}
