/* Utilities - Helper classes, animations, and special effects */

/* Global scrollbar styling — thin, subtle */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Ensure chat/event containers never create their own scroll areas */
#messages,
#event-output,
#coach-area,
#event-area,
#workbench-output {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

/* Breathing room between last response and composer */
#messages,
#event-output,
#workbench-output {
  margin-bottom: 0;
}

/* Mini modal for quick interactions */
.mini-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.mini-modal .box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.mini-modal h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.mini-modal select {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  margin-bottom: 12px;
}

.mini-modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.mini-modal .actions button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background: #f6f8fa;
  cursor: pointer;
}

.mini-modal .actions button[data-act="ok"] {
  background: #0ea5e9;
  color: #fff;
  border-color: #0ea5e9;
}

/* Inbox list rows */
#shared-inbox .inbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

#shared-inbox .inbox-row .info {
  flex: 1;
  min-width: 0;
}

#shared-inbox .inbox-row .t {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shared-inbox .inbox-row .l {
  color: #6b7280;
  font-size: 12px;
}

#shared-inbox .inbox-row .actions {
  display: flex;
  gap: 6px;
}

#shared-inbox .inbox-row .actions button {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #d0d7de;
  background: #f6f8fa;
  cursor: pointer;
}

/* Animation Keyframes */
@keyframes agp-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Typing indicator */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
}

.typing::after {
  content: "⋯";
  animation: typing 1.5s infinite;
}

@keyframes typing {
  0%,
  20% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
  60% {
    opacity: 0.2;
  }
  80%,
  100% {
    opacity: 0.2;
  }
}

/* Disabled states */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
