/**
 * Modern Item Page (Ad View) - Epsilon Theme
 * أحدث طرق التصميم والابداع لصفحة مشاهدة الإعلان
 */

/* ========== CSS Variables ========== */
body#item {
  --item-primary: #3b49df;
  --item-primary-hover: #2f3ab2;
  --item-primary-soft: rgba(59, 73, 223, 0.12);
  --item-surface: #ffffff;
  --item-surface-2: #f8f9fc;
  --item-border: #e2e6ee;
  --item-border-strong: #c8cdd9;
  --item-text: #171717;
  --item-text-muted: #5c6370;
  --item-text-light: #8b92a0;
  --item-radius: 12px;
  --item-radius-sm: 8px;
  --item-radius-lg: 16px;
  --item-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --item-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
  --item-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --item-gap: 24px;
}

/* ========== Main Layout ========== */
body#item .container.primary {
  padding-bottom: 32px;
  gap: var(--item-gap);
}

body#item .data-box {
  background: var(--item-surface);
  border-radius: var(--item-radius-lg);
  padding: var(--item-gap);
  box-shadow: var(--item-shadow);
  border: 1px solid var(--item-border);
  gap: var(--item-gap);
  transition: box-shadow var(--item-transition);
}

body#item .data-box:hover {
  box-shadow: var(--item-shadow-hover);
}

body#item .data-box.sold {
  padding: var(--item-gap);
  border-radius: var(--item-radius-lg);
}

body#item .data-box.sold:after {
  border-radius: var(--item-radius-lg);
}

/* ========== Gallery / Images ========== */
#item-image {
  margin: 0 0 16px 0;
  border-radius: var(--item-radius);
  overflow: hidden;
  background: #0f0f0f;
  position: relative;
}

#item-image .swiper-container {
  border-radius: var(--item-radius);
  overflow: hidden;
}

#item-image li a img {
  border-radius: var(--item-radius);
  transition: transform var(--item-transition);
}

#item-image li a:hover img {
  transform: scale(1.02);
}

#item-image .swiper-button {
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  color: var(--item-text);
  transition: all var(--item-transition);
}

#item-image .swiper-button i {
  width: 100%;
  height: 100%;
  line-height: 48px;
  border-radius: 50%;
  box-shadow: none;
  background: transparent;
}

#item-image .swiper-button:not(.swiper-button-disabled):hover {
  transform: scale(1.1);
  color: var(--item-primary);
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#item-image .swiper-pg {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#item-image .swiper-thumbs {
  margin-top: 12px;
}

#item-image .swiper-thumbs ul {
  margin: 0 -6px 0 0;
  gap: 8px;
}

#item-image .swiper-thumbs li {
  border-radius: var(--item-radius-sm);
  overflow: hidden;
  transition: all var(--item-transition);
  border: 2px solid transparent;
}

#item-image .swiper-thumbs li img {
  border-radius: var(--item-radius-sm);
}

#item-image .swiper-thumbs li.active,
#item-image .swiper-thumbs li:hover {
  border-color: var(--item-primary);
  box-shadow: 0 0 0 1px var(--item-primary);
}

#item-image .swiper-thumbs li.active img,
#item-image .swiper-thumbs li:hover img {
  box-shadow: none;
  border-color: transparent;
}

/* Floating labels on image */
#item-image .premium,
#item-image .expired,
#item-image .sold,
#item-image .reserved {
  position: absolute;
  top: 16px;
  z-index: 2;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(6px);
}

#item-image .premium { left: 16px; background: linear-gradient(135deg, #f5d547 0%, #e4c319 100%); color: #1a1a1a; }
#item-image .expired { left: 16px; background: rgba(80, 80, 80, 0.9); color: #fff; }
#item-image .sold { left: 16px; background: linear-gradient(135deg, #dc3545 0%, #c82333 100%); color: #fff; }
#item-image .reserved { left: 16px; background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%); color: #fff; }

/* Mobile image actions */
#item-main .mlink {
  border-radius: var(--item-radius-sm);
  width: 40px;
  height: 40px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  transition: all var(--item-transition);
}

#item-main .mlink:focus,
#item-main .mlink:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.05);
}

/* ========== Basic Info (Title, Price, Meta) ========== */
#item-main .basic {
  margin: 0 0 24px 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--item-border);
}

#item-main .basic h1 {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  line-height: 1.35;
  font-weight: 700;
  color: var(--item-text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

#item-main .basic .price {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
  color: var(--item-primary);
  letter-spacing: -0.02em;
  margin: 12px 0 8px 0;
}

#item-main .basic .price.isstring {
  color: var(--item-text);
  font-weight: 600;
}

#item-main .details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 14px;
  color: var(--item-text-muted);
}

#item-main .details span:after {
  content: "•";
  margin-left: 8px;
  color: var(--item-border-strong);
}

#item-main .details span:last-child:after {
  display: none;
}

#item-main .basic .date {
  font-size: 13px;
  color: var(--item-text-light);
  margin-top: 4px;
}

#item-main .basic .favorite {
  transition: transform var(--item-transition);
}

#item-main .basic .favorite:hover {
  transform: scale(1.1);
}

/* ========== Attributes / Custom Fields ========== */
#item-main .props.style {
  padding-top: 24px;
  margin-bottom: 16px;
  border-top: 1px solid var(--item-border);
}

#item-main .props h2,
#item-main .description h2,
#item-main .location h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--item-text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#item-main .location h2 i {
  color: var(--item-primary);
}

.custom-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 20px;
}

.custom-fields .field {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  background: var(--item-surface-2);
  border-radius: var(--item-radius-sm);
  border: 1px solid var(--item-border);
  margin: 0;
  width: 100%;
  min-width: 0;
}

.custom-fields .field .name {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--item-text-light);
  margin-bottom: 4px;
}

.custom-fields .field .value {
  font-size: 15px;
  font-weight: 600;
  color: var(--item-text);
}

#item-hook table tr,
#item-hook .custom-fields .field {
  padding: 12px 14px;
  background: var(--item-surface-2);
  border-radius: var(--item-radius-sm);
  border: 1px solid var(--item-border);
}

/* ========== Description Block ========== */
#item-main .description {
  padding-top: 24px;
  margin-bottom: 28px;
  border-top: 1px solid var(--item-border);
}

#item-main .description .desc-parts {
  gap: 24px;
}

#item-main .description .text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--item-text);
}

#item-main .description .read-more-desc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--item-surface-2);
  border-radius: var(--item-radius-sm);
  font-weight: 600;
  color: var(--item-primary);
  border: 1px solid var(--item-border);
  transition: all var(--item-transition);
  margin-top: 12px;
}

#item-main .description .read-more-desc:hover {
  background: var(--item-primary-soft);
  border-color: var(--item-primary);
  text-decoration: none;
}

/* Location strip */
#item-main .location {
  padding: 16px 20px;
  margin-left: 20px;
  border-radius: var(--item-radius-sm);
  border-width: 0 0 0 4px;
  border-color: var(--item-primary);
  background: var(--item-surface-2);
  box-shadow: none;
  min-width: 180px;
}

#item-main .location .address {
  font-size: 14px;
  line-height: 1.5;
}

#item-main .location .directions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--item-surface);
  border: 1px solid var(--item-border);
  border-radius: var(--item-radius-sm);
  font-weight: 600;
  color: var(--item-primary);
  transition: all var(--item-transition);
}

#item-main .location .directions:hover {
  background: var(--item-primary-soft);
  text-decoration: none;
  border-color: var(--item-primary);
}

/* ========== Shortcuts (Print, Share) ========== */
#shortcuts {
  margin-top: 28px;
  padding: 20px 0;
  border-top: 1px solid var(--item-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

#shortcuts > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 24px;
  background: var(--item-surface-2);
  border: 1px solid var(--item-border);
  color: var(--item-text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--item-transition);
  margin: 0;
}

#shortcuts > a:hover {
  background: var(--item-surface);
  color: var(--item-primary);
  border-color: var(--item-primary);
  text-decoration: none;
  box-shadow: var(--item-shadow);
}

#shortcuts .item-share {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

#shortcuts .item-share a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--item-surface-2);
  border: 1px solid var(--item-border);
  color: var(--item-text-muted);
  transition: all var(--item-transition);
  margin: 0;
}

#shortcuts .item-share a:hover {
  transform: translateY(-2px);
  color: #fff;
  border-color: transparent;
  text-decoration: none;
}

#shortcuts .item-share a.whatsapp:hover { background: #25D366; }
#shortcuts .item-share a.facebook:hover { background: #1877F2; }
#shortcuts .item-share a.twitter:hover { background: #1DA1F2; }
#shortcuts .item-share a.pinterest:hover { background: #E60023; }

/* ========== Sidebar ========== */
#item-side {
  top: 88px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#item-side > .box {
  background: var(--item-surface);
  border-radius: var(--item-radius);
  border: 1px solid var(--item-border);
  padding: 20px;
  margin: 0;
  box-shadow: var(--item-shadow);
  transition: box-shadow var(--item-transition);
}

#item-side > .box:hover {
  box-shadow: var(--item-shadow-hover);
}

/* Contact buttons */
#item-side .master-button {
  padding: 14px 16px;
  border-radius: var(--item-radius-sm);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 10px 0;
  box-shadow: 0 2px 8px rgba(59, 73, 223, 0.25);
  transition: all var(--item-transition);
  border: none;
}

#item-side .master-button i {
  width: 44px;
  border-radius: var(--item-radius-sm) 0 0 var(--item-radius-sm);
  line-height: 46px;
}

#item-side .master-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(59, 73, 223, 0.35);
  text-decoration: none;
}

#item-side .master-button.contact:not(:first-child) {
  padding: 13px 16px;
  border-radius: var(--item-radius-sm);
}

/* Seller card */
#seller .line1 {
  padding: 18px;
  border-radius: var(--item-radius);
  background: linear-gradient(145deg, #f8f9fc 0%, #eef1f6 100%);
  border: 1px solid var(--item-border);
  box-shadow: none;
  margin: 0 0 14px 0;
}

#seller .line1 .img {
  width: 64px;
  height: 64px;
  min-width: 64px;
  max-width: 64px;
  max-height: 64px;
  margin-right: 14px;
}

#seller .line1 .img img {
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

#seller .line1 .data .name {
  font-size: 1.05rem;
  font-weight: 700;
}

#seller .line2,
#seller .line3 {
  font-size: 13px;
  color: var(--item-text-muted);
}

#item-side .seller-button,
#item-side .manage-button {
  padding: 12px 16px;
  border-radius: var(--item-radius-sm);
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 10px 0;
  transition: all var(--item-transition);
  border: 1px solid var(--item-border);
  background: var(--item-surface);
}

#item-side .seller-button:hover,
#item-side .manage-button:hover {
  border-color: var(--item-primary);
  color: var(--item-primary);
  background: var(--item-primary-soft);
  text-decoration: none;
}

#item-side .manage-button.edit:hover {
  background: var(--item-primary);
  color: #fff;
  border-color: var(--item-primary);
}

#item-side .manage-button.delete {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

#item-side .manage-button.delete:hover {
  background: #c82333;
  border-color: #c82333;
  color: #fff;
}

#item-side .report-button {
  padding: 12px 16px;
  border-radius: var(--item-radius-sm);
  font-size: 14px;
  color: var(--item-text-muted);
  border: 1px dashed var(--item-border-strong);
  background: transparent;
  margin: 0;
  transition: all var(--item-transition);
}

#item-side .report-button:hover {
  border-style: solid;
  border-color: var(--item-text-muted);
  color: var(--item-text);
  background: var(--item-surface-2);
  text-decoration: none;
}

/* Protection box */
#item-side #protection {
  background: linear-gradient(180deg, #fffbf5 0%, #fff8eb 100%);
  border: 1px solid rgba(253, 126, 20, 0.2);
  border-radius: var(--item-radius);
  padding: 18px;
  margin: 0 0 12px 0;
}

#item-side #protection h2 {
  font-size: 1rem;
  margin: 0 0 14px 0;
  color: #b85c00;
  display: flex;
  align-items: center;
  gap: 8px;
}

#item-side #protection .point {
  margin: 0 0 12px 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(253, 126, 20, 0.1);
  align-items: flex-start;
}

#item-side #protection .point:last-child {
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
}

#item-side #protection .point .icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--item-radius-sm);
  background: rgba(253, 126, 20, 0.15);
  color: #e8590c;
  box-shadow: none;
  margin: 0 12px 0 0;
  padding: 0;
  line-height: 40px;
  text-align: center;
  font-size: 18px;
}

#item-side #protection .point .icon:after {
  display: none;
}

#item-side #protection .point span {
  font-size: 13px;
  line-height: 1.5;
  color: #5c4a32;
}

/* ========== Comments ========== */
#comments .box,
#comments {
  border-radius: var(--item-radius);
  overflow: hidden;
}

#comments .comment {
  padding: 20px 0;
  border-top: 1px solid var(--item-border);
  transition: background var(--item-transition);
}

#comments .comment:first-of-type {
  border-top: none;
}

#comments .comment:hover {
  background: var(--item-surface-2);
}

#comments .author {
  padding: 8px 12px;
  border-radius: 24px;
  background: var(--item-surface-2);
  border: 1px solid var(--item-border);
  margin: 0 0 12px 0;
}

#comments .author:hover {
  border-color: var(--item-primary);
  box-shadow: 0 0 0 2px var(--item-primary-soft);
}

#comments .author .img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

#comments .add {
  padding: 12px 20px;
  border-radius: var(--item-radius-sm);
  font-weight: 600;
  margin-top: 8px;
  transition: all var(--item-transition);
}

#comments .add:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 73, 223, 0.3);
}

#comments .empty-comments {
  padding: 24px;
  text-align: center;
  color: var(--item-text-muted);
  background: var(--item-surface-2);
  border-radius: var(--item-radius-sm);
  margin: 12px 0 20px 0;
}

/* ========== Sticky Mobile Buttons ========== */
#item .sticky-button {
  border-radius: 24px;
  padding: 12px 16px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform var(--item-transition), box-shadow var(--item-transition);
}

#item .sticky-button:active {
  transform: scale(0.98);
}

#item .sticky-button.contact {
  border: 2px solid var(--item-border-strong);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ========== Main width adjustment ========== */
#item-main {
  width: calc(100% - 336px);
  min-width: 0;
}

/* ========== RTL ========== */
[dir="rtl"] #item-main .location {
  margin-left: 0;
  margin-right: 20px;
  border-width: 0 4px 0 0;
}

[dir="rtl"] #item-side .master-button i {
  left: auto;
  right: 0;
  border-radius: 0 var(--item-radius-sm) var(--item-radius-sm) 0;
  border-right: none;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* ========== Responsive ========== */
@media screen and (max-width: 1024px) {
  #item-main {
    width: 100%;
  }
  #item-side {
    width: 100%;
    position: relative;
    top: auto;
  }
  body#item .data-box {
    padding: 16px;
  }
}

@media screen and (max-width: 768px) {
  #shortcuts {
    flex-direction: column;
    align-items: flex-start;
  }
  #shortcuts .item-share {
    margin-left: 0;
    margin-top: 8px;
  }
  #item-image .premium,
  #item-image .expired,
  #item-image .sold,
  #item-image .reserved {
    top: 12px;
    padding: 6px 12px;
    font-size: 12px;
  }
}

@media screen and (max-width: 480px) {
  body#item .data-box {
    padding: 12px;
    border-radius: var(--item-radius);
  }
  #item-main .basic h1 {
    padding-right: 40px;
  }
  .custom-fields {
    grid-template-columns: 1fr;
  }
}
