/* ===================================
   BUG REPORTER STYLES
   Beta Testing Feature
   =================================== */

/* Floating Bug Button */
.bug-reporter-button {
  position: fixed;
  bottom: 90px; /* Above the flash menu (which is at ~30px) */
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
  cursor: pointer;
  z-index: 9998; /* Below modals (10000) but above flash menu (9999) */
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  animation: bug-pulse 2s ease-in-out infinite;
}

.bug-reporter-button:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(255, 68, 68, 0.6);
  background: linear-gradient(135deg, #ff5555 0%, #dd0000 100%);
}

.bug-reporter-button:active {
  transform: scale(0.95);
}

/* Pulse animation for bug button */
@keyframes bug-pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.7);
  }
}

/* Bug Report Modal */
.bug-report-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  animation: fadeIn 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}

.bug-report-modal.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.bug-report-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  position: relative;
  margin: auto;
  transform: translateX(0) translateY(0);
}

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

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

/* Modal Header */
.bug-report-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bug-report-header h2 {
  margin: 0;
  font-size: 24px;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bug-report-header h2 .bug-icon {
  font-size: 28px;
}

.bug-report-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  line-height: 1;
}

.bug-report-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Modal Body */
.bug-report-body {
  padding: 24px;
}

/* Status Messages */
.bug-report-status {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.bug-report-status.capturing {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.bug-report-status.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.bug-report-status.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.bug-report-status i {
  font-size: 18px;
}

/* Screenshot Preview */
.screenshot-preview-container {
  margin-bottom: 20px;
}

.screenshot-preview-container h3 {
  font-size: 16px;
  color: #374151;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.screenshot-preview {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  display: block;
  max-height: 400px;
  object-fit: contain;
  background: #f9fafb;
}

/* Comment Field */
.bug-comment-field {
  margin-bottom: 20px;
}

.bug-comment-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.bug-comment-field textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #1f2937;
  resize: vertical;
  transition: border-color 0.2s;
}

.bug-comment-field textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bug-comment-field textarea::placeholder {
  color: #9ca3af;
}

/* Technical Info */
.bug-technical-info {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.bug-technical-info h3 {
  font-size: 14px;
  color: #374151;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.bug-technical-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.bug-info-item {
  font-size: 13px;
}

.bug-info-item strong {
  color: #6b7280;
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.bug-info-item span {
  color: #1f2937;
  word-break: break-word;
}

/* Console Logs Preview */
.console-logs-preview {
  background: #1f2937;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  max-height: 200px;
  overflow-y: auto;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 12px;
}

.console-logs-preview h3 {
  color: #f3f4f6;
  font-size: 14px;
  margin: 0 0 12px 0;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.console-log-entry {
  padding: 6px 0;
  border-bottom: 1px solid #374151;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.console-log-entry:last-child {
  border-bottom: none;
}

.console-log-timestamp {
  color: #9ca3af;
  flex-shrink: 0;
}

.console-log-type {
  flex-shrink: 0;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
}

.console-log-type.log { color: #60a5fa; }
.console-log-type.warn { color: #fbbf24; }
.console-log-type.error { color: #f87171; }
.console-log-type.info { color: #34d399; }

.console-log-message {
  color: #e5e7eb;
  flex: 1;
  word-break: break-word;
}

.console-logs-count {
  color: #9ca3af;
  font-size: 12px;
  margin-top: 8px;
  text-align: right;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Modal Footer */
.bug-report-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.bug-report-footer button {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.bug-report-cancel {
  background: #f3f4f6;
  color: #374151;
}

.bug-report-cancel:hover {
  background: #e5e7eb;
}

.bug-report-submit {
  background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bug-report-submit:hover {
  background: linear-gradient(135deg, #ff5555 0%, #dd0000 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

.bug-report-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Loading Spinner */
.bug-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
  .bug-reporter-button {
    bottom: 80px;
    right: 16px;
    width: 50px;
    height: 50px;
    font-size: 22px;
  }

  .bug-report-content {
    width: 95%;
    max-height: 95vh;
    border-radius: 12px;
  }

  .bug-report-header {
    padding: 20px 16px 12px;
  }

  .bug-report-header h2 {
    font-size: 20px;
  }

  .bug-report-body {
    padding: 16px;
  }

  .screenshot-preview {
    max-height: 250px;
  }

  .console-logs-preview {
    max-height: 150px;
  }

  .bug-technical-info-grid {
    grid-template-columns: 1fr;
  }

  .bug-report-footer {
    flex-direction: column;
    gap: 8px;
  }

  .bug-report-footer button {
    width: 100%;
  }
}

/* Scrollbar Styling for Console Logs */
.console-logs-preview::-webkit-scrollbar {
  width: 8px;
}

.console-logs-preview::-webkit-scrollbar-track {
  background: #111827;
  border-radius: 4px;
}

.console-logs-preview::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

.console-logs-preview::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}
