/**
 * Batch Suggestion Card Styles
 * 
 * Simplified, clean design for batch contact suggestion cards
 * Requirements: 6.3, 6.4, 6.5, 6.6
 */

/* Batch card container */
.batch-suggestion-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.batch-suggestion-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

/* Accepted/skipped states */
.batch-suggestion-card.batch-accepted {
  opacity: 0.7;
  border-color: var(--status-success);
  background: var(--status-success-bg);
}

.batch-suggestion-card.batch-skipped {
  opacity: 0.5;
  border-color: var(--border-subtle);
}

/* Card header - simplified layout */
.batch-card-header {
  padding: 1.5rem;
  cursor: pointer;
  user-select: none;
}

.batch-card-header:hover {
  background: var(--bg-hover);
}

/* Title row with icon, name, and count */
.batch-card-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.batch-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.batch-card-title h3 {
  font-family: var(--font-accent);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.batch-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: var(--accent-primary);
  color: white;
  border-radius: 18px;
  font-family: var(--font-readable);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Description */
.batch-description {
  font-family: var(--font-readable);
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

/* Suggestion row - circle and signal on same line */
.batch-suggestion {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.batch-suggestion-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.suggestion-label {
  font-family: var(--font-readable);
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Circle badges - larger and clearer */
.circle-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-readable);
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  border: 2px solid;
}

.circle-badge-inner {
  background: #ede9fe;
  color: #6b21a8;
  border-color: #c4b5fd;
}

.circle-badge-close {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.circle-badge-active {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.circle-badge-casual {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

/* Signal strength indicator - clearer design */
.signal-strength {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-readable);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid;
}

.signal-high {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.signal-medium {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.signal-low {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

/* Expand indicator - simple chevron */
.batch-expand-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-readable);
  font-size: 0.875rem;
  font-weight: 600;
  gap: 0.5rem;
}

.expand-icon {
  transition: transform 0.3s ease;
  width: 20px;
  height: 20px;
}

.batch-card-header[aria-expanded="true"] .expand-icon {
  transform: rotate(180deg);
}

/* Contacts list (expanded view) */
.batch-card-contacts {
  border-top: 2px solid var(--border-subtle);
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  max-height: 400px;
  overflow-y: auto;
}

.batch-card-contacts.hidden {
  display: none;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Individual contact item - simplified */
.batch-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.batch-contact-item:hover {
  background: var(--bg-hover);
}

.batch-contact-item.selected {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
}

.contact-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-family: var(--font-readable);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.contact-email {
  font-family: var(--font-readable);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-stat {
  font-family: var(--font-readable);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* Card actions - prominent buttons */
.batch-card-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 2px solid var(--border-subtle);
  background: var(--bg-surface);
}

.batch-btn {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-accent);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  white-space: nowrap;
}

.batch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.batch-btn-primary {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.batch-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.batch-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.batch-btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.batch-btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

/* Mobile responsive - Requirements 20.2, 20.4 */
@media (max-width: 768px) {
  .batch-card-header {
    padding: 1rem;
  }

  .batch-card-title {
    flex-wrap: wrap;
  }

  .batch-card-title h3 {
    font-size: 1.125rem;
  }

  .batch-suggestion {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .batch-expand-btn {
    min-width: 44px; /* Touch-friendly minimum */
    min-height: 44px;
  }

  .batch-card-contacts {
    padding: 0.75rem 1rem;
  }

  .contacts-list {
    max-height: 300px;
  }

  .batch-contact-item {
    padding: 0.625rem;
  }

  .contact-checkbox {
    /* Ensure touch-friendly tap target */
    min-width: 44px;
    min-height: 44px;
    width: 24px;
    height: 24px;
    padding: 12px;
    margin: -12px;
  }

  .contact-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .batch-card-actions {
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.625rem;
  }

  .batch-btn {
    width: 100%;
    min-height: 44px; /* Touch-friendly minimum */
    padding: 0.875rem 1.5rem;
  }
}

/* Extra small devices (320px and up) */
@media (max-width: 480px) {
  .batch-suggestion-card {
    margin-bottom: 1rem;
    border-radius: 8px;
  }

  .batch-card-header {
    padding: 0.875rem;
  }

  .batch-card-title h3 {
    font-size: 1rem;
  }

  .batch-icon {
    font-size: 1.25rem;
  }

  .batch-count {
    min-width: 24px;
    height: 24px;
    font-size: 0.8125rem;
  }

  .batch-description {
    font-size: 0.875rem;
  }

  .circle-badge {
    font-size: 0.8125rem;
    padding: 0.3125rem 0.625rem;
  }

  .signal-strength {
    font-size: 0.75rem;
    padding: 0.1875rem 0.5rem;
  }

  .batch-card-contacts {
    padding: 0.625rem 0.875rem;
  }

  .contacts-list {
    max-height: 250px;
    gap: 0.625rem;
  }

  .batch-contact-item {
    padding: 0.5rem;
  }

  .contact-name {
    font-size: 0.875rem;
  }

  .contact-email,
  .contact-stat {
    font-size: 0.75rem;
  }

  .batch-card-actions {
    padding: 0.625rem 0.875rem;
  }

  .batch-btn {
    font-size: 0.875rem;
    padding: 0.875rem 1.25rem;
  }
}

/* Landscape orientation on small devices */
@media (max-width: 768px) and (orientation: landscape) {
  .contacts-list {
    max-height: 200px;
  }

  .batch-card-header {
    padding: 0.75rem 1rem;
  }

  .batch-card-actions {
    padding: 0.625rem 1rem;
  }
}

/* Dark mode support - using app's theme system */
[data-theme="dark"] .batch-suggestion-card {
  background: var(--bg-surface, #292524);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .batch-suggestion-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .batch-card-title h3 {
  color: var(--text-primary, #FAFAF9);
}

[data-theme="dark"] .batch-description {
  color: var(--text-secondary, #A8A29E);
}

[data-theme="dark"] .suggestion-label {
  color: var(--text-secondary, #A8A29E);
}

[data-theme="dark"] .batch-expand-btn {
  background: var(--stone-4, #44403C);
  border-color: var(--stone-6, #78716C);
}

[data-theme="dark"] .batch-expand-btn:hover {
  background: var(--stone-5, #57534E);
  border-color: var(--stone-7, #A8A29E);
}

[data-theme="dark"] .expand-icon {
  color: var(--text-primary, #FAFAF9);
}

[data-theme="dark"] .batch-card-contacts {
  background: var(--stone-2, #1C1917);
  border-top-color: var(--border-subtle, #78716C);
}

[data-theme="dark"] .batch-contact-item {
  background: var(--bg-surface, #292524);
}

[data-theme="dark"] .batch-contact-item:hover {
  background: var(--stone-4, #44403C);
}

[data-theme="dark"] .contact-name {
  color: var(--text-primary, #FAFAF9);
}

[data-theme="dark"] .contact-email {
  color: var(--text-secondary, #A8A29E);
}

[data-theme="dark"] .contact-stat {
  color: var(--text-tertiary, #78716C);
}

[data-theme="dark"] .batch-card-actions {
  background: var(--bg-surface, #292524);
  border-top-color: var(--border-subtle, #78716C);
}

[data-theme="dark"] .batch-btn-secondary {
  background: var(--stone-4, #44403C);
  border-color: var(--border-subtle, #78716C);
  color: var(--text-primary, #FAFAF9);
}

[data-theme="dark"] .batch-btn-secondary:hover:not(:disabled) {
  background: var(--stone-5, #57534E);
}

/* Circle badges in dark mode - brighter colors */
[data-theme="dark"] .circle-badge-inner {
  background: rgba(167, 139, 250, 0.25);
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.4);
}

[data-theme="dark"] .circle-badge-close {
  background: rgba(96, 165, 250, 0.25);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .circle-badge-active {
  background: rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.4);
}

[data-theme="dark"] .circle-badge-casual {
  background: rgba(168, 162, 158, 0.25);
  color: #e7e5e4;
  border-color: rgba(168, 162, 158, 0.4);
}

/* Signal strength in dark mode - brighter colors */
[data-theme="dark"] .signal-high {
  background: rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.4);
}

[data-theme="dark"] .signal-medium {
  background: rgba(251, 191, 36, 0.25);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.4);
}

[data-theme="dark"] .signal-low {
  background: rgba(168, 162, 158, 0.25);
  color: #e7e5e4;
  border-color: rgba(168, 162, 158, 0.4);
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .batch-suggestion-card,
  .batch-expand-btn,
  .expand-icon,
  .batch-contact-item,
  .batch-btn {
    transition: none;
  }

  .batch-btn-primary:hover:not(:disabled) {
    transform: none;
  }
}

/* Scrollbar styling for contacts list */
.contacts-list::-webkit-scrollbar {
  width: 8px;
}

.contacts-list::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.contacts-list::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-sm);
}

.contacts-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}
