/* Woise Widget Styles */
/* Apple-inspired design system - NO SHADOWS, use borders */

/* Set font family for the entire widget */
* {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#woise-widget-button {
  position: fixed;
  bottom: var(--woise-offset, 20px);
  right: var(--woise-offset, 20px);
  z-index: 999999;
  background: var(--woise-brand-color, #b8145b);
  color: white;
  border: none;
  border-radius: 12px; /* fallback; overridden by inline style */
  width: 54px;
  height: 54px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  outline: none;
  padding: 0;
}

/* Icon styling */
#woise-widget-button .woise-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#woise-widget-button .woise-button-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

#woise-widget-button.size-small .woise-button-icon svg {
  width: 20px;
  height: 20px;
}

#woise-widget-button.size-large .woise-button-icon svg {
  width: 28px;
  height: 28px;
}

/* Button size variants */
#woise-widget-button.size-small {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

#woise-widget-button.size-large {
  width: 64px;
  height: 64px;
  font-size: 26px;
}


#woise-widget-button:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

#woise-widget-button:active {
  transform: scale(0.95);
}

/* Position variations - 8 positions */
/* Bottom row */
#woise-widget-button.position-bottom-left {
  right: auto;
  left: var(--woise-offset, 20px);
}

#woise-widget-button.position-bottom-center {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}

#woise-widget-button.position-bottom-center:hover {
  transform: translateX(-50%) scale(1.05);
}

#woise-widget-button.position-bottom-center:active {
  transform: translateX(-50%) scale(0.95);
}

/* Top row */
#woise-widget-button.position-top-right {
  bottom: auto;
  top: var(--woise-offset, 20px);
}

#woise-widget-button.position-top-left {
  bottom: auto;
  top: var(--woise-offset, 20px);
  right: auto;
  left: var(--woise-offset, 20px);
}

#woise-widget-button.position-top-center {
  bottom: auto;
  top: var(--woise-offset, 20px);
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}

#woise-widget-button.position-top-center:hover {
  transform: translateX(-50%) scale(1.05);
}

#woise-widget-button.position-top-center:active {
  transform: translateX(-50%) scale(0.95);
}

/* Middle row */
#woise-widget-button.position-middle-left {
  bottom: auto;
  top: 50%;
  right: auto;
  left: var(--woise-offset, 20px);
  transform: translateY(-50%);
}

#woise-widget-button.position-middle-left:hover {
  transform: translateY(-50%) scale(1.05);
}

#woise-widget-button.position-middle-left:active {
  transform: translateY(-50%) scale(0.95);
}

#woise-widget-button.position-middle-right {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}

#woise-widget-button.position-middle-right:hover {
  transform: translateY(-50%) scale(1.05);
}

#woise-widget-button.position-middle-right:active {
  transform: translateY(-50%) scale(0.95);
}

/* Hide on mobile */
@media (max-width: 767px) {
  #woise-widget-button.hide-on-mobile {
    display: none !important;
  }
}

/* Modal overlay */
#woise-widget-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999998;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  animation: woiseeFadeIn 0.2s ease;
}

#woise-widget-modal.open {
  display: flex;
}

@keyframes woiseFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal content */
#woise-widget-content {
  background: white;
  border-radius: 24px;
  border: 1px solid #e5e7eb;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  position: relative;
  animation: woiseSlideUp 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Modal body with scrollbar inside rounded corners */
#woise-modal-body {
  padding: 32px;
  overflow-y: auto;
  flex: 1;
}

@keyframes woiseSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes woiseSlideInLeft {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Close button */
#woise-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #9ca3af;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 10;
}

#woise-close-btn:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Header */
.woise-header {
  margin-bottom: 24px;
}

.woise-header h3 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
  color: #111827;
  line-height: 1.2;
}

.woise-header p {
  font-size: 15px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

/* Buttons */
.woise-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-bottom: 12px;
}

.woise-btn-primary {
  background: var(--woise-brand-color, #b8145b);
  color: white;
}

.woise-btn-primary:hover {
  opacity: 0.9;
}

.woise-btn-primary:active {
  transform: scale(0.98);
}

.woise-btn-outline {
  background: white;
  border: 2px solid #d1d5db;
  color: #374151;
}

.woise-btn-outline:hover {
  border-color: #9ca3af;
}

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

/* Form elements */
.woise-form-group {
  margin-bottom: 20px;
}

.woise-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #374151;
}

.woise-input,
.woise-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
  color: #111827;
  background: white;
}

.woise-input:focus,
.woise-textarea:focus {
  outline: none;
  border-color: var(--woise-brand-color, #b8145b);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.woise-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

/* Recording indicator - Draggable overlay */
#woise-recording-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  background: white;
  color: #111827;
  padding: 16px 20px;
  border-radius: 24px;
  border: 1px solid #e5e7eb;
  display: none;
  flex-direction: column;
  gap: 12px;
  font-weight: 500;
  cursor: move;
  user-select: none;
  max-width: 320px;
  min-width: 280px;
}

#woise-recording-indicator.active {
  display: flex;
}

#woise-recording-indicator.minimized {
  min-width: auto;
  max-width: none;
  padding: 12px 16px;
}

#woise-recording-indicator.minimized .woise-recording-instructions {
  display: none;
}

.woise-recording-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.woise-recording-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-weight: 600;
}

.woise-recording-instructions {
  font-size: 13px;
  line-height: 1.5;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
  margin-top: 4px;
}

.woise-recording-instructions div {
  margin-bottom: 6px;
}

.woise-recording-instructions div:last-child {
  margin-bottom: 0;
}

.woise-minimize-btn {
  background: #f3f4f6;
  border: none;
  color: #6b7280;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.woise-minimize-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

.woise-recording-dot {
  width: 12px;
  height: 12px;
  background: #A31F34;
  border-radius: 50%;
  animation: woisePulse 1.5s infinite;
}

@keyframes woisePulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.woise-screenshot-btn {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 8px 20px;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  width: 100%;
  margin-top: 4px;
}

.woise-screenshot-btn:hover {
  border-color: #9ca3af;
}

.woise-screenshot-btn:active {
  transform: scale(0.98);
}

.woise-stop-btn {
  background: #A31F34;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  width: 100%;
  margin-top: 4px;
}

.woise-stop-btn:hover {
  background: #8B1A2E;
}

.woise-stop-btn:active {
  transform: scale(0.98);
}

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

/* Progress bar */
.woise-progress {
  width: 100%;
  height: 8px;
  background: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 16px;
}

.woise-progress-bar {
  height: 100%;
  background: var(--woise-brand-color, #b8145b);
  transition: width 0.3s ease;
  border-radius: 10px;
}

/* Trust signals */
.woise-trust-signals {
  font-size: 13px;
  color: #6b7280;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  line-height: 1.6;
}

.woise-trust-signals div {
  margin-bottom: 8px;
}

/* Loading state */
.woise-loading {
  text-align: center;
  padding: 20px;
}

.woise-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--woise-brand-color, #b8145b);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: woiseSpin 1s linear infinite;
  margin: 0 auto 12px;
}

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

/* Success/Error messages */
.woise-alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.5;
}

.woise-alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.woise-alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Powered by Woise badge */
.woise-powered-by {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 24px;
}

.woise-powered-by a {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.woise-powered-by a:hover {
  color: var(--woise-brand-color, #b8145b);
}

/* Mobile responsive */
@media (max-width: 640px) {
  #woise-widget-content {
    width: 95%;
    padding: 20px;
    max-height: 85vh;
  }

  #woise-widget-button {
    width: 52px;
    height: 52px;
    font-size: 20px;
    bottom: 16px;
    right: 16px;
  }

  #woise-widget-button.position-bottom-left {
    left: 16px;
  }

  #woise-widget-button.position-top-right {
    top: 16px;
  }

  #woise-widget-button.position-top-left {
    top: 16px;
    left: 16px;
  }

  .woise-header h3 {
    font-size: 20px;
  }

  .woise-header p {
    font-size: 14px;
  }

  .woise-btn {
    padding: 12px 20px;
    font-size: 14px;
    /* Ensure touch targets are at least 44px */
    min-height: 44px;
  }

  .woise-input,
  .woise-textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* Recording indicator mobile adjustments */
  #woise-recording-indicator {
    max-width: 280px;
    min-width: 240px;
    top: 16px;
    right: 16px;
    font-size: 14px;
  }

  #woise-recording-indicator.minimized {
    min-width: auto;
  }

  /* Make sure video previews fit on mobile */
  video {
    max-height: 40vh;
  }

  /* Close button larger touch target */
  #woise-close-btn {
    width: 44px;
    height: 44px;
    font-size: 32px;
  }

  /* Screenshot preview on mobile */
  .woise-screenshot-preview {
    max-width: 160px !important;
    bottom: 80px !important;
  }
}
