* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(45deg, #ff8a8a, #ff5e62, #ff978a);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M50,30 L60,50 L50,70 L40,50 Z" fill="rgba(255,255,255,0.1)"/></svg>');
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.4;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.container {
  display: flex;
  width: 100%;
  max-width: 1200px;
  gap: 30px;
  position: relative;
}

.camera-section {
  flex: 1;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 320px;
}

.camera-container {
  width: 100%;
  position: relative;
  background-color: #000;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border: 8px solid #333;
}

.camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  pointer-events: none;
  background-image: radial-gradient(
    circle at center,
    transparent 90%,
    rgba(0, 0, 0, 0.6) 100%
  );
  z-index: 2;
}

.camera-lens {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  background: #222;
  border-radius: 50%;
  z-index: 3;
  border: 5px solid #333;
}

.camera-lens::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: #111;
  border-radius: 50%;
  border: 3px solid #444;
}

.camera-lens::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: rgba(0, 180, 255, 0.7);
  border-radius: 50%;
}

.flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
}

#cameraVideo {
  width: 100%;
  height: auto;
  transform: scaleX(-1);
  display: none;
  border-radius: 8px;
}

#countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 100px;
  color: white;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 5;
  display: none;
}

.camera-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background-color: #222;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #777;
  font-size: 16px;
  border-radius: 8px;
}

.camera-controls {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin-top: 20px;
}

.btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-camera {
  background: #ff5e62;
  color: white;
}

.btn-download {
  background: #5e62ff;
  color: white;
}

.gallery-section {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-content: flex-start;
  max-height: 600px;
  overflow-y: auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.gallery-section::-webkit-scrollbar {
  width: 6px;
}

.gallery-section::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.gallery-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

.photo-container {
  position: relative;
  width: calc(50% - 8px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transform: scale(1);
  transition: all 0.3s ease;
  background-color: #fff;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.photo-container img {
  width: 100%;
  display: block;
  transition: all 0.3s ease;
}

.photo-container:hover {
  transform: translateY(-5px) scale(1.05);
  z-index: 5;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.gallery-section.hover-effect .photo-container:not(:hover) {
  filter: brightness(0.6);
}

.gallery-empty {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  font-style: italic;
}

.gallery-mobile-btn {
  display: none;
  margin-top: 20px;
}

.gallery-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-popup.active {
  opacity: 1;
  display: flex;
}

.gallery-popup-content {
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  position: relative;
}

.close-popup {
  position: absolute;
  top: 15px;
  right: 15px;
  color: white;
  background: rgba(255, 0, 0, 0.5);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  cursor: pointer;
  border: none;
}

.popup-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
}

.popup-photos .photo-container {
  width: calc(33.33% - 10px);
}

.popup-title {
  color: white;
  margin-bottom: 20px;
  text-align: center;
}

.popup-footer {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .gallery-section {
    display: none;
  }

  .gallery-mobile-btn {
    display: block;
  }

  .popup-photos .photo-container {
    width: calc(50% - 8px);
  }
}

@media (max-width: 480px) {
  .camera-controls {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 200px;
  }

  .popup-photos .photo-container {
    width: 100%;
  }
}

/* Heart elements for decoration */
.heart {
  position: absolute;
  background-color: rgba(255, 100, 100, 0.3);
  display: inline-block;
  height: 30px;
  position: relative;
  transform: rotate(-45deg);
  width: 30px;
  z-index: -1;
}

.heart:before,
.heart:after {
  content: "";
  background-color: rgba(255, 100, 100, 0.3);
  border-radius: 50%;
  height: 30px;
  position: absolute;
  width: 30px;
}

.heart:before {
  top: -15px;
  left: 0;
}

.heart:after {
  left: 15px;
  top: 0;
}

.hearts-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

/* Title styling */
.app-title {
  color: white;
  text-align: center;
  font-size: 36px;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: bold;
  letter-spacing: 2px;
}

.app-title span {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  border-radius: 50px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

// css popup
.popup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.popup-content {
  background: #fff;
  border: 8px solid #ff69b4;
  padding: 20px;
  text-align: center;
  position: relative;
  border-radius: 20px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  font-family: "Poppins", sans-serif;
  max-width: 350px;
  position: relative;
  background-image: url("https://www.transparenttextures.com/patterns/flowers.png"); /* Motif bunga */
}

.popup-gif {
  width: 80px;
  height: auto;
  margin-bottom: 15px;
}

.popup-btn {
  background: #ff69b4;
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 16px;
  border-radius: 10px;
  margin-top: 10px;
  transition: 0.3s;
}

.popup-btn:hover {
  background: #ff1493;
}
/* Efek redup pada latar belakang */
body.popup-active {
  overflow: hidden;
}

.popup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Latar belakang sedikit gelap */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px); /* Efek blur */
}

/* Bingkai pop-up */
.popup-content {
  background: #fff;
  border: 8px solid #ff69b4;
  padding: 20px;
  text-align: center;
  border-radius: 20px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  font-family: "Poppins", sans-serif;
  max-width: 350px;
  width: 80%;
  background-image: url("https://www.transparenttextures.com/patterns/flowers.png"); /* Motif bunga */
  position: relative;
  animation: popUp 0.5s ease-out;
}

/* Animasi pop-up muncul */
@keyframes popUp {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* GIF di atas teks */
.popup-gif {
  width: 100px;
  height: auto;
  margin-bottom: 15px;
}

/* Tombol "Okay" */
.popup-btn {
  background: #ff69b4;
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 16px;
  border-radius: 10px;
  margin-top: 10px;
  transition: 0.3s;
}

.popup-btn:hover {
  background: #ff1493;
}

/* Responsif untuk HP */
@media (max-width: 480px) {
  .popup-content {
    width: 90%;
    padding: 15px;
  }
  .popup-gif {
    width: 80px;
  }
  .popup-btn {
    font-size: 14px;
    padding: 8px 16px;
  }
}
