/*
===============================================================================
  GENESIS CAMERA CHAT - Chat flutuante durante câmera em fullscreen
===============================================================================
  Painel espelhado do chat principal, posicionado no canto direito.
  Ativa junto com body.camera-maximized.
  Classes isoladas com prefixo .gcc-*
*/

.gcc-chat{
  position: fixed;
  top: 80px;
  right: 20px;
  width: 380px;
  height: 520px;
  min-width: 300px;
  min-height: 380px;
  max-width: 92vw;
  max-height: 92vh;
  background: linear-gradient(180deg, rgba(0, 10, 25, 0.92), rgba(0, 20, 45, 0.88));
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 12px;
  color: #e0f7ff;
  font-family: 'Orbitron', 'Rajdhani', Arial, sans-serif;
  z-index: 210;
  opacity: 0.75;                     /* 25% transparente (igual ao GVA) */
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 14px 50px rgba(0, 240, 255, 0.35),
              0 0 0 1px rgba(0, 240, 255, 0.25);
  display: flex;
  flex-direction: column;
  transition: opacity .25s, box-shadow .25s;
  animation: gccEntry .35s cubic-bezier(.4, 0, .2, 1);
  resize: both;                      /* Redimensionável (handle no canto inferior direito) */
  overflow: hidden;                  /* Necessário para resize funcionar */
}
.gcc-chat:hover{ opacity: 0.98; }
@keyframes gccEntry{
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to   { opacity: 0.75; transform: translateY(0) scale(1); }
}
.gcc-chat.gcc-minimized .gcc-body,
.gcc-chat.gcc-minimized .gcc-input-bar{ display: none; }

/* Header - arrastável */
.gcc-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(0, 240, 255, .15), rgba(0, 240, 255, .06));
  border-bottom: 1px solid rgba(0, 240, 255, .35);
  cursor: move;
  user-select: none;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
  position: relative;
  z-index: 3;                /* acima da esfera */
}
.gcc-title{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2.5px;
  color: #00f0ff;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.7);
}
.gcc-dot{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #0f8;
  box-shadow: 0 0 6px #0f8;
  animation: gccPulse 1.5s infinite;
}
@keyframes gccPulse{
  50% { opacity: .5; transform: scale(1.2); }
}
.gcc-actions{ display: flex; gap: 4px; }
.gcc-btn-icon{
  width: 22px; height: 22px;
  background: transparent;
  border: 1px solid rgba(0, 240, 255, .4);
  color: #00f0ff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  transition: .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gcc-btn-icon:hover{ background: rgba(0, 240, 255, .2); box-shadow: 0 0 8px #00f0ff; }
.gcc-btn-icon.gcc-close:hover{ background: rgba(255,0,85,.3); border-color: #f05; color: #fff; }

/* Canvas da mini esfera - preenche toda a área entre header e input bar
   (igual à tela principal: ocupa o fundo e as mensagens flutuam sobre) */
.gcc-sphere-canvas{
  position: absolute;
  top: 44px;                /* abaixo do header (~44px) */
  left: 0;
  right: 0;
  bottom: 56px;             /* acima da input bar (~56px) */
  pointer-events: none;
  z-index: 0;
  display: block;
  background: transparent;
}

/* Body - lista de mensagens */
.gcc-body{
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 2;           /* mensagens acima da esfera */
  /* Máscara para fade superior (efeito cinematográfico como no chat principal) */
  mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.gcc-body::-webkit-scrollbar{ width: 4px; }
.gcc-body::-webkit-scrollbar-thumb{ background: rgba(0, 240, 255, .35); border-radius: 2px; }

/* Mensagens (espelho das do chat principal) */
.gcc-msg{
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
  width: fit-content;
  animation: gccMsgIn .3s;
}
@keyframes gccMsgIn{
  from { opacity: 0; transform: translateY(6px); }
}
.gcc-msg.gcc-msg-user{
  align-self: flex-end;
  background: rgba(255, 0, 255, .18);
  border: 1px solid rgba(255, 0, 255, .55);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.gcc-msg.gcc-msg-ai{
  align-self: flex-start;
  background: rgba(0, 240, 255, .12);
  border: 1px solid rgba(0, 240, 255, .55);
  color: #e0f7ff;
  border-bottom-left-radius: 3px;
}
.gcc-msg.gcc-msg-system{
  align-self: center;
  background: rgba(255, 170, 0, .12);
  border: 1px solid rgba(255, 170, 0, .45);
  color: #fd8;
  font-family: 'Orbitron';
  font-size: 10px;
  letter-spacing: 1.5px;
  max-width: 95%;
  text-align: center;
}

/* Barra de entrada */
.gcc-input-bar{
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 240, 255, .2);
  flex-shrink: 0;
  position: relative;
  z-index: 3;                /* acima da esfera */
  background: rgba(0, 10, 25, 0.45);  /* leve opacidade para legibilidade */
  backdrop-filter: blur(10px);
}
.gcc-input{
  flex: 1;
  padding: 9px 14px;
  background: rgba(0, 20, 40, .6);
  border: 1px solid rgba(0, 240, 255, .4);
  color: #00f0ff;
  border-radius: 20px;
  font-family: 'Rajdhani';
  font-size: 13px;
  outline: none;
  letter-spacing: .5px;
}
.gcc-input:focus{
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, .35);
}
.gcc-input::placeholder{
  color: rgba(0, 240, 255, .45);
  font-size: 12px;
}
.gcc-btn-send,
.gcc-btn-mic{
  width: 36px;
  height: 36px;
  background: rgba(0, 240, 255, .22);
  border: 1px solid rgba(0, 240, 255, .55);
  color: #00f0ff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: .2s;
  flex-shrink: 0;
}
.gcc-btn-send:hover,
.gcc-btn-mic:hover{
  background: rgba(0, 240, 255, .38);
  box-shadow: 0 0 10px #00f0ff;
  color: #fff;
}
.gcc-btn-mic.gcc-on{
  background: rgba(255, 0, 85, .4);
  border-color: #f05;
  color: #fff;
  animation: gccMicPulse 1s infinite;
}
@keyframes gccMicPulse{
  50% { box-shadow: 0 0 18px #f05; }
}

/* Estado vazio */
.gcc-empty{
  text-align: center;
  color: rgba(0, 240, 255, .4);
  font-family: 'Orbitron';
  font-size: 10px;
  letter-spacing: 2px;
  padding: 40px 10px;
  line-height: 1.6;
  align-self: center;
}


/* ==========================================================================
   TEMA CLARO
   ========================================================================== */
body.light-theme .gcc-chat{
  background: linear-gradient(180deg, rgba(238, 242, 246, 0.97), rgba(221, 228, 235, 0.94));
  border-color: rgba(0, 136, 200, 0.45);
  color: #18222f;
  box-shadow: 0 14px 50px rgba(0, 136, 200, 0.3),
              0 0 0 1px rgba(0, 136, 200, 0.2);
}
body.light-theme .gcc-title{ color: #004870; }
body.light-theme .gcc-header{
  background: linear-gradient(180deg, rgba(0, 168, 222, .12), rgba(0, 136, 200, .06));
  border-bottom-color: rgba(0, 136, 200, .3);
}
body.light-theme .gcc-msg.gcc-msg-user{
  background: #ffffff;
  border-color: rgba(0, 168, 222, .5);
  color: #18222f;
}
body.light-theme .gcc-msg.gcc-msg-ai{
  background: #e8f4fc;
  border-color: rgba(0, 168, 222, .5);
  color: #18222f;
}
body.light-theme .gcc-input{
  background: #ffffff;
  color: #18222f;
  border-color: rgba(0, 168, 222, .4);
}
body.light-theme .gcc-input::placeholder{ color: rgba(0, 100, 140, .45); }
body.light-theme .gcc-empty{ color: rgba(0, 100, 140, .5); }


/* Botão "IA" no header da câmera (toggle do chat flutuante) */
.gct-btn.gcc-ia-btn.gcc-ia-active{
  background: rgba(0, 240, 255, .35);
  border-color: #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, .6);
  animation: gccIaPulse 1.5s infinite;
}
@keyframes gccIaPulse{
  50% { box-shadow: 0 0 18px rgba(0, 240, 255, .9); }
}
