/* ============================================================================
   EXAMON — PREMIUM IN-APP BUG REPORT STYLESHEET
   Desain modern, bersih, bebas emoji (pure SVG/FontAwesome), responsif mobile.
   ============================================================================ */

/* --- 1. FLOATING ACTION BUTTON (FAB) --- */
.examon-bug-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.45),
              0 8px 10px -6px rgba(79, 70, 229, 0.25);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
}

/* Animasi pulse / breathing glow */
.examon-bug-fab::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, transparent 70%);
  opacity: 0.6;
  z-index: -1;
  animation: fabPulseGlow 3s ease-in-out infinite;
}

@keyframes fabPulseGlow {
  0%, 100% { transform: scale(0.92); opacity: 0.4; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

/* Animasi wiggle / tilt lembut pada ikon */
.examon-bug-fab .fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  animation: fabIconWiggle 4s ease-in-out infinite;
}

@keyframes fabIconWiggle {
  0%, 80%, 100% { transform: rotate(0deg); }
  85% { transform: rotate(-12deg); }
  90% { transform: rotate(10deg); }
  95% { transform: rotate(-6deg); }
}

.examon-bug-fab:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 14px 28px -4px rgba(79, 70, 229, 0.6),
              0 10px 12px -6px rgba(79, 70, 229, 0.35);
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.examon-bug-fab:active {
  transform: translateY(1px) scale(0.96);
}

/* Offset khusus tampilan mobile dengan bottom navigation (admin) */
.examon-bug-fab.fab-offset-bottom {
  bottom: 84px;
}

@media (max-width: 640px) {
  .examon-bug-fab {
    width: 44px;
    height: 44px;
    padding: 0;
    bottom: 20px;
    right: 18px;
  }
  .examon-bug-fab .fab-icon {
    font-size: 18px;
  }
  .examon-bug-fab.fab-offset-bottom {
    bottom: 78px;
  }
}

/* --- 2. MODAL BACKDROP & CONTAINER --- */
.examon-bug-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow-y: auto;
}

.examon-bug-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Card */
.examon-bug-modal {
  position: relative;
  width: 100%;
  max-width: 490px;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25),
              0 0 0 1px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.examon-bug-backdrop.is-open .examon-bug-modal {
  transform: scale(1) translateY(0);
}

/* --- 3. MODAL HEADER --- */
.examon-bug-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  background: #fafafa;
}

.examon-bug-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.examon-bug-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.examon-bug-title {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  margin: 0;
}

.examon-bug-subtitle {
  font-size: 12.5px;
  color: #64748b;
  margin: 3px 0 0;
  font-weight: 500;
}

.examon-bug-close-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.examon-bug-close-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

/* --- 4. MODAL BODY (FORM) --- */
.examon-bug-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Custom Scrollbar for Modal Body */
.examon-bug-body::-webkit-scrollbar {
  width: 6px;
}
.examon-bug-body::-webkit-scrollbar-track {
  background: #f8fafc;
}
.examon-bug-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

.examon-bug-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.examon-bug-label {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  text-transform: capitalize;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.examon-bug-label .char-counter {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
}

/* Input Fields */
.examon-bug-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.examon-bug-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}

.examon-bug-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  font-size: 13.5px;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.examon-bug-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.examon-bug-textarea {
  width: 100%;
  min-height: 84px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
}

.examon-bug-textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* --- 5. CHIP SELECTORS (BUG TYPE & PRIORITY) --- */
.examon-bug-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.examon-bug-chip {
  flex: 1;
  min-width: 90px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-align: center;
}

.examon-bug-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

.examon-bug-chip.is-selected {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4338ca;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.examon-bug-chip.is-selected i {
  color: #ffffff;
}

/* Priority Chips */
.examon-bug-priority-chip {
  flex: 1;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

/* Pure CSS Dot Indicator (Bebas Emoji) */
.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  display: inline-block;
}

/* Low (Hijau) */
.priority-chip-low {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.priority-chip-low .priority-dot { background: #22c55e; }
.priority-chip-low.is-selected {
  background: #22c55e;
  border-color: #16a34a;
  color: #ffffff;
}
.priority-chip-low.is-selected .priority-dot { background: #ffffff; }

/* Medium (Kuning) */
.priority-chip-med {
  background: #fefce8;
  border: 1px solid #fef08a;
  color: #854d0e;
}
.priority-chip-med .priority-dot { background: #eab308; }
.priority-chip-med.is-selected {
  background: #eab308;
  border-color: #ca8a04;
  color: #ffffff;
}
.priority-chip-med.is-selected .priority-dot { background: #ffffff; }

/* High (Merah) */
.priority-chip-high {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.priority-chip-high .priority-dot { background: #ef4444; }
.priority-chip-high.is-selected {
  background: #ef4444;
  border-color: #dc2626;
  color: #ffffff;
}
.priority-chip-high.is-selected .priority-dot { background: #ffffff; }

/* --- 6. ENVIRONMENT / DEVICE INFO (AUTO-DETECTED) --- */
.examon-bug-device-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 12.5px;
  color: #334155;
  font-weight: 500;
}

.examon-bug-device-box i {
  color: #64748b;
  font-size: 15px;
}

.examon-bug-device-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- 7. ATTACH SCREENSHOT DROPZONE --- */
.examon-bug-dropzone {
  position: relative;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.examon-bug-dropzone:hover,
.examon-bug-dropzone.is-dragover {
  border-color: #6366f1;
  background: #f5f3ff;
}

.examon-bug-dropzone-icon {
  font-size: 22px;
  color: #6366f1;
}

.examon-bug-dropzone-title {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin: 0;
}

.examon-bug-dropzone-desc {
  font-size: 11px;
  color: #64748b;
  margin: 0;
}

/* Screenshot Preview */
.examon-bug-preview-wrap {
  position: relative;
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #0f172a;
  max-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.examon-bug-preview-img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  display: block;
}

.examon-bug-remove-img {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}

.examon-bug-remove-img:hover {
  background: #ef4444;
}

/* --- 8. SUBMIT BUTTON --- */
.examon-bug-submit-btn {
  width: 100%;
  padding: 13px 20px;
  margin-top: 6px;
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.examon-bug-submit-btn:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
  transform: translateY(-1px);
}

.examon-bug-submit-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.examon-bug-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Spinner Loading */
.examon-bug-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 9999px;
  animation: bugSpin 0.7s linear infinite;
  display: inline-block;
}

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

/* Status Alert */
.examon-bug-status-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.examon-bug-status-alert.is-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.examon-bug-status-alert.is-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
