/* File: /server/public/portal/css/components/cards.css */
/* Card Components Styles - Intent Selection & Profile Collection */
/* Date: 2026-01-08 */

/* ========================================
   Intent Selection Card
   ======================================== */

.intent-selection-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-width: 900px;
  margin: 20px auto;
  overflow: hidden;
  animation: slideIn 0.3s ease-out;
}

.intent-selection-card.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.intent-selection-card .card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.intent-selection-card .card-header .icon {
  font-size: 24px;
}

.intent-selection-card .card-header .title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.intent-selection-card .card-body {
  padding: 20px;
}

.intent-selection-card .hint {
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 16px 0;
}

.intent-selection-card .options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intent-selection-card .option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.intent-selection-card .option-item:hover {
  border-color: #667eea;
  background: #f9fafb;
}

.intent-selection-card .option-item input[type="radio"] {
  margin-top: 4px;
  cursor: pointer;
}

.intent-selection-card .option-item input[type="radio"]:checked + .option-content {
  color: #667eea;
}

.intent-selection-card .option-content {
  flex: 1;
}

.intent-selection-card .option-label {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
  display: block;
}

.intent-selection-card .option-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.intent-selection-card .card-footer {
  padding: 16px 20px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ========================================
   Profile Collection Card
   ======================================== */

.profile-collection-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-width: 600px;
  margin: 20px auto;
  overflow: hidden;
  animation: slideIn 0.3s ease-out;
}

.profile-collection-card.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.profile-collection-card .card-header {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-collection-card .card-header .icon {
  font-size: 24px;
}

.profile-collection-card .card-header .title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.profile-collection-card .card-body {
  padding: 20px;
}

.profile-collection-card .progress-bar {
  background: #e5e7eb;
  height: 8px;
  border-radius: 4px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.profile-collection-card .progress {
  background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.profile-collection-card .progress-text {
  position: absolute;
  top: -20px;
  right: 0;
  font-size: 12px;
  color: #6b7280;
}

.profile-collection-card .question {
  margin-top: 8px;
}

.profile-collection-card .question-text {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 16px 0;
}

.profile-collection-card .options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-collection-card .option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-collection-card .option-item:hover {
  border-color: #f5576c;
  background: #fef2f2;
}

.profile-collection-card .option-item input[type="radio"] {
  cursor: pointer;
}

.profile-collection-card .option-item input[type="radio"]:checked ~ .option-label {
  color: #f5576c;
  font-weight: 600;
}

.profile-collection-card .option-label {
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

/* ========================================
   Text Input Styles for Profile Collection
   ======================================== */

/**
 * @description Styles for open-ended text input fields
 * @date 2026-01-13
 */

.profile-collection-card .text-input-wrapper {
  width: 100%;
  margin: 20px 0;
}

.profile-collection-card .profile-text-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  color: #111827;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.3s ease;
  outline: none;
  box-sizing: border-box;
}

.profile-collection-card .profile-text-input:focus {
  border-color: #f5576c;
  box-shadow: 0 0 0 3px rgba(245, 87, 108, 0.1);
}

.profile-collection-card .profile-text-input::placeholder {
  color: #9ca3af;
}

.profile-collection-card .input-description {
  margin-top: 12px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #6b7280;
  background-color: #f9fafb;
  border-left: 4px solid #f5576c;
  border-radius: 4px;
}

.profile-collection-card .card-footer {
  padding: 16px 20px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ========================================
   Button Styles
   ======================================== */

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.btn-secondary:hover:not(:disabled) {
  background: #d1d5db;
}

.btn-text {
  background: transparent;
  color: #6b7280;
}

.btn-text:hover:not(:disabled) {
  color: #374151;
  text-decoration: underline;
}

/* ========================================
   Animations
   ======================================== */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Responsive Styles
   ======================================== */

@media (max-width: 640px) {
  .intent-selection-card,
  .profile-collection-card {
    margin: 12px;
    border-radius: 8px;
  }

  .intent-selection-card .card-header,
  .profile-collection-card .card-header {
    padding: 12px 16px;
  }

  .intent-selection-card .card-header .title,
  .profile-collection-card .card-header .title {
    font-size: 14px;
  }

  .intent-selection-card .card-body,
  .profile-collection-card .card-body {
    padding: 16px;
  }

  .intent-selection-card .option-item,
  .profile-collection-card .option-item {
    padding: 12px;
  }

  .profile-collection-card .card-footer {
    flex-direction: column;
  }

  .profile-collection-card .card-footer .btn {
    width: 100%;
  }
}

/* ========================================
   Grid Card Layout for Profile Collection
   ======================================== */

/**
 * @description Grid layout for identity selection (first step)
 * @date 2026-01-09
 * Reference: Modern card grid design from demo site
 */

.profile-collection-card.grid-layout .options {
  display: none; /* Hide traditional options in grid layout */
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.option-card {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.option-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: #667eea;
}

.option-card.selected {
  border-color: #667eea;
  background: #f5f7ff;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.option-card.selected::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: #667eea;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

/* Icon styles removed - no longer using icons in cards
.option-card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
*/

.option-card-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.option-card.selected .option-card-title {
  color: #667eea;
}

.option-card-example {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}

.option-card.selected .option-card-example {
  color: #4f46e5;
}

/* ========================================
   Responsive Grid Layout
   ======================================== */

@media (max-width: 768px) {
  .profile-collection-card {
    max-width: 100%;
    margin: 12px;
  }

  .option-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .option-card {
    padding: 24px 20px;
    min-height: 100px;
  }

  .option-card-title {
    font-size: 16px;
  }

  .option-card-example {
    font-size: 13px;
  }
}

/* ========================================
   Error State
   ======================================== */

.intent-selection-card.error,
.profile-collection-card.error {
  padding: 20px;
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
  text-align: center;
}
