/* Preview QR Code Page Styles */
.preview-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: calc(100vh - 200px);
}

.main-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: bold;
  color: #000;
  margin-bottom: 10px;
}

.expiry-message {
  text-align: center;
  color: #666;
  font-size: 1rem;
  margin-bottom: 40px;
}

.content-wrapper {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.photo-strip-section,
.animated-review-section {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
}

.section-title {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

/* Photo Strip Styles - EXACT same as preview-capture.css */
.photo-strip {
    background: linear-gradient(135deg, var(--frame-color, #A2D2FF), var(--frame-color, #A2D2FF));
    border: 3px solid var(--frame-color, #A2D2FF);
    border-radius: 15px;
    padding: 20px;
    padding-bottom: 80px; /* Add more space for logo */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 480px;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    --frame-color: #A2D2FF;
}

/* Simplified dots pattern control - EXACT same as preview-capture.css */
.photo-strip::before {
    display: block;
    z-index: 1; /* Place dots BEHIND photos */
}

/* Hide dots only when explicitly set to no-photos */
.photo-strip.no-photos::before {
    display: none !important;
}

.photo-strip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, white 2px, transparent 2px);
    background-size: 20px 20px;
    border-radius: 12px;
    pointer-events: none;
    display: block;
    z-index: 1; /* Place dots BEHIND photos */
}

/* When displaying exported image */
.photo-strip img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 15px;
  position: relative;
  z-index: 3; /* Ensure exported image is above dots */
}

/* Hide dots when showing exported image */
.photo-strip.exported-image-mode::before {
  display: none !important;
}

/* Layout classes for different photo counts */
.photo-strip.layout-2 {
  gap: 20px;
}

.photo-strip.layout-3 {
  gap: 18px;
}

.photo-strip.layout-4 {
  gap: 16px;
}

.photo-strip.layout-6 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  min-height: 460px;
  width: 400px;
}

.photo-strip.layout-6 .photo-frame {
  margin-bottom: 0;
  height: auto; /* Sử dụng tỷ lệ khung hình tự động */
}

.photo-frame {
  position: relative;
  margin-bottom: 15px;
  border-radius: 8px;
  background: white !important;
  box-shadow: none;
  border: 1px solid #e0e0e0;
  aspect-ratio: 3/2;
  overflow: hidden;
  z-index: 2; /* Place photos ABOVE dots */
}

.photo-frame:last-child {
  margin-bottom: 0;
}

/* Corner Logo - EXACT same as preview-capture.css */
.corner-logo {
    position: absolute;
    bottom: 20px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    z-index: 5; /* Place watermark ABOVE dots */
    background: rgba(255, 255, 255, 0.85);
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    min-width: fit-content;
    max-width: fit-content;
}

.logo-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.timestamp {
    font-size: 11px;
    font-weight: bold;
    color: #222222;
    font-family: Arial, sans-serif;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.date {
    font-size: 10px;
    font-weight: 500;
    color: #666666;
    font-family: Arial, sans-serif;
    letter-spacing: 0.1px;
    white-space: nowrap;
}

.captured-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
  background: white;
  border-radius: 8px;
  position: relative;
  z-index: 3; /* Place photos ABOVE dots */
}

.sticker {
  position: absolute;
  z-index: 10; /* Keep stickers on top */
  pointer-events: none;
}

.sticker img {
  width: auto;
  height: auto;
  max-width: 32px;
  max-height: 32px;
  display: block;
  object-fit: contain;
}

/* Animated Review Styles */
.animated-image {
  background: #f5f5f5;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.animated-photo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* Download buttons */
.download-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  margin-top: 20px;
  transition: background-color 0.3s ease;
}

.download-btn:hover {
  background: #0056b3;
}

/* Timestamp styling */
.timestamp {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-top: 20px;
  font-weight: 500;
}

.animated-image img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Timestamp */
.timestamp {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Download Buttons */
.download-btn {
  width: 100%;
  padding: 12px 20px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 5px;
  color: #000;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-btn:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
    gap: 30px;
  }
  
  .photo-strip-section,
  .animated-review-section {
    min-width: 100%;
  }
  
  .main-title {
    font-size: 2rem;
  }
  
  .photo-frame {
    width: 150px;
    height: 200px;
  }
}

/* QR Code Modal Styles */
.qr-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.qr-modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.qr-modal h3 {
  margin-bottom: 20px;
  color: #333;
  font-size: 20px;
  font-weight: 600;
}

.qr-code-container {
  margin: 20px 0;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 10px;
}

.qr-code-container canvas {
  max-width: 100%;
  height: auto;
}

.close-qr-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-qr-modal:hover {
  color: #000;
  background: #f5f5f5;
}

/* Mobile responsive for QR modal */
@media (max-width: 768px) {
  .qr-modal-content {
    margin: 5% auto;
    width: 95%;
    max-width: 350px;
    padding: 20px;
    max-height: 90vh;
  }
  
  .qr-modal h3 {
    font-size: 18px;
    margin-bottom: 15px;
  }
  
  .qr-code-container {
    margin: 15px 0;
    padding: 15px;
  }
  
  .qr-code-container canvas {
    max-width: 200px;
    max-height: 200px;
  }
  
  .close-qr-modal {
    top: 10px;
    right: 15px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .qr-modal-content {
    margin: 2% auto;
    width: 98%;
    max-width: 320px;
    padding: 15px;
  }
  
  .qr-modal h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  .qr-code-container {
    margin: 12px 0;
    padding: 12px;
  }
  
  .qr-code-container canvas {
    max-width: 180px;
    max-height: 180px;
  }
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
