/* Federation Integration Pack v1 — Styling
   NextXus Federation Aesthetic: Gold (#c9a84c) on Black (#0a0a0a)
   Pre-rendered semantic HTML; accessible; monospace */

/* === GEMINI CHAT WIDGET === */
.fed-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0a0a0a;
  border: 2px solid #c9a84c;
  color: #c9a84c;
  font-size: 24px;
  cursor: pointer;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fed-chat-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(201,168,76,0.5);
}
.fed-chat-trigger svg {
  width: 28px;
  height: 28px;
  fill: #c9a84c;
}

.fed-chat-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 500px;
  max-height: calc(100vh - 120px);
  background: #0a0a0a;
  border: 1px solid #c9a84c;
  border-radius: 8px;
  z-index: 99998;
  display: none;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.8);
  font-family: 'Courier New', monospace;
}
.fed-chat-panel.active {
  display: flex;
}

.fed-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #c9a84c;
  background: #111;
  border-radius: 8px 8px 0 0;
}
.fed-chat-header h3 {
  margin: 0;
  font-size: 14px;
  color: #c9a84c;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}
.fed-chat-close {
  background: none;
  border: none;
  color: #c9a84c;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
}

.fed-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fed-chat-messages::-webkit-scrollbar {
  width: 6px;
}
.fed-chat-messages::-webkit-scrollbar-track {
  background: #0a0a0a;
}
.fed-chat-messages::-webkit-scrollbar-thumb {
  background: #c9a84c;
  border-radius: 3px;
}

.fed-msg {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 85%;
  word-wrap: break-word;
}
.fed-msg.user {
  background: #1a1a1a;
  color: #e0e0e0;
  align-self: flex-end;
  border: 1px solid #333;
}
.fed-msg.assistant {
  background: #111;
  color: #c9a84c;
  align-self: flex-start;
  border: 1px solid #c9a84c33;
}
.fed-msg.system {
  background: transparent;
  color: #666;
  align-self: center;
  font-size: 11px;
  font-style: italic;
}

.fed-chat-input-area {
  display: flex;
  padding: 12px;
  border-top: 1px solid #c9a84c;
  background: #111;
  border-radius: 0 0 8px 8px;
  gap: 8px;
}
.fed-chat-input {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #e0e0e0;
  padding: 10px 12px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.fed-chat-input:focus {
  border-color: #c9a84c;
}
.fed-chat-input::placeholder {
  color: #555;
}
.fed-chat-send {
  background: #c9a84c;
  color: #0a0a0a;
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  transition: background 0.2s;
}
.fed-chat-send:hover {
  background: #dbb85c;
}
.fed-chat-send:disabled {
  background: #555;
  cursor: not-allowed;
}

/* === GOOGLE SIGN-IN === */
.fed-auth-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fed-google-signin {
  background: #0a0a0a;
  border: 1px solid #c9a84c;
  color: #c9a84c;
  padding: 8px 16px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, border-color 0.2s;
}
.fed-google-signin:hover {
  background: #1a1a1a;
  border-color: #dbb85c;
}
.fed-google-signin svg {
  width: 16px;
  height: 16px;
}
.fed-user-welcome {
  color: #c9a84c;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fed-user-welcome .fed-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #c9a84c;
}
.fed-user-signout {
  background: none;
  border: none;
  color: #888;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  font-family: 'Courier New', monospace;
}
.fed-user-signout:hover {
  color: #c9a84c;
}

/* === MEDIA LIBRARY (Throne only) === */
.fed-media-trigger {
  background: #0a0a0a;
  border: 1px solid #c9a84c;
  color: #c9a84c;
  padding: 6px 12px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fed-media-trigger:hover {
  background: #1a1a1a;
}

.fed-media-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  max-width: 90vw;
  height: 500px;
  max-height: 80vh;
  background: #0a0a0a;
  border: 1px solid #c9a84c;
  border-radius: 8px;
  z-index: 100000;
  display: none;
  flex-direction: column;
  box-shadow: 0 16px 64px rgba(0,0,0,0.9);
}
.fed-media-panel.active {
  display: flex;
}

.fed-media-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99999;
  display: none;
}
.fed-media-overlay.active {
  display: block;
}

.fed-media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #c9a84c;
  background: #111;
  border-radius: 8px 8px 0 0;
}
.fed-media-header h3 {
  margin: 0;
  color: #c9a84c;
  font-size: 14px;
  font-family: 'Courier New', monospace;
}
.fed-media-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  align-content: start;
}
.fed-media-item {
  background: #111;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 8px;
  text-align: center;
  font-size: 11px;
  color: #aaa;
  cursor: pointer;
  transition: border-color 0.2s;
}
.fed-media-item:hover {
  border-color: #c9a84c;
}
.fed-media-item img {
  max-width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 6px;
}
.fed-media-upload {
  border: 2px dashed #333;
  border-radius: 4px;
  padding: 24px;
  text-align: center;
  color: #666;
  cursor: pointer;
  grid-column: 1 / -1;
  transition: border-color 0.2s;
}
.fed-media-upload:hover {
  border-color: #c9a84c;
  color: #c9a84c;
}

/* === LOADING ANIMATION === */
.fed-typing {
  display: inline-flex;
  gap: 4px;
  padding: 8px 12px;
}
.fed-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9a84c;
  animation: fedBounce 1.2s infinite;
}
.fed-typing span:nth-child(2) { animation-delay: 0.2s; }
.fed-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes fedBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-8px); opacity: 1; }
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .fed-chat-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 80px;
    height: calc(100vh - 100px);
  }
  .fed-chat-trigger {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
}
