/* Floating Action Button (FAB) & Popover Panel CSS */
.fab-container {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* FAB Button */
.fab-btn {
  height: 54px;
  width: 54px;
  border-radius: 27px;
  background-color: var(--accent);
  border: none;
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none; /* Handled by custom cursor */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease;
  overflow: hidden;
  padding: 0;
  outline: none;
}

.fab-btn.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.fab-monogram {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 1;
  flex-shrink: 0;
  margin-top: -1px;
}

.fab-text {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease,
              margin-left 0.4s ease;
  margin-top: 1px;
}

/* Hover Expanding Interaction */
.fab-btn:hover {
  width: 146px;
  box-shadow: 0 8px 30px rgba(199, 242, 62, 0.3);
}

.fab-btn:hover .fab-text {
  max-width: 80px;
  opacity: 1;
  margin-left: 10px;
}

/* Popover Panel styling */
.fab-popover {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 320px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(15px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: right bottom;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fab-popover.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popover-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.popover-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: none;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  outline: none;
}

.popover-close-btn:hover {
  color: var(--text-primary);
}

.popover-subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Form container inside Popover */
.popover-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.popover-input-wrapper {
  padding: 8px 12px;
  border-radius: 8px;
}

.popover-input-wrapper input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  width: 100%;
}

.popover-input-wrapper textarea {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  width: 100%;
  resize: none;
  line-height: 1.5;
}

.popover-submit-btn {
  width: 100%;
  justify-content: center;
  font-weight: bold;
  padding: 12px 20px;
  border-radius: 8px;
  margin-top: 4px;
}

/* Status overlays inside Popover (Analyzing/Success) */
.popover-status {
  display: none;
  position: absolute;
  inset: 0;
  background-color: var(--bg-panel);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
  animation: popover-fade-in 0.3s ease-out forwards;
}

.popover-status.visible {
  display: flex;
}

.popover-status .status-icon {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 12px;
}

.popover-status .status-msg {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  max-width: 200px;
}

@keyframes popover-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile Adaptive Layout */
@media (max-width: 576px) {
  .fab-container {
    bottom: 24px;
    right: 24px;
  }
  
  .fab-popover {
    bottom: 64px;
    right: 0;
    width: calc(100vw - 48px);
    max-width: 320px;
  }
}
