/* Workout Name Suggestions Component */

.workout-name-suggestions {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Header Section */
.suggestions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.suggestions-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 600;
}

.suggestions-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.count-select {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  font-size: 0.875rem;
}

/* Loading Section */
.suggestions-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  text-align: center;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #f3f4f6;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.suggestions-loading p {
  margin: 0;
  color: #6b7280;
  font-style: italic;
}

/* Suggestions List */
.suggestions-list {
  min-height: 200px;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
}

.suggestion-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.suggestion-item.selected {
  border-color: #10b981;
  background: #f0fdf4;
}

.suggestion-content {
  flex: 1;
}

.suggestion-name {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
}

.suggestion-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.word-count {
  color: #6b7280;
  font-size: 0.875rem;
}

.emphasis-score {
  font-size: 0.875rem;
  font-weight: 500;
}

.suggestion-categories {
  font-size: 0.75rem;
  color: #9ca3af;
}

.suggestion-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-copy {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  font-size: 1rem;
}

.btn-copy:hover {
  background: #f3f4f6;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #6b7280;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  color: #374151;
}

.empty-state p {
  margin: 0.5rem 0;
  font-size: 0.875rem;
}

.context-hint {
  color: #3b82f6 !important;
  font-weight: 500;
}

/* Context Section */
.suggestions-context {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.context-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.context-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
}

.context-toggle {
  background: none;
  border: 1px solid #d1d5db;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.context-toggle:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.context-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.context-section {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #f3f4f6;
}

.context-section h5 {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.context-section ul {
  margin: 0;
  padding-left: 1rem;
}

.context-section li {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Error Section */
.suggestions-error {
  text-align: center;
  padding: 2rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  margin-top: 1rem;
}

.error-content h4 {
  margin: 0 0 0.5rem 0;
  color: #dc2626;
  font-size: 1.125rem;
}

.error-content p {
  margin: 0.5rem 0 1rem 0;
  color: #7f1d1d;
  font-size: 0.875rem;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Modal Styles */
.workout-name-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #1f2937;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  display: flex;
  justify-content: flex-end;
}

/* Modal-specific Instructions */
.suggestions-instructions {
  margin-bottom: 1.5rem;
}

.instructions-empty,
.instructions-ready {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.instructions-empty {
  background: #fef3c7;
  border-color: #fbbf24;
}

.instructions-ready {
  background: #dcfce7;
  border-color: #16a34a;
}

.instruction-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.instruction-heading-empty {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  color: #92400e;
}

.instruction-heading-ready {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  color: #166534;
}

.instruction-text-empty {
  margin: 0;
  font-size: 0.875rem;
  color: #a16207;
}

.instruction-text-ready {
  margin: 0;
  font-size: 0.875rem;
  color: #15803d;
}

/* Form Field with Action Button */
.form-field-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.name-suggestion-trigger {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  white-space: nowrap;
}

/* Suggestion list container */
.suggestion-list-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

/* Pill-style suggestion badge */
.suggestion-pill {
  padding: 0.5rem 1rem;
  border: 2px solid var(--medium-gray);
  border-radius: 1.5rem;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0;
  display: inline-block;
  white-space: nowrap;
  color: var(--dark-gray);
}

.suggestion-pill:hover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);
}

.no-suggestions {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .suggestions-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .suggestions-controls {
    justify-content: space-between;
  }
  
  .suggestion-item {
    flex-direction: column;
    gap: 1rem;
  }
  
  .suggestion-actions {
    align-self: flex-end;
  }
  
  .context-sections {
    grid-template-columns: 1fr;
  }

  /* Modal responsive styles */
  .workout-name-modal {
    padding: 0.5rem;
  }

  .modal-content {
    max-height: 95vh;
  }

  .form-field-with-action {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .name-suggestion-trigger {
    order: -1;
    margin-bottom: 0.5rem;
  }
}