/**
 * Gift Finder V2 - Minimal Theme Styles
 * Matches discover page styling: white background, black text, #d72c2c brand accent
 */

/* Base Page Styles */
.gf-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #fff;
  min-height: 100vh;
  padding: 40px 20px;
  max-width: 100%;
  margin: 0 auto;
  color: #000;
}

.gf-page * {
  box-sizing: border-box;
}

/* Quiz Page Header - Refined Style */
.gf-quiz-header {
  text-align: center;
  color: #000;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.gf-quiz-preheader {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #666;
  margin: 0 0 8px 0;
}

.gf-quiz-title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif !important;
  font-style: italic !important;
  font-size: 36px;
  font-weight: 600;
  margin: 0 0 16px 0;
  line-height: 1.3;
  color: #000;
}

.gf-quiz-subtitle {
  font-size: 15px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* Legacy header (kept for backwards compat) */
.gf-header {
  text-align: center;
  color: #000;
  margin-bottom: 40px;
}

.gf-logo {
  font-size: 48px;
  margin-bottom: 16px;
}

.gf-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #000;
}

.gf-subtitle {
  font-size: 16px;
  color: #666;
}

/* Main Prompt Section */
.gf-prompt-section {
  max-width: 600px;
  margin: 0 auto 24px;
  background: #fff;
  padding: 16px 0;
}

.gf-prompt-box {
  position: relative;
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 16px;
  padding: 0;
  transition: all 0.2s;
}

.gf-prompt-box:focus-within {
  border-color: #d72c2c;
  box-shadow: 0 0 0 3px rgba(215, 44, 44, 0.1);
}

.gf-prompt-input {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px 16px 0 0;
  font-size: 16px;
  font-family: inherit;
  resize: none;
  background: transparent;
  color: #000;
  line-height: 1.5;
  box-sizing: border-box;
}

.gf-prompt-input:focus {
  outline: none;
}

.gf-prompt-input::placeholder {
  color: #999;
}

.gf-find-btn {
  padding: 10px 20px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.gf-find-btn:hover {
  background: #222;
}

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

.gf-find-btn .btn-icon {
  font-size: 16px;
}

/* Selected Pills Display - Inside prompt box bottom bar */
.gf-prompt-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 8px;
  padding-top: 0;
  gap: 8px;
}

.gf-selected-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.gf-selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #d72c2c;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  animation: gf-pillPop 0.2s ease-out;
}

@keyframes gf-pillPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.gf-selected-pill .pill-remove {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.gf-selected-pill .pill-remove:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Suggestions Section - Compact Inline Rows */
.gf-suggestions-section {
  max-width: 600px;
  margin: 0 auto 40px;
}

.gf-suggestions-intro {
  color: #666;
  text-align: center;
  margin-bottom: 16px;
  font-size: 14px;
}

.gf-accent {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif !important;
  font-style: italic !important;
  font-weight: 600;
  color: #000;
}

.gf-suggestion-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.gf-suggestion-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid #eee;
}

.gf-suggestion-row:last-child {
  border-bottom: none;
}

.gf-row-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-right: 4px;
}

.gf-row-icon {
  font-size: 14px;
}

.gf-row-pills {
  display: contents;
}

/* Legacy grid styles (kept for backwards compat) */
.gf-suggestion-categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.gf-suggestion-category {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e5e5e5;
}

.gf-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #000;
}

.gf-category-icon {
  font-size: 18px;
}

.gf-category-label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.gf-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gf-pill {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 13px;
  font-weight: 400;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 8px;
  font-size: 14px;
}

.gf-pill:hover {
  color: #d72c2c;
}

.gf-pill.selected {
  color: #d72c2c;
  font-weight: 600;
  text-decoration: none;
}

.gf-pill.disabled {
  opacity: 0.4;
  cursor: default;
}

/* Emoji-only pills (personality category) */
.gf-pill[data-category="personality"] {
  font-size: 22px;
  text-decoration: none;
  padding: 5px 3px;
  transition: transform 0.15s ease;
}

.gf-pill[data-category="personality"]:hover {
  color: inherit;
  transform: scale(1.2);
}

.gf-pill[data-category="personality"].selected {
  transform: scale(1.2);
  color: inherit;
}

/* Pot Luck Section */
.gf-potluck-section {
  text-align: center;
  margin-bottom: 40px;
}

.gf-potluck-text {
  color: #666;
  font-size: 14px;
  margin-bottom: 12px;
}

.gf-potluck-btn {
  padding: 12px 24px;
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 50px;
  color: #333;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.gf-potluck-btn:hover {
  border-color: #d72c2c;
  color: #d72c2c;
}

/* Loading State */
.gf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  color: #000;
  font-size: 16px;
  gap: 24px;
  z-index: 10000;
  padding: 20px;
}

.gf-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 400px;
  text-align: center;
}

.gf-loading-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.gf-loading-header .gf-header-icon {
  margin-bottom: 0;
}

.gf-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: #000;
  border-radius: 50%;
  animation: gf-spin 0.8s linear infinite;
}

@keyframes gf-spin {
  to { transform: rotate(360deg); }
}

.gf-loading-status {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif !important;
  font-style: italic !important;
  font-weight: 600;
  font-size: 20px;
  color: #000;
  margin: 0;
}

.gf-loading-searches {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.gf-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.gf-search-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.gf-search-item.searching {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.gf-search-item.complete {
  background: #fff;
  box-shadow: none;
}

.gf-search-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.gf-search-text {
  flex: 1;
  text-align: left;
}

.gf-search-check {
  color: #000;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gf-search-item.complete .gf-search-check {
  opacity: 1;
}

/* Results Page */
.gf-results-page {
  padding-top: 40px;
}

.gf-results-header {
  text-align: center;
  color: #000;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.gf-header-icon {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.gf-header-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}

.gf-results-preheader {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #666;
  margin: 0 0 8px 0;
  padding: 0 20px;
}

.gf-results-title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif !important;
  font-style: italic !important;
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 24px 0;
  padding: 0 20px;
  line-height: 1.3;
  color: #000;
}

/* Header Buttons Container */
.gf-header-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Header Share Button */
.gf-share-btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  padding: 10px 14px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
}

.gf-share-btn-header svg {
  flex-shrink: 0;
}

.gf-share-btn-header:hover {
  background: #333;
}

.gf-share-btn-header.gf-copied {
  background: #28a745;
}

/* Header Gift Card Button */
.gf-giftcard-btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background-image: url('https://cdn.shopify.com/s/files/1/0966/6602/6315/files/gift_bg_2.jpg?v=1765207601');
  background-size: cover;
  background-position: center 30%;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.gf-giftcard-btn-header svg {
  flex-shrink: 0;
}

.gf-giftcard-btn-header:hover {
  opacity: 0.9;
  color: #fff;
}

/* Product Grid */
.gf-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 40px;
}

.gf-product-card {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  transition: opacity 0.2s;
}

.gf-product-card:hover {
  opacity: 0.9;
}

.gf-product-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.gf-product-image-wrapper {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f5f5;
}

.gf-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mock Image Container for framed products */
.mock-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mock-image-container svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Category Pill */
.gf-category-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  z-index: 2;
  pointer-events: none;
}

.gf-product-info {
  padding: 12px 0;
}

.gf-product-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 4px;
  color: #000;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gf-product-price {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* Results Actions */
.gf-results-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto 40px;
  flex-wrap: wrap;
}

.gf-action-btn {
  flex: 0 1 auto;
  padding: 14px 28px;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.gf-action-btn-primary {
  background: #000;
  color: #fff;
}

.gf-action-btn-primary:hover {
  background: #222;
}

.gf-action-btn-secondary {
  background: #d72c2c;
  color: #fff;
}

.gf-action-btn-secondary:hover {
  background: #b92424;
}

.gf-action-btn-outline {
  background: transparent;
  color: #000;
  border: 2px solid #000;
}

.gf-action-btn-outline:hover {
  background: #000;
  color: #fff;
}

.gf-share-btn.gf-copied {
  background: #22c55e;
}

/* Category Legend */
.gf-category-legend {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  color: #000;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
}

.gf-category-legend h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gf-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.gf-legend-item {
  background: #fff;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
  .gf-suggestion-categories {
    grid-template-columns: repeat(2, 1fr);
  }

  .gf-product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .gf-page {
    padding: 20px 16px;
  }

  /* Sticky prompt section on mobile only */
  .gf-prompt-section {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .gf-title {
    font-size: 26px;
  }

  .gf-logo {
    font-size: 40px;
  }

  .gf-suggestion-categories {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gf-suggestion-category {
    padding: 14px;
  }

  .gf-category-pills {
    gap: 8px;
  }

  .gf-prompt-input {
    font-size: 16px;
    padding: 14px;
  }

  .gf-find-btn {
    font-size: 13px;
    padding: 8px 14px;
  }

  .gf-prompt-actions {
    flex-wrap: wrap;
  }

  .gf-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .gf-results-title {
    font-size: 26px;
  }

  .gf-results-preheader {
    font-size: 11px;
  }

  .gf-results-actions {
    flex-direction: column;
    padding: 0 20px;
  }

  .gf-results-actions .gf-action-btn {
    width: 100%;
  }
}
