/* === BLACK BOX — Encrypted Room Dark Theme === */
/* Selettore su body.blackbox-active — React non tocca <body>,
   quindi nessun rischio di conflitto/loop */

body.blackbox-active .mx_RoomView {
  background: #000000 !important;
}
body.blackbox-active .mx_RoomView .mx_MessageComposer {
  background: #0a0a0a !important;
  border-top: 1px solid #1a1a1a !important;
}
body.blackbox-active .mx_RoomView .mx_RoomHeader {
  background: #050505 !important;
  border-bottom: 1px solid #1a1a1a !important;
}
body.blackbox-active .mx_RoomView .mx_EventTile {
  background: transparent !important;
}
body.blackbox-active .mx_RoomView .mx_EventTile_content {
  color: #e0e0e0 !important;
}
body.blackbox-active .mx_RoomView .mx_ScrollPanel {
  background: #000000 !important;
}

/* Black Box banner — fixed in alto, non occupa spazio nel layout */
#blackbox-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: linear-gradient(90deg, #000000, #0a0a0a);
  border-bottom: 1px solid #f97316;
  padding: 4px 16px;
  font-size: 11px;
  color: #f97316;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
  height: 24px;
  line-height: 24px;
}
body.blackbox-active #blackbox-banner {
  display: block;
}
/* Sposta giu' tutto il contenuto di Element per fare spazio al banner */
body.blackbox-active #matrixchat {
  margin-top: 32px !important;
  height: calc(100% - 32px) !important;
}
#blackbox-banner .lock-icon {
  margin-right: 8px;
}

/* Black Box toggle button — black cube */
#blackbox-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid #333;
  background: #0a0a0a;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
#blackbox-btn .bb-icon {
  transition: opacity 0.3s ease;
}
#blackbox-btn:hover {
  border-color: #f97316;
  color: #f97316;
  background: #050505;
  box-shadow: 0 4px 20px rgba(249,115,22,0.3);
  transform: scale(1.05);
}
body.blackbox-active #blackbox-btn {
  border-color: #f97316;
  background: #000;
  color: #f97316;
  box-shadow: 0 0 25px rgba(249,115,22,0.5);
}
body.blackbox-active #blackbox-btn .bb-icon {
  opacity: 1 !important;
}
#blackbox-btn .tooltip {
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  background: #111;
  border: 1px solid #333;
  color: #ccc;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#blackbox-btn:hover .tooltip {
  opacity: 1;
}
