/**
 * Shape Divider Styles
 * 
 * استایل‌های بخش تزئینی Shape Divider
 * 
 * @package MainBannerSlider
 * @since 2.1.0
 */

/* ==========================================================================
   Wrapper for Slider with Shape
   ========================================================================== */

.mbs-slider-with-shape {
  position: relative;
  z-index: 1;
}

.mbs-slider-with-shape > .mbs-slider-wrapper {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   Shape Divider Base
   ========================================================================== */

.mbs-shape-divider {
  position: relative;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 5;
  pointer-events: none;
}

.mbs-shape-divider svg {
  display: block;
  width: calc(100% + 2px);
  height: 100%;
  position: relative;
  left: -1px;
}

/* ==========================================================================
   Position Classes
   ========================================================================== */

.mbs-shape--bottom {
  margin-top: -1px;
}

.mbs-shape--top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

/* Shape Outside - Below Slider */
.mbs-shape--outside {
  position: relative !important;
  margin-top: -1px;
  z-index: 3;
}

/* ==========================================================================
   Flip Classes
   ========================================================================== */

.mbs-shape--flipped {
  transform: scaleX(-1);
}

.mbs-shape--top:not(.mbs-shape--flipped) {
  transform: scaleY(-1);
}

.mbs-shape--top.mbs-shape--flipped {
  transform: scaleX(-1) scaleY(-1);
}

/* ==========================================================================
   Scroll Down Button
   ========================================================================== */

.mbs-scroll-down-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  color: var(--mbs-primary, #1c5da9);
  font-family: inherit;
}

.mbs-scroll-down-btn:hover {
  background: #fff;
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.mbs-scroll-down-btn:focus {
  outline: 2px solid var(--mbs-primary, #1c5da9);
  outline-offset: 2px;
}

.mbs-scroll-down-btn:active {
  transform: translate(-50%, -50%) scale(0.98);
}

.mbs-scroll-down-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--mbs-primary, #1c5da9);
  border-radius: 50%;
  color: #fff;
  animation: mbs-bounce 2s infinite;
}

.mbs-scroll-down-icon svg {
  width: 24px;
  height: 24px;
}

.mbs-scroll-down-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--mbs-primary, #1c5da9);
  white-space: nowrap;
}

/* Bounce Animation */
@keyframes mbs-bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

/* Responsive */
@media (max-width: 767px) {
  .mbs-scroll-down-btn {
    padding: 8px 14px;
  }

  .mbs-scroll-down-icon {
    width: 32px;
    height: 32px;
  }

  .mbs-scroll-down-icon svg {
    width: 18px;
    height: 18px;
  }

  .mbs-scroll-down-label {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .mbs-scroll-down-label {
    display: none;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .mbs-scroll-down-icon {
    animation: none;
  }
}
/* ==========================================================================
   Shape Colors - Utility Classes
   ========================================================================== */

.mbs-shape-divider--white svg path,
.mbs-shape-divider--white svg polygon {
  fill: #ffffff;
}

.mbs-shape-divider--light svg path,
.mbs-shape-divider--light svg polygon {
  fill: #f8f9fa;
}

.mbs-shape-divider--gray svg path,
.mbs-shape-divider--gray svg polygon {
  fill: #e9ecef;
}

.mbs-shape-divider--dark svg path,
.mbs-shape-divider--dark svg polygon {
  fill: #343a40;
}

.mbs-shape-divider--primary svg path,
.mbs-shape-divider--primary svg polygon {
  fill: var(--mbs-primary, #1c5da9);
}

/* ==========================================================================
   Shape Previews (Admin Panel)
   ========================================================================== */

.mbs-shape-types {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.mbs-shape-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
  border: 2px solid #dcdcde;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  min-width: 85px;
}

.mbs-shape-option:hover {
  border-color: #2271b1;
  background: #f0f6fc;
}

.mbs-shape-option.active {
  border-color: #2271b1;
  background: #f0f6fc;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.mbs-shape-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mbs-shape-preview {
  width: 70px;
  height: 35px;
  background: linear-gradient(180deg, #e8eff6 0%, #ddd 100%);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.mbs-shape-preview::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2271b1;
  height: 15px;
}

.mbs-shape-label {
  font-size: 14px;
  color: #50575e;
  font-weight: 500;
  text-align: center;
}

.mbs-shape-option.active .mbs-shape-label {
  color: #2271b1;
  font-weight: 600;
}

/* ==========================================================================
   Shape Preview Types (Admin)
   ========================================================================== */

/* Wave */
.mbs-shape-wave .mbs-shape-preview::after {
  clip-path: path("M0,15 C10,5 20,15 35,10 C50,5 60,15 70,10 L70,15 Z");
}

/* Triangle */
.mbs-shape-triangle .mbs-shape-preview::after {
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

/* Curve */
.mbs-shape-curve .mbs-shape-preview::after {
  clip-path: ellipse(60% 100% at 50% 100%);
}

/* Tilt */
.mbs-shape-tilt .mbs-shape-preview::after {
  clip-path: polygon(0 30%, 100% 100%, 0% 100%);
}

/* Zigzag */
.mbs-shape-zigzag .mbs-shape-preview::after {
  clip-path: polygon(
    0% 100%,
    10% 60%,
    20% 100%,
    30% 60%,
    40% 100%,
    50% 60%,
    60% 100%,
    70% 60%,
    80% 100%,
    90% 60%,
    100% 100%
  );
}

/* Arrow */
.mbs-shape-arrow .mbs-shape-preview::after {
  clip-path: polygon(50% 0%, 100% 100%, 50% 70%, 0% 100%);
}

/* Clouds */
.mbs-shape-clouds .mbs-shape-preview::after {
  clip-path: path("M0,15 Q10,5 20,12 T40,8 T60,12 T70,10 L70,15 Z");
}

/* ==========================================================================
   Admin Live Preview
   ========================================================================== */

.mbs-shape-live-preview {
  margin-top: 20px;
  padding: 40px 20px 20px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  position: relative;
  min-height: 150px;
}

.mbs-shape-live-preview .mbs-shape-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.mbs-shape-live-preview-label {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 14px;
}

[dir="rtl"] .mbs-shape-live-preview-label {
  right: auto;
  left: 10px;
}

/* ==========================================================================
   Responsive - Tablet
   ========================================================================== */

@media (max-width: 1023px) {
  .mbs-scroll-down-btn {
    padding: 10px 16px;
  }

  .mbs-scroll-down-icon {
    width: 36px;
    height: 36px;
  }

  .mbs-scroll-down-icon svg {
    width: 20px;
    height: 20px;
  }

  .mbs-scroll-down-label {
    font-size: 14px;
  }

  .mbs-shape-types {
    gap: 10px;
  }

  .mbs-shape-option {
    padding: 10px 12px;
    min-width: 75px;
  }

  .mbs-shape-preview {
    width: 60px;
    height: 30px;
  }

  .mbs-shape-label {
    font-size: 14px;
  }
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */

@media (max-width: 767px) {
  .mbs-scroll-down-btn {
    padding: 8px 14px;
    border-radius: 25px;
  }

  .mbs-scroll-down-icon {
    width: 32px;
    height: 32px;
  }

  .mbs-scroll-down-icon svg {
    width: 18px;
    height: 18px;
  }

  .mbs-scroll-down-label {
    font-size: 10px;
  }

  .mbs-shape-types {
    gap: 8px;
    justify-content: flex-start;
  }

  .mbs-shape-option {
    padding: 8px 10px;
    min-width: 70px;
    flex: 0 0 calc(33.333% - 8px);
  }

  .mbs-shape-preview {
    width: 55px;
    height: 28px;
  }

  .mbs-shape-label {
    font-size: 10px;
  }
}

/* ==========================================================================
   Responsive - Small Mobile
   ========================================================================== */

@media (max-width: 480px) {
  .mbs-scroll-down-btn {
    padding: 6px 12px;
  }

  .mbs-scroll-down-icon {
    width: 28px;
    height: 28px;
  }

  .mbs-scroll-down-icon svg {
    width: 16px;
    height: 16px;
  }

  .mbs-scroll-down-label {
    display: none;
  }

  .mbs-shape-types {
    justify-content: center;
  }

  .mbs-shape-option {
    flex: 0 0 calc(50% - 8px);
    max-width: 120px;
  }

  .mbs-shape-preview {
    width: 50px;
    height: 25px;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .mbs-shape-divider {
    display: none !important;
  }

  .mbs-scroll-down-btn {
    display: none !important;
  }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .mbs-scroll-down-icon {
    animation: none;
  }

  .mbs-scroll-down-btn {
    transition: none;
  }

  .mbs-shape-option {
    transition: none;
  }
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

[dir="rtl"] .mbs-shape--flipped {
  transform: scaleX(1);
}

[dir="rtl"] .mbs-shape--top.mbs-shape--flipped {
  transform: scaleY(-1);
}

[dir="rtl"] .mbs-shape-types {
  direction: rtl;
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
  .mbs-scroll-down-btn {
    border: 2px solid currentColor;
  }

  .mbs-shape-option {
    border-width: 3px;
  }

  .mbs-shape-option.active {
    outline: 3px solid #000;
    outline-offset: 2px;
  }

  .mbs-shape-divider svg path,
  .mbs-shape-divider svg polygon {
    stroke: #000;
    stroke-width: 1px;
  }
}

/* ==========================================================================
   Dynamic Shape Color Transition
   ========================================================================== */
.mbs-shape-path {
  transition: fill 0.5s ease;
}
