/* Card Photo Upload Modal Styling */

/* Base Modal Styles */
#uploadCardPhotoModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#uploadCardPhotoModal .modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

#uploadCardPhotoModal .close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 32px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 1;
}

#uploadCardPhotoModal .close:hover {
  background: #f5f5f5;
  color: #333;
}

/* Modal Titles */
#uploadCardPhotoModal h2 {
  margin: 0;
  padding: 20px 24px;
  font-size: 24px;
  color: #333;
  border-bottom: 1px solid #ddd;
}

#uploadCardPhotoModal h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
  color: #333;
}

/* Modal Sections */
#uploadCardPhotoModal > .modal-content > div {
  padding: 24px;
}

#uploadForm,
#confirmationSection,
#progressSection,
#summarySection {
  padding: 24px;
}

.detected-cards-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #ddd;
  padding: 12px;
  margin: 16px 0;
  background: #fafafa;
  border-radius: 8px;
}

.detected-card-item {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #eee;
  background: white;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.detected-card-item:last-child {
  margin-bottom: 0;
}

.detected-card-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-checkbox {
  display: flex;
  align-items: start;
  cursor: pointer;
  gap: 12px;
}

.card-checkbox.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.card-checkbox input[type="checkbox"] {
  margin-top: 4px;
  cursor: pointer;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.card-checkbox.disabled input[type="checkbox"] {
  cursor: not-allowed;
}

/* Card Thumbnail */
.card-thumbnail {
  flex-shrink: 0;
  width: 60px;
  height: 84px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #ddd;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.thumbnail-image:hover {
  transform: scale(1.05);
}

.card-info {
  flex: 1;
}

.card-name {
  font-weight: bold;
  margin-bottom: 6px;
  color: #333;
  font-size: 16px;
}

.match-info {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
  line-height: 1.5;
}

.match-score {
  color: #4CAF50;
  font-size: 14px;
  font-weight: 600;
  margin-left: 6px;
}

.no-match-warning {
  color: #ff6b6b;
  font-size: 14px;
  font-weight: 600;
}

/* Progress Bar Styling */

.progress-bar {
  width: 100%;
  height: 30px;
  background: #f0f0f0;
  border-radius: 5px;
  overflow: hidden;
  margin: 10px 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #45a049);
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85em;
  font-weight: bold;
}

#progressText {
  text-align: center;
  margin: 10px 0;
  color: #666;
  font-size: 0.95em;
}

#progressDetails {
  max-height: 200px;
  overflow-y: auto;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 10px;
  margin-top: 10px;
}

.progress-detail {
  padding: 5px;
  margin: 2px 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  border-radius: 3px;
}

.progress-detail.success {
  color: #4CAF50;
  background: #f1f8f4;
}

.progress-detail.error {
  color: #ff6b6b;
  background: #fff5f5;
}

/* Image Preview */

#imagePreview {
  margin-top: 10px;
  text-align: center;
}

#imagePreview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Form Styling */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 16px;
}

.form-group input[type="file"],
.form-group input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: #2196F3;
}

.form-group small {
  display: block;
  margin-top: 8px;
  color: #999;
  font-size: 14px;
}

/* Button Styling */
.primary-btn {
  padding: 12px 24px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.primary-btn:hover {
  background: #45a049;
}

.primary-btn:active {
  transform: scale(0.98);
}

.primary-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.secondary-btn {
  padding: 12px 24px;
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: #e0e0e0;
}

.secondary-btn:active {
  transform: scale(0.98);
}

/* Modal Actions */
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-actions button {
  flex: 1;
}

/* Info Text */

.info-text {
  color: #666;
  font-size: 0.95em;
  margin: 10px 0;
}

/* Summary Section */

#summaryDetails {
  margin-top: 15px;
}

#summaryDetails h4 {
  color: #ff6b6b;
  margin-top: 10px;
  margin-bottom: 5px;
}

#summaryDetails ul {
  list-style: none;
  padding-left: 0;
}

#summaryDetails li {
  padding: 5px 0;
  color: #666;
}

/* Card Selection Counter */
.card-selection-counter {
  text-align: center;
  margin: 16px 0;
  padding: 12px;
  background: #f0f8ff;
  border: 2px solid #2196F3;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.card-selection-counter #selectedCount {
  color: #2196F3;
  font-size: 18px;
}

.card-selection-counter #totalCount {
  color: #666;
  font-size: 18px;
}

/* First Copy Badge */
.first-copy-badge {
  display: inline-block;
  font-size: 18px;
  vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}

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