/* Item Modal Styling - Enhanced Version with Landing Page Design */
.item-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  direction: rtl; /* For Arabic text */
  backdrop-filter: blur(3px);
  font-family: 'Tajawal', sans-serif;
}

.item-modal-container {
  background-color: rgba(20, 20, 20, 0.95);
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 30px rgba(230, 184, 0, 0.3);
  max-width: 90%;
  max-height: 85%;
  width: 900px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 2px solid rgba(230, 184, 0, 0.7);
  background-image: 
    linear-gradient(rgba(20, 20, 20, 0.97), rgba(20, 20, 20, 0.97)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e6b800' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  animation: modalFadeIn 0.4s ease-out;
}

/* Create elegant border for modal */
.item-modal-container::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px; 
  padding: 2px; 
  background: linear-gradient(
      135deg, 
      transparent 0%, 
      rgba(230, 184, 0, 0.7) 30%, 
      rgba(243, 199, 24, 0.7) 70%, 
      transparent 100%
  ); 
  -webkit-mask: 
      linear-gradient(#fff 0 0) content-box, 
      linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

.item-modal-header {
  background: linear-gradient(to right, #c29900, #e6b800, #f3c718);
  color: #000;
  padding: 18px 25px;
  font-size: 26px;
  font-weight: 700;
  text-align: right;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Decorative line below header */
.item-modal-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(to right, transparent, #000, transparent);
}

.item-modal-close {
  font-family: 'Tajawal', sans-serif;
  background: rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: 50px;
  color: #000;
  font-size: 18px;
  cursor: pointer;
  padding: 5px 15px;
  margin-right: 15px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.item-modal-close:hover {
  background: rgba(0, 0, 0, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.item-modal-body {
  padding: 30px;
  overflow-y: auto;
  max-height: 600px;
  font-family: 'Tajawal', sans-serif;
  font-size: 20px;
  line-height: 1.8;
  white-space: pre-line; /* This preserves line breaks */
  text-align: right;
  color: #ffffff;
  border-right: 4px solid rgba(230, 184, 0, 0.2);
  background-image: linear-gradient(
    to left,
    rgba(230, 184, 0, 0.05) 0%,
    rgba(0, 0, 0, 0) 20%
  );
  position: relative;
}

.item-modal-body > * {
  animation: contentFadeIn 0.6s ease-out forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom Scrollbar Styling */
.item-modal-body::-webkit-scrollbar {
  width: 10px;
}

.item-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.item-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(
    to bottom,
    rgba(230, 184, 0, 0.5),
    rgba(230, 184, 0, 0.8)
  );
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.item-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    to bottom,
    rgba(230, 184, 0, 0.7),
    rgba(230, 184, 0, 1)
  );
}

/* For Firefox */
.item-modal-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 184, 0, 0.7) rgba(0, 0, 0, 0.2);
}

/* First paragraph styling for better typography */
.item-modal-body p:first-child,
.item-modal-body br:first-child + p {
  font-size: 22px;
  color: rgba(230, 184, 0, 0.9);
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Enhanced animation with gold accents */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
    box-shadow: 0 0 0 rgba(230, 184, 0, 0);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 30px rgba(230, 184, 0, 0.3);
  }
}

/* Add decorative ornament to modal footer */
.item-modal-body::after {
  content: "";
  display: block;
  width: 60px;
  height: 30px;
  margin: 20px auto 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='30' viewBox='0 0 60 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 15 L15 0 L30 15 L45 0 L60 15 L45 30 L30 15 L15 30 Z' fill='%23e6b800' fill-opacity='0.3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 5px rgba(230, 184, 0, 0.5));
}

/* Gallery custom scrollbars with gold accents */
#gallery::-webkit-scrollbar {
  height: 8px;
  background: rgba(0, 0, 0, 0.2);
}

#gallery::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin: 0 15px;
}

#gallery::-webkit-scrollbar-thumb {
  background: linear-gradient(
    to right,
    rgba(230, 184, 0, 0.5),
    rgba(230, 184, 0, 0.8)
  );
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

#gallery::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    to right,
    rgba(230, 184, 0, 0.7),
    rgba(230, 184, 0, 1)
  );
}

/* For Firefox */
#gallery {
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 184, 0, 0.7) rgba(0, 0, 0, 0.2);
}

/* Enhance gallery item appearance */
.thumbnail {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.thumbnail:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.thumbnail.active {
  transform: translateY(-5px) scale(1.1);
}

/* Modal title with ornament styling */
.modal-title {
  display: flex;
  align-items: center;
  line-height: 1.3;
}

.header-ornament {
  margin-left: 10px;
  margin-right: 10px;
  display: flex;
  align-items: center;
}

.header-ornament svg {
  width: 24px;
  height: 24px;
}

/* Image styling for item modal */
.item-image {
  text-align: center;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(230, 184, 0, 0.3);
  background: rgba(0, 0, 0, 0.2);
}

.item-image img {
  max-width: 100%;
  max-height: 350px;
  display: block;
  margin: 0 auto;
}

/* Add responsive styles for mobile */
@media (max-width: 768px) {
  .item-modal-container {
    max-width: 95%;
    max-height: 90%;
    width: 100%;
  }
  
  .item-modal-header {
    padding: 12px 15px;
    font-size: 20px;
  }
  
  .item-modal-body {
    padding: 15px;
    max-height: 450px;
    font-size: 16px;
    line-height: 1.6;
  }
  
  .item-modal-close {
    padding: 4px 10px;
    font-size: 16px;
  }
  
  .item-image img {
    max-height: 250px;
  }
  
  /* First paragraph styling for better typography */
  .item-modal-body p:first-child,
  .item-modal-body br:first-child + p {
    font-size: 18px;
    margin-bottom: 15px;
  }
}

/* Style for mobile-specific tap targets */
@media (max-width: 768px) {
  .thumbnail {
    min-width: 60px; /* Ensure minimum tap target size */
  }
  
  #controls button {
    min-height: 44px; /* Ensure minimum tap target height */
    min-width: 44px;  /* Ensure minimum tap target width */
  }
} 