/* Video Preview Feature Styles */

/* Preview button giờ nằm trong line-controls */
.line-btn-preview {
  /* Styling được kế thừa từ .line-btn */
}

.line {
  position: relative;
}

.line-content {
  position: relative;
}

.preview-generating {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.preview-modal-content {
  background: #ffffff;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

body.theme-dark .preview-modal-content {
  background: #1e293b;
  color: #f1f5f9;
}

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.preview-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.preview-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: #1f2933;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.preview-modal-close:hover {
  background: rgba(148, 163, 184, 0.3);
}

body.theme-dark .preview-modal-close {
  background: rgba(148, 163, 184, 0.3);
  color: #f1f5f9;
}

.preview-modal-body {
  padding: 24px;
}

.preview-video {
  width: 100%;
  border-radius: 12px;
  background: #000000;
  margin-bottom: 20px;
}

.preview-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-download,
.preview-share-tiktok,
.preview-share-instagram {
  flex: 1;
  min-width: 120px;
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #3b82f6;
  color: #ffffff;
}

.preview-download:hover,
.preview-share-tiktok:hover,
.preview-share-instagram:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.preview-share-tiktok {
  background: #000000;
}

.preview-share-tiktok:hover {
  background: #1a1a1a;
}

.preview-share-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.preview-share-instagram:hover {
  opacity: 0.9;
}

/* Mobile */
@media (max-width: 768px) {
  .preview-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
    top: 8px;
    right: 8px;
  }

  .preview-modal-content {
    max-width: 100%;
    margin: 10px;
  }

  .preview-modal-header {
    padding: 16px 20px;
    /* Đảm bảo close button không trùng với mobile-nav-trigger */
    position: relative;
    padding-right: 60px; /* Tạo khoảng trống cho close button */
  }

  .preview-modal-close {
    /* Di chuyển close button xuống dưới một chút để tránh trùng với mobile-nav-trigger (top: 16px, right: 16px) */
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 20px;
    z-index: 10001; /* Đảm bảo nằm trên mobile-nav-trigger (z-index: 60) */
  }

  .preview-actions {
    flex-direction: column;
  }

  .preview-download,
  .preview-share-tiktok,
  .preview-share-instagram {
    width: 100%;
  }
}

