/* Feedback Feature Styles - Matching Broc Design System */

/* ===== FLOATING FEEDBACK BUTTON (Fixed position in header next to Demo) ===== */

.feedback-indicator {
  position: fixed;
  bottom: 152px; /* Above demo button */
  right: 16px;
  z-index: 10001; /* Above sheets/drawers */
  pointer-events: auto;
}

.feedback-floating-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  width: 44px;
  height: 44px;
  background: var(--brokerly-primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(26, 127, 230, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  overflow: hidden;
  white-space: nowrap;
}

.feedback-floating-button svg {
  min-width: 20px;
  width: 20px;
  height: 20px;
  margin: 0 12px;
  flex-shrink: 0;
}

.feedback-label {
  max-width: 0;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  padding-right: 0;
  white-space: nowrap;
}

.feedback-floating-button:hover {
  background: var(--brokerly-primary-dark);
  padding-right: 16px;
  width: auto;
  box-shadow: 0 6px 16px rgba(26, 127, 230, 0.4);
}

.feedback-floating-button:hover .feedback-label {
  max-width: 200px;
  opacity: 1;
  padding-right: 0;
}

.feedback-floating-button:active {
  transform: scale(0.95);
}

/* ===== FEEDBACK MODAL/SHEET ===== */

.feedback-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001; /* Above other sheets */
  display: none;
  pointer-events: none;
  visibility: hidden;
}

.feedback-sheet.active {
  display: block;
  pointer-events: auto;
  visibility: visible;
}

.feedback-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.feedback-sheet.active .feedback-backdrop {
  opacity: 1;
}

.feedback-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80vh;
  background: var(--brokerly-secondary-background);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.feedback-sheet.active .feedback-content {
  transform: translateY(0);
}

/* Desktop: Center modal instead of bottom sheet */
@media (min-width: 768px) {
  .feedback-content {
    position: absolute;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.9);
    max-width: 600px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    opacity: 0;
  }
  
  .feedback-sheet.active .feedback-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* ===== FEEDBACK HEADER ===== */

.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--brokerly-border-light);
}

.feedback-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--brokerly-text-primary);
  margin: 0;
}

.feedback-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--brokerly-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.feedback-close:hover {
  background: var(--brokerly-border-light);
  color: var(--brokerly-text-primary);
}

/* ===== FEEDBACK BODY ===== */

.feedback-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== SCREENSHOT SECTION ===== */

.feedback-screenshot-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-section-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--brokerly-text-secondary);
  margin: 0;
}

.feedback-screenshot-actions {
  display: flex;
  gap: 8px;
}

.screenshot-action-button {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--brokerly-primary-lighter);
  border: 1px solid var(--brokerly-border-light);
  color: var(--brokerly-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.screenshot-action-button:hover {
  background: var(--brokerly-primary-light);
  border-color: var(--brokerly-primary);
}

.screenshot-action-button svg {
  width: 16px;
  height: 16px;
}

.feedback-screenshot-preview {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--brokerly-border-light);
  background: var(--brokerly-background);
}

.feedback-screenshot-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.feedback-screenshot-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  border: none;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
}

.feedback-screenshot-remove:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* ===== CATEGORY SECTION ===== */

.feedback-category-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-category-pill {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--brokerly-background);
  border: 1.5px solid var(--brokerly-border-medium);
  color: var(--brokerly-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.feedback-category-pill:hover {
  border-color: var(--brokerly-primary);
  background: var(--brokerly-primary-lighter);
}

.feedback-category-pill.selected {
  background: var(--brokerly-primary);
  border-color: var(--brokerly-primary);
  color: white;
}

/* Category specific colors */
.feedback-category-pill[data-category="bug"].selected {
  background: var(--brokerly-danger);
  border-color: var(--brokerly-danger);
}

.feedback-category-pill[data-category="feature-request"].selected {
  background: var(--brokerly-warm-green);
  border-color: var(--brokerly-warm-green);
}

.feedback-category-pill[data-category="suggestion"].selected {
  background: var(--brokerly-primary);
  border-color: var(--brokerly-primary);
}

.feedback-category-pill[data-category="needs-clarity"].selected {
  background: var(--brokerly-warning);
  border-color: var(--brokerly-warning);
}

/* ===== TEXT INPUT SECTION ===== */

.feedback-text-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--brokerly-border-medium);
  background: var(--brokerly-input-background);
  color: var(--brokerly-text-primary);
  font-size: var(--font-size-base);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  resize: vertical;
  transition: all var(--transition-fast);
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--brokerly-primary);
  box-shadow: 0 0 0 3px var(--brokerly-primary-lighter);
}

.feedback-textarea::placeholder {
  color: var(--brokerly-text-tertiary);
}

.feedback-char-count {
  font-size: var(--font-size-xs);
  color: var(--brokerly-text-tertiary);
  text-align: right;
}

.feedback-char-count.warning {
  color: var(--brokerly-warning);
}

.feedback-char-count.error {
  color: var(--brokerly-danger);
}

/* ===== EMAIL SECTION ===== */

.feedback-email-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-email-input {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--brokerly-border-medium);
  background: var(--brokerly-input-background);
  color: var(--brokerly-text-primary);
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
}

.feedback-email-input:focus {
  outline: none;
  border-color: var(--brokerly-primary);
  box-shadow: 0 0 0 3px var(--brokerly-primary-lighter);
}

.feedback-email-input::placeholder {
  color: var(--brokerly-text-tertiary);
}

.feedback-email-hint {
  font-size: var(--font-size-xs);
  color: var(--brokerly-text-tertiary);
}

/* ===== VALIDATION MESSAGES ===== */

.feedback-error-message {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid var(--brokerly-danger);
  color: var(--brokerly-danger);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-error-message svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===== FOOTER / SUBMIT SECTION ===== */

.feedback-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--brokerly-border-light);
  background: var(--brokerly-background);
}

.feedback-submit-button {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--brokerly-primary);
  border: none;
  color: white;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.feedback-submit-button:hover:not(:disabled) {
  background: var(--brokerly-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--brokerly-primary-shadow);
}

.feedback-submit-button:active:not(:disabled) {
  transform: translateY(0);
}

.feedback-submit-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.feedback-submit-button .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

/* ===== SCREENSHOT CAPTURE OVERLAY ===== */

.screenshot-capture-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10002; /* Above feedback modal */
  background: rgba(0, 0, 0, 0.7);
  cursor: crosshair;
  display: none;
}

.screenshot-capture-overlay.active {
  display: block;
}

.screenshot-instructions {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(10px);
  z-index: 10003;
}

.screenshot-selection {
  position: absolute;
  border: 2px dashed var(--brokerly-primary);
  background: rgba(26, 127, 230, 0.1);
  pointer-events: none;
}

.screenshot-selection-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--brokerly-primary);
  border: 2px solid white;
  border-radius: 50%;
  cursor: nwse-resize;
  pointer-events: auto;
}

.screenshot-selection-handle.nw {
  top: -5px;
  left: -5px;
  cursor: nw-resize;
}

.screenshot-selection-handle.ne {
  top: -5px;
  right: -5px;
  cursor: ne-resize;
}

.screenshot-selection-handle.sw {
  bottom: -5px;
  left: -5px;
  cursor: sw-resize;
}

.screenshot-selection-handle.se {
  bottom: -5px;
  right: -5px;
  cursor: se-resize;
}

/* ===== RATE LIMIT MESSAGE ===== */

.feedback-rate-limit-message {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid var(--brokerly-warning);
  color: var(--brokerly-warning);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-rate-limit-message svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===== ANIMATIONS ===== */

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

/* ===== RESPONSIVE ADJUSTMENTS ===== */

/* Mobile: Hide "Capture Area" button, keep only "Capture Full Page" */
@media (max-width: 767px) {
  #capture-area-button {
    display: none;
  }
  
  .feedback-screenshot-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .feedback-content {
    max-height: 95vh;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
  }
  
  .feedback-categories {
    gap: 6px;
  }
  
  .feedback-category-pill {
    font-size: var(--font-size-xs);
    padding: 6px 12px;
  }
}

