/* Chips and category visuals */
.chip {
  padding: 4px 10px;
  border-radius: 20px;
  border: 2px solid #ddd;
  background: white;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chip:hover {
  border-color: #999;
}

.chip.active {
  border-color: #2D81FF;
  background: #2D81FF;
  color: white;
}

/* Category Colors (CSS variables used in posts) */
.cat-personal { --cat-color: #FF6B6B; }
.cat-comercial { --cat-color: #4ECDC4; }
.cat-noticias { --cat-color: #FFE66D; }
.cat-grupox { --cat-color: #95E1D3; }
.cat-eventos { --cat-color: #F38181; }

/* Composer form & media previews */
.composer-form { display: flex; flex-direction: column; gap: 16px; }

/* NUEVO: layout tipo Facebook para el encabezado del publicador */
.composer-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2D81FF;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.composer-header-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.composer-user-name {
  font-size: 14px;
  font-weight: 600;
}

.composer-privacy-select {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #ddd;
  font-size: 12px;
  background: #f5f5f5;
}

/* Área principal de texto tipo Facebook */
.composer-body-wrapper {
  margin-top: 8px;
}

.composer-body-input {
  width: 100%;
  border: none;
  resize: vertical;
  min-height: 100px;
  font-family: 'Noto Sans', sans-serif;
  font-size: 16px;
  padding: 8px 0;
  outline: none;
}

.composer-body-input::placeholder {
  color: #777;
}

/* Campo de título opcional */
.composer-title-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 13px;
}

/* Sección de categorías (horizontal y más grande) */
.composer-category-section {
  margin-top: 8px;
}

.composer-category-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #555;
}

.composer-category-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-option {
  width: 90px;
  height: 70px;
  border-radius: 10px;
  border: 2px solid #ddd;
  background: #f9f9f9;
  cursor: pointer;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  font-size:22px;
  transition: all 0.2s ease;
}

.category-option .category-icon {
  font-size: 24px;
  line-height: 1;
}

.category-option .category-text {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
}

.category-option.selected {
  border-color: #2D81FF;
  background: #E8F0FF;
}

/* Zona de media al estilo fila de "Agregar a tu publicación" de Facebook */
.composer-media-section {
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  padding: 10px 12px;
}

.composer-media-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.composer-media-title {
  font-size: 13px;
  font-weight: 600;
}

.media-drop-zone { border: 2px dashed #ddd; border-radius: 8px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s ease; background: #f9f9f9; }
.media-drop-zone.active { border-color: #2D81FF; background: #E8F0FF; }

/* NUEVO: textos dentro de la zona de media */
.media-drop-zone .media-drop-main {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.media-drop-zone .media-drop-sub {
  display: block;
  font-size: 12px;
  color: #777;
}

.media-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.media-preview { position: relative; width: 90px; height: 90px; }
.media-preview img, .media-preview video { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.media-remove { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: #FF6B6B; color: white; border: none; cursor: pointer; display:flex; align-items:center; justify-content:center; font-size:16px; }

/* Botón de publicar ancho completo */
.composer-submit-btn {
  width: 100%;
  margin-top: 10px;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
}

/* Buttons */
.btn-primary {
  padding: 12px 20px;
  background: #2D81FF;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-primary:hover {
  background: #1E5ECC;
}

.btn-primary:active {
  transform: scale(0.98);
}