/* CHATCITO 2026 - SALAS INTEGRADAS */

#cc-salas-list {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #141b27;
  color: #eef3fb;
  border-right: 1px solid #263548;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#cc-salas-list[hidden] {
  display: none !important;
}

.kiwi-container-content.cc-salas-mode {
  align-items: stretch !important;
}

.ccsl-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.ccsl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #f19ac6 0%, #df7db0 100%);
  border-bottom: 1px solid #c96a9a;
}

.ccsl-header-text strong {
  display: block;
  color: #18131c;
  font-size: 20px;
  font-weight: 800;
}

.ccsl-header-text small {
  display: block;
  margin-top: 3px;
  color: #332232;
  font-size: 12px;
}

.ccsl-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ccsl-refresh,
.ccsl-back {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.ccsl-refresh {
  width: 46px;
  height: 46px;
  font-size: 24px;
  background: #4cc09b;
  color: white;
  box-shadow: 0 4px 14px rgba(76,192,155,.25);
}

.ccsl-back {
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  font-size: 18px;
  background: #202938;
  color: #fff;
}

.ccsl-top {
  padding: 16px 18px 8px;
  border-bottom: 1px solid #263548;
  background: #192231;
}

.ccsl-open-title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #f3f6fb;
}

.ccsl-open-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ccsl-open-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #cc78a7;
  border-radius: 999px;
  padding: 9px 14px;
  background: linear-gradient(180deg, #f1a1cb 0%, #df84b4 100%);
  color: #1b1320;
  font-weight: 800;
  cursor: pointer;
  transition: .15s ease;
}

.ccsl-open-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(223,132,180,.25);
}

.ccsl-open-chip.active {
  background: linear-gradient(180deg, #87ec5b 0%, #4fcb43 100%);
  border-color: #49ab37;
  color: #10210d;
}

.ccsl-chip-icon {
  font-size: 18px;
}

.ccsl-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 10px;
  background: #141b27;
}

.ccsl-search {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  border-radius: 12px;
  border: 1px solid #314357;
  background: #1d2938;
  color: #fff;
  padding: 0 14px;
  outline: none;
  font-size: 15px;
}

.ccsl-count {
  flex: 0 0 auto;
  color: #9db3cc;
  font-size: 13px;
  font-weight: 600;
}

.ccsl-status {
  min-height: 20px;
  padding: 0 18px 10px;
  color: #a7bdd5;
  font-size: 13px;
}

.ccsl-list-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 18px;
}

.ccsl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ccsl-room-row {
  display: grid;
  grid-template-columns: 86px minmax(0,1fr) 190px;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #1b2432;
  border: 1px solid #2c3c51;
  border-radius: 14px;
}

.ccsl-room-users {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border-radius: 12px;
  background: #223247;
  color: #dff1ff;
  font-size: 15px;
  font-weight: 700;
}

.ccsl-room-main {
  min-width: 0;
}

.ccsl-room-name {
  margin-bottom: 6px;
  color: #77ead0;
  font-size: 17px;
  font-weight: 800;
}

.ccsl-room-topic {
  font-size: 14px;
  color: #f1f5fb;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ccsl-room-btn {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #56d2a4 0%, #36b884 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(54,184,132,.18);
}

.ccsl-room-btn:hover {
  filter: brightness(1.04);
}

.ccsl-empty {
  color: #93a7be;
  font-size: 13px;
  padding: 6px 0;
}

@media (max-width: 900px) {
  .ccsl-room-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ccsl-room-btn {
    width: 100%;
  }

  .ccsl-room-users {
    justify-content: flex-start;
    padding: 0 12px;
  }
}

@media (max-width: 640px) {
  .ccsl-header {
    padding: 10px 12px;
  }

  .ccsl-top,
  .ccsl-search-row,
  .ccsl-status,
  .ccsl-list-wrap {
    padding-left: 12px;
    padding-right: 12px;
  }

  .ccsl-header-text strong {
    font-size: 17px;
  }

  .ccsl-open-chip {
    padding: 8px 12px;
    font-size: 13px;
  }

  .ccsl-search {
    height: 42px;
    font-size: 14px;
  }

  .ccsl-count {
    display: none;
  }
}

/* ==========================================
   CHATCITO - LISTA DE SALAS COMPACTA V6
   ========================================== */

/* Ocultar los nicks solo mientras se ve SALAS */
body:has(#cc-salas-list:not([hidden]))
.kiwi-nicklist {
  display: none !important;
}

body:has(#cc-salas-list:not([hidden]))
.kiwi-container-content > .kiwi-sidebar-section-nicklist {
  display: none !important;
}

/* Ocultar también la columna completa de nicks */
body:has(#cc-salas-list:not([hidden]))
.kiwi-container-content .kiwi-nicklist-container {
  display: none !important;
}

body:has(#cc-salas-list:not([hidden]))
.kiwi-container-content .kiwi-nicklist-wrapper {
  display: none !important;
}

/* Panel a todo el ancho disponible */
#cc-salas-list {
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: none !important;
  border-right: 0 !important;
}

/* Cabecera más pequeña */
#cc-salas-list .ccsl-header {
  padding: 8px 14px !important;
  min-height: 48px !important;
}

#cc-salas-list .ccsl-header-text strong {
  font-size: 16px !important;
}

#cc-salas-list .ccsl-header-text small {
  display: none !important;
}

#cc-salas-list .ccsl-refresh,
#cc-salas-list .ccsl-back {
  height: 31px !important;
  min-width: 32px !important;
  width: 32px !important;
  padding: 0 !important;
  font-size: 17px !important;
  border-radius: 8px !important;
}

/* Salas abiertas compactas */
#cc-salas-list .ccsl-top {
  padding: 8px 14px !important;
}

#cc-salas-list .ccsl-open-title {
  margin-bottom: 6px !important;
  font-size: 12px !important;
}

#cc-salas-list .ccsl-open-chip {
  padding: 5px 10px !important;
  font-size: 12px !important;
  gap: 5px !important;
  border-radius: 8px !important;
}

#cc-salas-list .ccsl-chip-icon {
  font-size: 15px !important;
}

/* Búsqueda */
#cc-salas-list .ccsl-search-row {
  padding: 8px 14px !important;
}

#cc-salas-list .ccsl-search {
  height: 34px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}

/* Reducir separación de las filas */
#cc-salas-list .ccsl-list-wrap {
  padding: 0 14px 12px !important;
}

#cc-salas-list .ccsl-list {
  gap: 5px !important;
}

/* Filas más compactas */
#cc-salas-list .ccsl-room-row {
  grid-template-columns: 76px minmax(0,1fr) 94px !important;
  gap: 12px !important;
  min-height: 62px !important;
  padding: 8px 11px !important;
  border-radius: 9px !important;
}

/* Usuarios muy visibles en verde */
#cc-salas-list .ccsl-room-users {
  min-height: 35px !important;
  padding: 0 7px !important;
  background: linear-gradient(
    180deg, #86E765, #57CB42
  ) !important;
  border: 1px solid #42B334 !important;
  color: #142914 !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
}

/* Nombre */
#cc-salas-list .ccsl-room-name {
  margin-bottom: 3px !important;
  color: #71D9B2 !important;
  font-size: 14px !important;
}

/* Descripción con colores IRC */
#cc-salas-list .ccsl-room-topic {
  font-size: 12px !important;
  line-height: 1.3 !important;
}

/* Botón entrar */
#cc-salas-list .ccsl-room-btn {
  width: 94px !important;
  height: 34px !important;
  font-size: 12px !important;
  background: linear-gradient(
    180deg, #F2A5CE, #E187B7
  ) !important;
  color: #281724 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

/* Verde ChatCito en acciones */
#cc-salas-list .ccsl-refresh {
  background: #47BF92 !important;
}

#cc-salas-list .ccsl-open-chip.active {
  background: #74D94E !important;
}

/* Móvil */
@media(max-width:700px) {
  #cc-salas-list .ccsl-room-row {
    grid-template-columns: 49px minmax(0,1fr) 60px !important;
    gap: 6px !important;
    padding: 7px !important;
  }

  #cc-salas-list .ccsl-room-users {
    min-height: 30px !important;
    font-size: 11px !important;
    padding: 0 3px !important;
  }

  #cc-salas-list .ccsl-room-name {
    font-size: 12px !important;
  }

  #cc-salas-list .ccsl-room-topic {
    font-size: 11px !important;
  }

  #cc-salas-list .ccsl-room-btn {
    width: 60px !important;
    font-size: 11px !important;
  }
}

/* Quitar el espacio reservado a usuarios en modo SALAS */
body.cc-salas-visible .kiwi-container-content {
  display: flex !important;
}

body.cc-salas-visible .kiwi-container-content > #cc-salas-list {
  flex: 1 1 100% !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* Ocultar el panel lateral de nicks sin modificar otros menús */
body.cc-salas-visible
.kiwi-container-content > :has(.kiwi-nicklist) {
  display: none !important;
}


/* CHATCITO 2026 - LISTADO SIN ELEMENTOS DUPLICADOS */

/* Quitar cabecera rosa interna: Salas, actualizar y cerrar */
#cc-salas-list .ccsl-header {
  display: none !important;
}

/* Quitar "Tus salas abiertas": ya estan arriba en las pestañas */
#cc-salas-list .ccsl-top {
  display: none !important;
}

/* Aprovechar el espacio superior */
#cc-salas-list .ccsl-search-row {
  padding-top: 10px !important;
}

/* Mantener filas normales y botones rosas */
#cc-salas-list .ccsl-room-row {
  grid-template-columns: 76px minmax(0, 1fr) 94px !important;
}

#cc-salas-list .ccsl-room-btn {
  display: block !important;
}

@media (max-width: 700px) {
  #cc-salas-list .ccsl-room-row {
    grid-template-columns: 49px minmax(0, 1fr) 60px !important;
  }
}


/* CC SALAS VISIBILIDAD V1 */

/* La zona de salas se dibuja por delante del fondo decorativo. */
body.cc-salas-visible .kiwi-wrap .kiwi-workspace {
  position: relative !important;
  z-index: 10001 !important;
}

body.cc-salas-visible .kiwi-container-content {
  position: relative !important;
  z-index: 10002 !important;
}

body.cc-salas-visible #cc-salas-list {
  position: relative !important;
  z-index: 10003 !important;
  isolation: isolate;
  background: #141b27 !important;
}
