/**
 * American Friend: debug panel + step 2 “add friend” disabled state.
 */

/* Step 1 → step 2: dark backdrop + solid centered card (spinner + text) */
html.american-friend-loading-open,
body.american-friend-loading-open {
  overflow: hidden !important;
}

#american-friend-step-transition.american-friend-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.72);
}

#american-friend-step-transition .american-friend-loading-card {
  margin: 0;
  max-width: 320px;
  width: 100%;
  padding: 28px 24px 26px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#american-friend-step-transition .american-friend-loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(206, 43, 51, 0.2);
  border-top-color: #ce2b33;
  border-radius: 50%;
  animation: american-friend-spin 0.75s linear infinite;
  flex-shrink: 0;
}

#american-friend-step-transition .american-friend-loading-text {
  margin: 16px 0 0;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 600;
  color: #1d2327;
}

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

form.elementor-form .addFriend.american-friend-addfriend-disabled {
  pointer-events: none;
  opacity: 0.45;
  cursor: not-allowed;
}

/**
 * American Friend debug panel — same structure & look as
 * hello-theme-child-master2 care_calc_map_sms_buttons_short_b/assets/care-calc.css
 * (.calc-tracker-debug). Scoped to #american-friend-debug so it does not depend on the theme.
 */

#american-friend-debug.calc-tracker-debug {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 400px;
  max-height: 80vh;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 99999;
  overflow: hidden;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#american-friend-debug.calc-tracker-debug.minimized {
  max-height: 50px;
}

#american-friend-debug.calc-tracker-debug .debug-header {
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  cursor: default;
}

#american-friend-debug.calc-tracker-debug .debug-icon {
  font-size: 20px;
  margin-right: 8px;
  flex-shrink: 0;
}

#american-friend-debug.calc-tracker-debug .debug-title {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex: 1;
  min-width: 0;
}

#american-friend-debug.calc-tracker-debug .american-friend-json-copy {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

#american-friend-debug.calc-tracker-debug .american-friend-json-copy:hover {
  background: rgba(255, 255, 255, 0.25);
}

#american-friend-debug.calc-tracker-debug .debug-toggle {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 25px;
  height: 25px;
  line-height: 1;
}

#american-friend-debug.calc-tracker-debug .debug-content {
  max-height: calc(80vh - 50px);
  overflow-y: auto;
  padding: 15px;
  color: #fff;
}

#american-friend-debug.calc-tracker-debug.minimized .debug-content {
  display: none;
}

#american-friend-debug.calc-tracker-debug .debug-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#american-friend-debug.calc-tracker-debug .debug-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

#american-friend-debug.calc-tracker-debug .debug-section h4 {
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 700;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#american-friend-debug.calc-tracker-debug .debug-item {
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 5px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  word-break: break-word;
}

#american-friend-debug.calc-tracker-debug .debug-item strong {
  color: #87ceeb;
  font-weight: 600;
}

#american-friend-debug.calc-tracker-debug .debug-content::-webkit-scrollbar {
  width: 6px;
}

#american-friend-debug.calc-tracker-debug .debug-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

#american-friend-debug.calc-tracker-debug .debug-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#american-friend-debug.calc-tracker-debug .debug-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

@media only screen and (max-width: 768px) {
  #american-friend-debug.calc-tracker-debug {
    width: calc(100% - 40px);
    left: 20px;
    right: 20px;
    bottom: 10px;
    max-height: 60vh;
  }
}
