/* announcements.css
 *
 * Composer and post styles for the Announcements column on the Nexus home
 * page. Lifted verbatim out of the inline <style> in index.html when the
 * Company Feed was replaced by the activity feed -- behaviour and appearance
 * are unchanged.
 *
 * The .feed-tabs / .feed-tab rules did NOT come with them: those styled the
 * Wins/Ops/HR/Brand/Urgent strip, which was never wired up and is not being
 * revived. Neither did .confirm-* -- js/dialog.js injects its own.
 */

/* ---- Feed Section ---- */
.feed-section {
  margin-top: 0.5rem;
}

.feed-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 1rem;
}

/* Composer */
.composer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}

.composer-textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-input);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer-textarea:focus {
  border-color: var(--border-input-focus);
  box-shadow: 0 0 0 3px rgba(107,184,232,0.15);
}

.composer-textarea::placeholder {
  color: var(--text-muted);
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  gap: 0.5rem;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.composer-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.composer-action-btn:hover {
  background: var(--bg-hover);
  color: var(--blue);
}

.composer-action-btn.active {
  background: var(--blue-light);
  color: var(--blue-dark);
}

[data-theme="dark"] .composer-action-btn.active {
  background: rgba(107,184,232,0.15);
  color: var(--blue);
}

.composer-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(107,184,232,0.3);
  transition: all 0.15s ease;
}

.composer-submit:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107,184,232,0.3);
}

.composer-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Attachment previews */
.composer-attachment {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.composer-attachment.visible {
  display: flex;
}

.composer-attachment-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.composer-attachment-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.15s ease;
}

.composer-attachment-remove:hover {
  background: rgba(239,68,68,0.1);
  color: var(--red);
}

/* Video URL input */
.composer-video-input {
  margin-top: 0.75rem;
  display: none;
}

.composer-video-input.visible {
  display: block;
}

.composer-video-input input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border-input);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer-video-input input:focus {
  border-color: var(--border-input-focus);
  box-shadow: 0 0 0 3px rgba(107,184,232,0.15);
}

.composer-video-input input::placeholder {
  color: var(--text-muted);
}

.composer-error {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 0.5rem;
  min-height: 1em;
}

/* ---- Feed Posts ---- */
.feed-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease;
}

.feed-post:hover {
  box-shadow: var(--shadow-md);
}

.feed-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.feed-post-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.feed-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.feed-post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-post-meta {
  display: flex;
  flex-direction: column;
}

.feed-post-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.2;
}

.feed-post-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.feed-post-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0;
}

.feed-post:hover .feed-post-delete {
  opacity: 1;
}

.feed-post-delete:hover {
  background: rgba(239,68,68,0.1);
  color: var(--red);
}

.feed-post-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.feed-post-media {
  margin-top: 0.85rem;
  border-radius: 10px;
  overflow: hidden;
}

.feed-post-media img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

.feed-post-media iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 10px;
}

/* ---- Feed States ---- */
.feed-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.feed-empty svg {
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.feed-load-more {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.feed-load-more button {
  padding: 0.55rem 1.5rem;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.feed-load-more button:hover {
  border-color: var(--blue);
  color: var(--text);
  background: var(--bg-hover);
}

.feed-load-more button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.feed-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---- Post actions (pin/delete) ---- */
.feed-post-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.feed-post-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}
.feed-post-action-btn:hover { color: var(--blue); background: rgba(107,184,232,0.1); }
.feed-post-action-btn.pinned { color: var(--blue); }
.feed-post-delete:hover { color: var(--red); background: rgba(239,68,68,0.1); }

.pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* Topic / category pill shown on a post header (next to author/time)
   and in the composer's category selector. Colours map to the same
   five tabs above the feed: wins / ops / hr / brand / urgent. */
.feed-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
  flex-shrink: 0;
}
.feed-cat-pill[data-cat="wins"]   { background: rgba(34,197,94,0.14);  color: #047857; }
.feed-cat-pill[data-cat="ops"]    { background: rgba(107,184,232,0.16); color: #1d6fa5; }
.feed-cat-pill[data-cat="hr"]     { background: rgba(168,85,247,0.14); color: #7c3aed; }
.feed-cat-pill[data-cat="brand"]  { background: rgba(236,72,153,0.14); color: #be185d; }
.feed-cat-pill[data-cat="urgent"] { background: rgba(239,68,68,0.14);  color: #b91c1c; }
[data-theme="dark"] .feed-cat-pill[data-cat="wins"]   { color: #4ade80; }
[data-theme="dark"] .feed-cat-pill[data-cat="ops"]    { color: #7dc4ee; }
[data-theme="dark"] .feed-cat-pill[data-cat="hr"]     { color: #c4a8fb; }
[data-theme="dark"] .feed-cat-pill[data-cat="brand"]  { color: #f9a8d4; }
[data-theme="dark"] .feed-cat-pill[data-cat="urgent"] { color: #fca5a5; }

/* Composer category selector — native <select> styled to match the
   composer's other controls. `appearance: none` strips the OS chevron
   so we can paint our own (Lucide chevron-down as an inline SVG
   data-URL) and unify the typography with the rest of the composer. */
.composer-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.composer-cat select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8a99' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 1.7rem 0.4rem 0.7rem;
  font-family: inherit;
  font-size: inherit;   /* match the "Topic" label exactly (0.78rem) */
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-heading);
  cursor: pointer;
  line-height: 1.2;
  transition: border-color 0.12s, background-color 0.12s;
}
.composer-cat select:hover { border-color: var(--text-muted); }
.composer-cat select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(107,184,232,0.18);
}
.composer-cat select option {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 500;
  color: var(--text-heading);
  background: var(--bg-card);
}

/* ---- Mobile ----
   Moved here with the rest of the composer styles; these were the last
   announcements rules left behind in index.html's inline <style>. */
@media (max-width: 640px) {
  .composer { padding: 0.85rem; }
  .feed-post { padding: 0.85rem; }
  /* Hover-to-reveal does not exist on touch, so the delete button stays put. */
  .feed-post-delete { opacity: 1; }
}
