/* ============================================
   BOCHI CILACAP - POPUP ANNOUNCEMENT SLIDER
   File: popup-announcement.css
   FIXED: Dots position + Smooth slide transition
   ============================================ */

/* Popup Overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  .popup-dot {
    width: 6px;
    height: 6px;
  }

  .popup-dot.active {
    width: 20px;
  }
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Popup Container */
.popup-container {
  background: #ffffff;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transform: scale(0.8) translateY(30px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow: hidden;
  animation: slideUp 0.6s ease forwards 0.1s;
  padding-bottom: 45px;
}

@keyframes slideUp {
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.popup-overlay.active .popup-container {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ======================================
   SLIDER CONTAINER & SLIDES (FIXED!)
   ====================================== */
.popup-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  min-height: 400px;
}

.popup-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.popup-slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

/* Slide transition animations - SMOOTH */
.popup-slide.slide-out-left {
  animation: slideOutLeft 0.4s ease forwards;
}

.popup-slide.slide-out-right {
  animation: slideOutRight 0.4s ease forwards;
}

.popup-slide.slide-in-left {
  animation: slideInLeft 0.4s ease forwards;
}

.popup-slide.slide-in-right {
  animation: slideInRight 0.4s ease forwards;
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30%);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(30%);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ======================================
   DOTS INDICATOR (DI DALAM CONTAINER!)
   ====================================== */
.popup-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.popup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}

.popup-dot:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: scale(1.2);
}

.popup-dot.active {
  background: #ffffff;
  width: 24px;
  border-radius: 4px;
}

/* ======================================
   CLOSE BUTTON
   ====================================== */
.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.popup-close:hover {
  background: #e74c3c;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.popup-close i {
  font-size: 20px;
  color: #60606e;
  transition: color 0.3s ease;
}

.popup-close:hover i {
  color: #ffffff;
}

/* ======================================
   POPUP HEADER
   ====================================== */
.popup-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px 15px 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.popup-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.03) 10px,
    rgba(255, 255, 255, 0.03) 20px
  );
  opacity: 0.5;
  animation: fadePattern 3s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes fadePattern {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.6;
  }
}

.popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 16px;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
  animation: pulse 2s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.popup-badge i {
  font-size: 16px;
  color: #ffffff;
}

.popup-badge span {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: #ffffff;
  letter-spacing: 1px;
}

.popup-title {
  font-size: 22px;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

/* ======================================
   POPUP IMAGE
   ====================================== */
.popup-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
  display: none;
}

.popup-image:not(:empty) {
  display: block;
}

.popup-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.popup-container:hover .popup-image img {
  transform: scale(1.05);
}

.popup-image:not(:empty)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, #ffffff, transparent);
  pointer-events: none;
}

/* ======================================
   POPUP CONTENT
   ====================================== */
.popup-content {
  padding: 20px 18px;
}

.popup-description {
  font-size: 13px;
  line-height: 20px;
  color: #60606e;
  margin-bottom: 15px;
  text-align: center;
}

.popup-details {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 10px;
  transition: all 0.3s ease;
  border-left: 3px solid #97c1c0;
}

.detail-item:hover {
  background: #f0f2f5;
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.detail-item i {
  font-size: 22px;
  color: #97c1c0;
  min-width: 22px;
}

.detail-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-text strong {
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #60606e;
  text-transform: uppercase;
}

.detail-text span {
  font-size: 13px;
  color: #999999;
}

/* ======================================
   CTA BUTTONS
   ====================================== */
.popup-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 0;
}

.popup-actions .btn {
  flex: 1;
  margin: 0;
  height: 42px;
  line-height: 42px;
  min-width: 0;
  font-size: 12px;
}

.popup-cta-single {
  width: 100%;
  display: block;
  text-align: center;
}

/* ======================================
   POPUP FOOTER
   ====================================== */
.popup-footer {
  background: #f8f9fa;
  padding: 10px 15px;
  border-top: 1px solid #e9ecef;
}

.popup-footer-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: #999999;
  margin: 0;
  line-height: 1.4;
  text-align: center;
}

.popup-footer-text i {
  font-size: 14px;
  color: #97c1c0;
  flex-shrink: 0;
}

/* ========================================
   RESPONSIVE - TABLET (768px and below)
   ======================================== */
@media (max-width: 768px) {
  .popup-overlay {
    padding: 12px;
  }

  .popup-container {
    max-width: 90%;
    border-radius: 14px;
    padding-bottom: 45px;
  }

  .popup-slider {
    min-height: 380px;
  }

  .popup-header {
    padding: 18px 12px 16px;
  }

  .popup-title {
    font-size: 20px;
  }

  .popup-badge span {
    font-size: 10px;
  }

  .popup-image {
    height: 160px;
  }

  .popup-content {
    padding: 18px 15px;
  }

  .popup-description {
    font-size: 12px;
    line-height: 19px;
    margin-bottom: 12px;
  }

  .detail-item {
    padding: 9px 10px;
    gap: 10px;
  }

  .detail-item i {
    font-size: 20px;
  }

  .detail-text strong {
    font-size: 10px;
  }

  .detail-text span {
    font-size: 12px;
  }

  .popup-actions .btn {
    height: 40px;
    line-height: 40px;
    font-size: 11px;
  }

  .popup-footer {
    padding: 8px 12px;
  }

  .popup-footer-text {
    font-size: 10px;
  }

  .popup-footer-text i {
    font-size: 13px;
  }

  .popup-dots {
    bottom: 18px;
  }
}

/* ========================================
   RESPONSIVE - MOBILE (480px and below)
   ======================================== */
@media (max-width: 480px) {
  .popup-overlay {
    padding: 10px;
    align-items: center;
  }

  .popup-container {
    max-width: 100%;
    border-radius: 12px;
    max-height: 95vh;
    padding-bottom: 40px;
  }

  .popup-slider {
    min-height: 360px;
  }

  .popup-close {
    width: 32px;
    height: 32px;
    top: 10px;
    right: 10px;
  }

  .popup-close i {
    font-size: 18px;
  }

  .popup-header {
    padding: 15px 12px 12px;
  }

  .popup-badge {
    padding: 5px 10px;
    margin-bottom: 8px;
    gap: 5px;
  }

  .popup-badge i {
    font-size: 14px;
  }

  .popup-badge span {
    font-size: 9px;
  }

  .popup-title {
    font-size: 18px;
  }

  .popup-image {
    height: 140px;
  }

  .popup-content {
    padding: 15px 12px;
  }

  .popup-description {
    font-size: 11px;
    line-height: 17px;
    margin-bottom: 10px;
  }

  .popup-details {
    gap: 8px;
    margin-bottom: 12px;
  }

  .detail-item {
    padding: 8px 10px;
    gap: 10px;
  }

  .detail-item i {
    font-size: 18px;
  }

  .detail-text strong {
    font-size: 9px;
  }

  .detail-text span {
    font-size: 11px;
  }

  .popup-actions {
    gap: 8px;
  }

  .popup-actions .btn {
    height: 38px;
    line-height: 38px;
    font-size: 11px;
  }

  .popup-footer {
    padding: 8px 10px;
  }

  .popup-footer-text {
    font-size: 9px;
    gap: 6px;
  }

  .popup-footer-text i {
    font-size: 12px;
  }

  .popup-dots {
    bottom: 10px;
    gap: 6px;
    padding: 6px 10px;
  }
}

/* Extra small mobile */
@media (max-width: 360px) {
  .popup-container {
    padding-bottom: 38px;
  }

  .popup-slider {
    min-height: 340px;
  }

  .popup-title {
    font-size: 16px;
  }

  .popup-image {
    height: 120px;
  }

  .popup-content {
    padding: 12px 10px;
  }

  .popup-description {
    font-size: 10px;
    line-height: 16px;
  }

  .detail-item {
    padding: 7px 8px;
  }

  .detail-item i {
    font-size: 16px;
  }

  .detail-text strong {
    font-size: 8px;
  }

  .detail-text span {
    font-size: 10px;
  }

  .popup-actions .btn {
    height: 36px;
    line-height: 36px;
    font-size: 10px;
  }

  .popup-footer {
    padding: 8px 10px;
  }

  .popup-dots {
    bottom: 12px;
  }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
body.dark-mode .popup-overlay {
  background: rgba(0, 0, 0, 0.92);
}

body.dark-mode .popup-container {
  background: #2a2a2a;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

body.dark-mode .popup-close {
  background: rgba(42, 42, 42, 0.95);
}

body.dark-mode .popup-close:hover {
  background: #e74c3c;
}

body.dark-mode .popup-close i {
  color: #e0e0e0;
}

body.dark-mode .popup-close:hover i {
  color: #ffffff;
}

body.dark-mode .popup-dots {
  background: rgba(0, 0, 0, 0.6);
}

body.dark-mode .popup-dot {
  background: rgba(255, 255, 255, 0.3);
}

body.dark-mode .popup-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

body.dark-mode .popup-dot.active {
  background: #8bc34a;
}

body.dark-mode .popup-description {
  color: #b0b0b0;
}

body.dark-mode .detail-item {
  background: #333333;
  border-left-color: #8bc34a;
}

body.dark-mode .detail-item:hover {
  background: #3a3a3a;
}

body.dark-mode .detail-item i {
  color: #8bc34a;
}

body.dark-mode .detail-text strong {
  color: #e0e0e0;
}

body.dark-mode .detail-text span {
  color: #b0b0b0;
}

body.dark-mode .popup-footer {
  background: #333333;
  border-top-color: #444444;
}

body.dark-mode .popup-footer-text {
  color: #b0b0b0;
}

body.dark-mode .popup-footer-text i {
  color: #8bc34a;
}

body.dark-mode .popup-image {
  background: #1a1a1a;
}

body.dark-mode .popup-image:not(:empty)::after {
  background: linear-gradient(to top, #2a2a2a, transparent);
}

body.dark-mode .btn.white {
  background: #3a3a3a;
  color: #e0e0e0;
}

body.dark-mode .btn.white:hover {
  background: #4a4a4a;
}

/* ========================================
   ACCESSIBILITY & PERFORMANCE
   ======================================== */
body.popup-open {
  overflow: hidden;
}

.popup-overlay {
  scroll-behavior: smooth;
}

.popup-container,
.popup-image img {
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .popup-container,
  .popup-overlay,
  .popup-badge,
  .detail-item,
  .popup-image img,
  .popup-slide {
    animation: none;
    transition: none;
  }

  .popup-header::before {
    animation: none;
  }
}

@media print {
  .popup-overlay {
    display: none !important;
  }
}

.detail-item .ion-location {
  transform: translateX(4.5px);
}
