/**
 * Admin Business Card Scanner Styles
 * Desktop version of the mobile Business Card Scanner feature
 * 
 * Allows scanning business cards via camera or upload with
 * AI-powered extraction via OpenAI Vision API.
 */

/* ========================================
   BUSINESS CARD SCANNER MODAL
   ======================================== */
.business-card-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.business-card-modal.open {
  display: flex;
}

.business-card-content {
  background: var(--admin-panel, #0e1014);
  border: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.business-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
}

.business-card-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--admin-text, #fff);
  display: flex;
  align-items: center;
  gap: 10px;
}

.business-card-title i {
  color: #3b82f6;
}

.business-card-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--admin-line-strong, rgba(255, 255, 255, 0.15));
  background: transparent;
  color: var(--admin-text-muted, #a0a0a0);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.business-card-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* ========================================
   IMAGE CAPTURE AREA
   ======================================== */
.business-card-body {
  padding: 24px;
}

/* Upload hint */
.card-upload-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--admin-text-secondary, #e8e8e8);
}

.card-upload-hint i {
  color: #fbbf24;
  font-size: 16px;
}

.card-images-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.card-image-slot {
  aspect-ratio: 1;
  border: 2px solid var(--admin-line-strong, rgba(255, 255, 255, 0.15));
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  background: var(--admin-card, #141414);
}

.card-image-slot:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.card-image-slot.has-image {
  border-style: solid;
  border-color: #22c55e;
}

/* Add image slot */
.card-image-add {
  aspect-ratio: 1;
  border: 2px dashed var(--admin-line-strong, rgba(255, 255, 255, 0.15));
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--admin-card, #141414);
  text-align: center;
  color: var(--admin-text-muted, #a0a0a0);
  gap: 6px;
}

.card-image-add:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.card-image-add i {
  font-size: 28px;
}

.card-image-add span {
  font-size: 12px;
  font-weight: 500;
}

.card-image-add small {
  font-size: 10px;
  opacity: 0.7;
}

.card-image-placeholder {
  text-align: center;
  color: var(--admin-text-muted, #a0a0a0);
}

.card-image-placeholder i {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

.card-image-placeholder span {
  font-size: 13px;
}

/* Image name label */
.card-image-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  font-size: 10px;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.card-image-slot.has-image .card-image-preview {
  display: block;
}

.card-image-slot.has-image .card-image-placeholder {
  display: none;
}

.card-image-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.card-image-slot.has-image .card-image-remove {
  display: flex;
}

.card-image-remove:hover {
  background: #ef4444;
  transform: scale(1.1);
}

/* ========================================
   CAPTURE BUTTONS
   ======================================== */
.card-capture-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.card-capture-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  border-radius: 12px;
  border: 1px solid var(--admin-line-strong, rgba(255, 255, 255, 0.15));
  background: var(--admin-card, #141414);
  color: var(--admin-text-secondary, #e8e8e8);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.card-capture-btn:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.card-capture-btn i {
  font-size: 24px;
  color: #3b82f6;
}

.card-capture-btn.primary {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.card-capture-btn.primary:hover {
  background: rgba(34, 197, 94, 0.25);
}

.card-capture-btn.primary i {
  color: #22c55e;
}

/* ========================================
   AI PROCESSING STATE
   ======================================== */
.card-processing {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.card-processing.active {
  display: flex;
}

.card-processing-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--admin-line, rgba(255, 255, 255, 0.1));
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.card-processing-text {
  font-size: 14px;
  color: var(--admin-text-secondary, #e8e8e8);
}

.card-processing-text small {
  display: block;
  font-size: 12px;
  color: var(--admin-text-muted, #a0a0a0);
  margin-top: 4px;
}

/* ========================================
   EXTRACTED FIELDS PREVIEW
   ======================================== */
.card-extracted-fields {
  display: none;
  padding: 16px;
  background: var(--admin-card, #141414);
  border: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  margin-bottom: 20px;
}

.card-extracted-fields.active {
  display: block;
}

.card-extracted-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #22c55e;
  margin-bottom: 12px;
}

.card-extracted-list {
  display: grid;
  gap: 8px;
}

.card-extracted-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--admin-panel, #0e1014);
  border-radius: 8px;
}

.card-extracted-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--admin-text-muted, #a0a0a0);
  text-transform: uppercase;
  min-width: 80px;
}

.card-extracted-value {
  font-size: 14px;
  color: var(--admin-text, #fff);
  flex: 1;
}

/* ========================================
   ACTION BUTTONS
   ======================================== */
.card-actions {
  display: none;
  gap: 12px;
}

.card-actions.active {
  display: flex;
}

.card-action-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid var(--admin-line-strong, rgba(255, 255, 255, 0.15));
  background: transparent;
  color: var(--admin-text-secondary, #e8e8e8);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.card-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.card-action-btn.retake {
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.card-action-btn.retake:hover {
  background: rgba(245, 158, 11, 0.1);
}

.card-action-btn.use {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.card-action-btn.use:hover {
  background: rgba(34, 197, 94, 0.25);
}

/* ========================================
   ADDITIONAL INFO STYLING
   ======================================== */
.card-extracted-item--additional {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.card-extracted-item--additional .card-extracted-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fbbf24;
}

.card-extracted-item--additional .card-extracted-label i {
  font-size: 12px;
}

.card-extracted-item--additional .card-extracted-label small {
  font-size: 10px;
  color: var(--admin-text-muted, rgba(255, 255, 255, 0.5));
  font-weight: 400;
}

.card-extracted-value--note {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 600px) {
  .card-images-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .card-upload-hint {
    font-size: 12px;
    padding: 10px 12px;
  }
}

@media (max-width: 400px) {
  .card-images-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .card-capture-buttons {
    flex-direction: column;
  }
  
  .card-upload-hint {
    flex-direction: column;
    text-align: center;
  }
}
