/* PROJECTS SLIDER */
.projects-wrapper {
  position: relative;
  max-width: 1100px;
  margin: auto;
  padding: 0 60px;       /* مساحة للأسهم يمين وشمال */
  overflow: hidden;      /* مهم: يخفي أي كروت خارج الإطار */
}

.projects-slider {
  display: flex;
  gap: 20px;
  transition: transform 0.5s ease;
  direction: ltr;
}


/* FLIP CARD */
.flip-card {
  flex: 0 0 calc((100% - 40px) / 3);
  max-width: calc((100% - 40px) / 3);
  height: 260px;
  perspective: 1000px;
}

.flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 15px #0004;
}

.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 14px;
}

/* FRONT */
.flip-front {
  background-size: cover;
  background-position: center;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* BACK */
.flip-back {
  background: #000000;
  color: #ffffff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  text-align: center;
  direction: rtl;
  transform: rotateY(180deg);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
}

/* hover flip */
.flip-card:hover .flip-inner {
  transform: rotateY(180deg);
}

.flip-card:hover .flip-front {
  opacity: 0;
}

.flip-card:hover .flip-back {
  opacity: 1;
}

/* Grid لصفحة جميع المشاريع */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 300px);
  justify-content: center;
  gap: 20px;
}


/* عشان flip-card داخل الجريد يمشي صح */
.projects-grid .flip-card {
  flex: 1 1 auto;
  max-width: 100%;
  width: 100%;
}

/* slider arrows */
.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--accent);
  color: var(--primary);
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  transition: 0.25s ease;
  backdrop-filter: blur(4px);
}

.slide-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.slide-btn.left { left: 10px; }
.slide-btn.right { right: 10px; }

/* FLASH MESSAGES */
.flash-container {
  max-width: 1100px;
  margin: 150px auto 0;
  padding: 0 20px;
}

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.flash-success {
  background: #d1f2d1;
  color: #145214;
}

.flash-error {
  background: #ffd3d3;
  color: #801010;
}

/* ADMIN FORMS */
.admin-form {
  max-width: 600px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.admin-form label {
  font-size: 14px;
  color: #222;
}

.admin-form input,
.admin-form textarea {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.admin-form button {
  background: var(--primary);
  color: var(--accent);
  border: none;
  padding: 10px 16px;
  border-radius: 16px;
  cursor: pointer;
  margin-top: 10px;
}

.admin-actions {
  margin-bottom: 15px;
  text-align: left;
}

.btn-admin {
  display: inline-block;
  background: var(--primary);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 16px;
  text-decoration: none;
  font-size: 14px;
}

.btn-admin:hover {
  opacity: 0.9;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: right;
}

.admin-table th {
  background: var(--section-bg);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #c00;
  cursor: pointer;
  font-size: 14px;
}

/* card link */
.card-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* ===== Image Modal (Gallery Zoom + Navigation) ===== */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.image-modal.show {
  display: flex;
}

.image-modal-content {
  position: relative;
  max-width: 60vw;   /* أصغر من الأول */
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-img {
  width: auto;
  height: auto;
  max-width: 60vw;
  max-height: 60vh;
  border-radius: 10px;
  box-shadow: 0 4px 20px #0008;
}

/* زرار X */
.image-modal-close {
  position: absolute;
  top: -15px;
  left: -15px;
  background: #fff;
  color: #000;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px #0008;
}

/* أسهم التنقل */
.image-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-nav.prev {
  right: 100%;
  margin-right: 10px;
}

.image-modal-nav.next {
  left: 100%;
  margin-left: 10px;
}

.image-modal-nav:hover {
  background: rgba(255, 255, 255, 0.8);
  color: #000;
}

.project-gallery-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  position: relative;
}

/* أنيميشن السلايد */
.project-gallery.slide-left {
  animation: gallerySlideLeft 0.35s ease;
}

.project-gallery.slide-right {
  animation: gallerySlideRight 0.35s ease;
}

@keyframes gallerySlideLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes gallerySlideRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}


.project-gallery-item {
  flex: 0 0 calc(50% - 10px); /* صورتين في الصف = 4 صور في الصفحة */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px #0002;
}

.project-gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  cursor: pointer;
}

/* أزرار تقليب الجاليري */
.gallery-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px #0004;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: 0.2s;
}

.gallery-nav:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}

.gallery-nav:disabled {
  opacity: 0.4;
  cursor: default;
}

/* كروت المشاريع */
.flip-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  background: #000;
}

.flip-back {
  background: #0f172a;
  color: #e5e7eb;
}

.flip-back h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

/* أزرار السلايدر */
.slide-btn {
  background: #ffffff;
  border: 2px solid var(--primary-soft);
  color: var(--primary);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.slide-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* فورم التواصل */
.contact-form {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.contact-form input,
.contact-form textarea {
  border-radius: 10px;
  border: 1px solid #d4d4d8;
}

.contact-form button {
  background: var(--primary);
  color: #fff;
}

.contact-form button:hover {
  opacity: 0.9;
}


/* ===== Glassmorphism على كروت المشاريع ===== */
.flip-card {
  background: transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.flip-inner {
  border-radius: var(--radius-lg);
}

/* وش الكارت */
.flip-front {
  background-color: #020617;
}

/* ظهر الكارت */
.flip-back {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 64, 175, 0.9));
  color: #e5e7eb;
  border-top: 1px solid rgba(96, 165, 250, 0.6);
  border-bottom: 1px solid rgba(56, 189, 248, 0.6);
}

/* أزرار السلايدر */
.slide-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.9);
}
.slide-btn:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #020617;
}

/* فورم التواصل */
.contact-form {
  background: rgba(15, 23, 42, 0.75);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: var(--shadow-soft);
}

.contact-form input,
.contact-form textarea {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--text-main);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
}

.contact-form button {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #020617;
  border-radius: 999px;
  border: none;
}

/* جالاري المشروع */
.project-gallery-item {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--shadow-soft);
}

/* مودال الصور */
.image-modal {
  background: radial-gradient(circle at top, rgba(15,23,42,0.95), rgba(15,23,42,0.98));
}
.image-modal-content {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

/* كروت الشركة / بيانات التواصل في صفحة الشركة */
.company-contact-box {
  background: rgba(15, 23, 42, 0.75);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

/* الماب */
.map-container,
.company-map {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: var(--shadow-soft);
}

/* فورم الأدمن + تابل الأدمن بشكل زجاجي برضه */
.admin-form {
  background: rgba(15, 23, 42, 0.7);
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.admin-form input,
.admin-form textarea {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-main);
}

.admin-table {
  background: rgba(15, 23, 42, 0.7);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.admin-table th {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
}

.admin-table td {
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-muted);
}

/* ===== Glass Light Blue – Components ===== */

/* كروت المشاريع */
.flip-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  background: transparent;
}

.flip-inner {
  border-radius: var(--radius-lg);
}

.flip-front {
  background-color: #f3f4ff;
}

.flip-back {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  border-top: 1px solid rgba(200, 220, 255, 0.9);
  border-bottom: 1px solid rgba(200, 220, 255, 0.9);
}

.flip-back h3 {
  color: var(--primary-strong);
}

/* أزرار السلايدر */
.slide-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(200, 220, 255, 0.9);
  color: var(--primary-strong);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}
.slide-btn:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0b1120;
}

/* فورم التواصل */
.contact-form {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(210, 225, 250, 0.9);
  box-shadow: var(--shadow-soft);
}

.contact-form input,
.contact-form textarea {
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid rgba(209, 213, 219, 1);
  color: var(--text-main);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
}

.contact-form button {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #0b1120;
  border-radius: 999px;
  border: none;
}

/* جالاري المشروع */
.project-gallery-item {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  border: 1px solid rgba(210, 225, 250, 0.9);
  box-shadow: var(--shadow-soft);
}

/* مودال الصور */
.image-modal {
  background: rgba(15, 23, 42, 0.75);
}
.image-modal-content {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  border: 1px solid rgba(210, 225, 250, 0.9);
}

/* الماب */
.map-container,
.company-map {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(210, 225, 250, 0.9);
  box-shadow: var(--shadow-soft);
}

/* فورم الأدمن / تابل الأدمن */
.admin-form {
  background: rgba(255, 255, 255, 0.9);
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(210, 225, 250, 0.9);
}

.admin-form input,
.admin-form textarea {
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid rgba(209, 213, 219, 1);
  color: var(--text-main);
}

.admin-table {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.admin-table th {
  background: #eff4ff;
  color: var(--text-main);
}

.admin-table td {
  background: #ffffff;
  color: var(--text-muted);
}

/* شريط أزرار لوحة التحكم */
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  align-items: center;
}

/* تاب عادي */
.admin-tab {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(210, 225, 250, 0.9);
  color: var(--primary-strong);
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  transition: 0.2s;
}

.admin-tab:hover {
  background: #f9fbff;
}

/* تاب نشط */
.admin-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0b1120;
  border-color: transparent;
}

/* زرار إضافة مشروع جديد (CTA) */
.admin-cta {
  margin-right: auto; /* يخليه يروح على الشمال في RTL، عدل لو حابب */
  padding: 9px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0b1120;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
  transition: 0.2s;
}

.admin-cta:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
}

/* أكشنز الجدول */
.table-actions {
  white-space: nowrap;
  font-size: 13px;
}

.table-actions .divider {
  color: #cbd5f5;
  margin: 0 4px;
}

.action-link {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 2px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  transition: 0.2s;
}

/* عرض */
.action-view {
  color: var(--primary-strong);
}

/* تعديل */
.action-edit {
  color: #ca8a04; /* أصفر غامق شوية */
}

/* حذف */
.action-delete {
  color: #dc2626;
}

/* hover */
.action-link:hover {
  text-decoration: underline;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* علشان الـ RTL مايلعبش فى الاتجاه */
  direction: ltr;
  unicode-bidi: bidi-override;
}

/* السهم نفسه */
.gallery-arrow {
  display: block;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* سهم الشمال */
.gallery-arrow-left {
  border-right: 12px solid #ffffff;
}

/* سهم اليمين */
.gallery-arrow-right {
  border-left: 12px solid #ffffff;
}

/* أماكن الأزرار */
.gallery-prev {
  left: 10px;
}

.gallery-next {
  right: 10px;
}

/* ===== admin responsive fixes ===== */

/* 1) اجعل الحاوية الجدولية قابلة للتمرير أفقياً على الشاشات الصغيرة */
.admin-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* سلاسة في iOS */
  padding-bottom: 8px;
}

/* اضمن أن الجدول له عرض أدنى حتى يظهر شريط التمرير بدل كسر ال layout */
.admin-table-wrapper table {
  min-width: 820px; /* عدّل حسب عدد الأعمدة، اجعلها مساوية لعرض محتوى الجدول */
  width: 100%;
  border-collapse: collapse;
}

/* خلي الخلايا بكسر كلمات مناسب */
.admin-table-wrapper table td,
.admin-table-wrapper table th {
  white-space: normal;
  word-break: break-word;
  padding: 12px 10px;
}

/* صفوف أخف للقراءة */
.admin-table-wrapper table tbody tr {
  background: transparent;
}

/* 2) أزرار التابات بالأدمن — اجعلها تحت بعضها وتكون قابلة للالتفاف */
.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center; /* وسطهم */
  margin-bottom: 18px;
}

.admin-tab,
.admin-cta {
  padding: 10px 16px;
  border-radius: 28px;
  font-size: 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* 3) navbar الأدمن — أقل ارتفاعاً على الموبايل حتى لا يغطّي المحتوى */
@media (max-width: 768px) {
  .nav-bar.glass-nav.admin-nav {
    padding: 8px 12px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.55);
    border-radius: 14px;
    max-width: 96%;
    margin: 8px auto;
  }

  .brand-name {
    font-size: 14px;
  }

  .brand-logo { height: 30px; }

  .main-nav a { font-size: 13px; padding: 6px 10px; }

  /* اضبط المساحة العلوية للـ content حتى لا يختبئ تحته */
  body:not(.home) .section:first-of-type {
    margin-top: calc(var(--nav-fixed-height, 90px) + 6px);
  }
}

/* 4) تحسينات مرئية صغيرة للـ table controls (عرض|تعديل|حذف) */
.action-delete {
  background: transparent;
  color: #e04747;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
}

.action-edit {
  background: transparent;
  color: #ffb238;
  border: none;
  cursor: pointer;
}

.action-view {
  background: transparent;
  color: #2b8cff;
  border: none;
}

/* 5) تحسين المسافات العامة داخل الـ admin card */
.admin-card {
  padding: 16px;
  border-radius: 12px;
}

/* 6) لو عايز تخفي بعض الأعمدة على الموبايل (مثل ID أو Slug) */
@media (max-width: 520px) {
  .admin-table-wrapper table th.col-id,
  .admin-table-wrapper table td.col-id,
  .admin-table-wrapper table th.col-slug,
  .admin-table-wrapper table td.col-slug {
    display: none;
  }
}
