/**
 * Djassa Auto — Promotional CMS Styling
 * Premium automotive dark glassmorphism aesthetic
 */

/* General Wrapper */
.promo-panel-wrapper {
  margin: 36px 0;
  position: relative;
  width: 100%;
}

.promo-tag-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.promo-badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(255, 87, 34, 0.15);
  border: 1px solid rgba(255, 87, 34, 0.4);
  color: #FF5722;
}

/* Horizontal Banner Layout */
.promo-horizontal-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  border-radius: 20px;
  background: rgba(21, 27, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.promo-banner-media {
  position: relative;
  width: 140px;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.promo-banner-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo-banner-content {
  flex: 1;
  min-width: 0;
}

.promo-banner-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 4px 0 6px 0;
}

.promo-banner-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.4;
}

.promo-banner-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.promo-detail-link {
  font-size: 0.85rem;
  color: #FF5722;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.promo-detail-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Partner Showcase Layout */
.promo-partner-card {
  padding: 32px;
  border-radius: 24px;
  background: rgba(21, 27, 40, 0.75);
  border: 1px solid rgba(255, 87, 34, 0.2);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

.promo-partner-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.promo-partner-logo {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.promo-partner-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 2px 0;
}

.promo-partner-loc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.promo-partner-headline {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 8px 0;
}

.promo-partner-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
  margin: 0;
}

.promo-partner-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 16px;
}

.promo-partner-contacts {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-wa-direct {
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.4);
  color: #25D366 !important;
}

.btn-wa-direct:hover {
  background: rgba(37, 211, 102, 0.25);
}

/* Compact Card Layout */
.promo-compact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-radius: 16px;
  background: rgba(21, 27, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.promo-compact-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 2px 0 4px 0;
}

.promo-compact-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

/* Bento Styling Refinements */
.pro-bento-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn-wa-pill {
  color: #25D366 !important;
  border-color: rgba(37, 211, 102, 0.3) !important;
}

.btn-wa-pill i {
  color: #25D366;
  margin-right: 6px;
}

/* Detail Page Styles */
.promo-detail-hero {
  position: relative;
  min-height: 420px;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 40px;
  display: flex;
  align-items: flex-end;
  padding: 48px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.promo-detail-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 15, 23, 0.2) 0%, rgba(11, 15, 23, 0.95) 100%);
  pointer-events: none;
}

.promo-detail-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.promo-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 36px;
  margin-bottom: 60px;
  align-items: start;
}

.promo-sidebar-col {
  position: relative;
}

.promo-sticky-sidebar {
  position: sticky;
  top: calc(var(--header-height, 80px) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.promo-partner-box {
  background: rgba(14, 18, 28, 0.85) !important;
  border: 1px solid rgba(255, 77, 0, 0.3) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
  border-radius: 20px !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
}

.promo-partner-logo {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
}

.promo-contact-group {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.promo-contact-group .btn-pill {
  flex: 1 1 120px;
}

.promo-share-box {
  background: rgba(14, 18, 28, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
}

.promo-detail-box {
  padding: 32px;
  border-radius: 20px;
  background: rgba(21, 27, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  margin-bottom: 24px;
}

.promo-detail-box h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 16px;
}

.promo-offer-highlight {
  background: rgba(255, 87, 34, 0.08);
  border-left: 4px solid #FF5722;
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  margin: 20px 0;
  font-size: 1.05rem;
  color: #FFFFFF;
  font-weight: 600;
}

/* Gallery Viewer */
.promo-gallery-viewer {
  margin-top: 24px;
}

.promo-gallery-main {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.promo-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.promo-gallery-counter {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.75);
  color: #FFF;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.promo-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 5;
}

.promo-gallery-nav:hover {
  background: rgba(255, 87, 34, 0.8);
}

.promo-gallery-nav.prev { left: 16px; }
.promo-gallery-nav.next { right: 16px; }

.promo-gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.promo-thumb-item {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s;
}

.promo-thumb-item.active {
  opacity: 1;
  border-color: #FF5722;
}

.promo-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox Modal */
.promo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
}

.promo-lightbox.open {
  display: flex;
}

.promo-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

.promo-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  color: #FFF;
  font-size: 2rem;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 992px) {
  .promo-detail-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }
  .promo-main-col,
  .promo-sidebar-col,
  .promo-sticky-sidebar {
    display: contents !important;
  }
  #offerHighlightBox { order: 1; }
  .promo-partner-box { order: 2; }
  #benefitsBox { order: 3; }
  #galleryBox { order: 4; }
  #conditionsBox { order: 5; }
  .promo-share-box { order: 6; }

  .promo-sticky-sidebar {
    position: static;
  }
  .promo-horizontal-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .promo-banner-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .promo-panel-wrapper {
    margin: 24px 0;
  }
  .promo-horizontal-card {
    padding: 20px;
  }
  .promo-partner-card {
    padding: 20px;
  }
  .promo-detail-hero {
    min-height: 320px;
    padding: 24px;
  }
  .promo-gallery-main {
    height: 280px;
  }
  .pro-bento-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .promo-partner-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 12px;
  }
  .promo-partner-footer > a {
    width: 100%;
    justify-content: center;
  }
  .promo-partner-contacts {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .promo-partner-contacts .btn-pill {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================================
   ADMIN DASHBOARD — PROMOTIONAL CMS & PLACEMENT ENGINE
   ======================================================== */

.cms-promo-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.cms-promo-kpi-card {
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cms-promo-kpi-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #FFF;
  margin: 4px 0 0 0;
  line-height: 1;
}

.cms-promo-kpi-lbl {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #94A3B8);
  margin: 0;
  font-weight: 600;
}

.cms-promo-kpi-icon {
  font-size: 1.6rem;
  color: var(--accent-orange, #FF4D00);
  opacity: 0.85;
}

/* Page Placement Tree */
.cms-tree-wrapper {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 30px;
  backdrop-filter: blur(12px);
}

.cms-tree-page-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cms-tree-page-btn {
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted, #94A3B8);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cms-tree-page-btn:hover {
  background: rgba(255, 77, 0, 0.1);
  border-color: rgba(255, 77, 0, 0.3);
  color: #FFF;
}

.cms-tree-page-btn.active {
  background: var(--accent-orange, #FF4D00);
  border-color: var(--accent-orange, #FF4D00);
  color: #FFF;
  box-shadow: 0 4px 14px rgba(255, 77, 0, 0.35);
}

.cms-tree-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 20px;
}

.cms-tree-timeline::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 6px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.15) 0px, rgba(255,255,255,0.15) 6px, transparent 6px, transparent 12px);
}

.cms-tree-anchor-node {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.cms-tree-anchor-node::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748B;
  border: 2px solid #0F172A;
}

.cms-tree-anchor-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cms-tree-anchor-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  font-size: 0.95rem;
}

.cms-tree-anchor-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #F8FAFC;
  margin: 0;
}

.cms-tree-anchor-key {
  font-size: 0.75rem;
  color: #64748B;
  font-family: monospace;
}

.cms-tree-insert-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6px 0;
}

.cms-tree-insert-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94A3B8;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cms-tree-insert-btn:hover {
  background: rgba(255, 77, 0, 0.15);
  border-color: var(--accent-orange, #FF4D00);
  color: #FFF;
  transform: scale(1.02);
}

.cms-tree-promo-node {
  background: rgba(255, 77, 0, 0.04);
  border: 1px solid rgba(255, 77, 0, 0.3);
  border-left: 4px solid var(--accent-orange, #FF4D00);
  border-radius: 12px;
  padding: 14px 18px;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.2s;
}

.cms-tree-promo-node:hover {
  border-color: var(--accent-orange, #FF4D00);
  box-shadow: 0 6px 20px rgba(255, 77, 0, 0.15);
}

.cms-tree-promo-node::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-orange, #FF4D00);
  border: 2px solid #0F172A;
  box-shadow: 0 0 8px rgba(255, 77, 0, 0.6);
}

.cms-tree-promo-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cms-tree-promo-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 240px;
  flex: 1;
}

.cms-tree-promo-thumb {
  width: 70px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.cms-tree-promo-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cms-tree-promo-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFF;
  margin: 0;
}

.cms-tree-promo-sub {
  font-size: 0.8rem;
  color: var(--text-muted, #94A3B8);
  margin: 0;
}

.cms-tree-promo-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cms-tree-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cms-tag-pos {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60A5FA;
}

.cms-tag-order {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FBBF24;
}

.cms-tag-pub {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.cms-tag-draft {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94A3B8;
}

.cms-tag-partner {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #C084FC;
}

.cms-tag-platform {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E2E8F0;
}

.cms-tree-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cms-tree-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cms-tree-btn-edit {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  color: #FFF;
}
.cms-tree-btn-edit:hover {
  background: rgba(255, 255, 255, 0.15);
}

.cms-tree-btn-move {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93C5FD;
}
.cms-tree-btn-move:hover {
  background: rgba(59, 130, 246, 0.25);
}

.cms-tree-btn-toggle {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6EE7B7;
}
.cms-tree-btn-toggle:hover {
  background: rgba(16, 185, 129, 0.25);
}

.cms-tree-btn-del {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
}
.cms-tree-btn-del:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Modal Tab Bar */
.cms-modal-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.cms-modal-tab-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted, #94A3B8);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cms-modal-tab-btn.active {
  background: rgba(255, 77, 0, 0.15);
  border-color: var(--accent-orange, #FF4D00);
  color: #FFF;
}

.cms-modal-step {
  display: none;
}

.cms-modal-step.active {
  display: block;
}

/* Simulated Device View */
.cms-preview-device-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cms-device-toggle {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cms-device-btn {
  padding: 6px 16px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-muted, #94A3B8);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cms-device-btn.active {
  background: var(--accent-orange, #FF4D00);
  color: #FFF;
}

.cms-preview-viewport {
  width: 100%;
  transition: all 0.3s ease;
  overflow: hidden;
}

.cms-preview-viewport.mobile {
  max-width: 390px;
  border: 8px solid #2D3748;
  border-radius: 36px;
  padding: 16px;
  background: #0B0F19;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.cms-preview-viewport.desktop {
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  background: #0B0F19;
}
