/* ===========================================================================
   Journal cards - shared styles for the player journal feed and the DM
   admin journal tab. Bootstrap 3 + NobleUI utilities are already loaded by
   the host layout; this file only adds the card layout, badges, image
   grid, response thread, and the tagging composer affordances.
   ========================================================================*/

.journal-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journal-month-header {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 24px 0 8px 0;
  padding: 6px 10px;
  background: rgba(20, 20, 20, 0.85);
  color: #f1f1f1;
  border-left: 3px solid #c9a96e;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85em;
}

.journal-card {
  position: relative;
  background: #1c1c1c;
  color: #ddd;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #5a8dee;
  border-radius: 6px;
  padding: 14px 16px 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: border-left-color 0.2s ease, box-shadow 0.2s ease;
}
.journal-card:target {
  box-shadow: 0 0 0 2px #c9a96e, 0 1px 3px rgba(0, 0, 0, 0.25);
}
.journal-card.journal-card-attention {
  border-left-color: #e8a13c;
}

/* The admin tab lives inside the slate Bootstrap 3 chrome; tune the card
   to sit cleanly against #272b30 instead of pure black, and pick up the
   text colour the rest of the admin shell uses. */
#journal.tab-pane .journal-card {
  background: #2e3338;
  color: #c8c8c8;
  border: 1px solid #1c1e22;
  border-left: 3px solid #5a8dee;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
#journal.tab-pane .journal-card.journal-card-attention {
  border-left-color: #e8a13c;
}
#journal.tab-pane .journal-month-header {
  background: #1c1e22;
  color: #c8c8c8;
}
#journal.tab-pane .journal-card-time {
  color: #f0ad4e;
}
#journal.tab-pane .journal-card-toggle {
  color: #8ab0ff;
  border-color: #4a5763;
  background: rgba(255, 255, 255, 0.03);
}
#journal.tab-pane .journal-card-thread {
  background: rgba(199, 155, 255, 0.08);
  border-left-color: #c79bff;
}
#journal.tab-pane .journal-respond-form textarea {
  background: #1c1e22;
  color: #c8c8c8;
  border-color: #1c1e22;
}
#journal.tab-pane .journal-toolbar input[type="search"] {
  background: #1c1e22;
  color: #c8c8c8;
  border-color: #1c1e22;
}
#journal.tab-pane .journal-tag-controls {
  background: rgba(232, 161, 60, 0.08);
  border-color: rgba(232, 161, 60, 0.3);
}

.journal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.journal-card-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.journal-card-time {
  font-weight: 600;
  color: #c9a96e;
}
.journal-card-date {
  font-size: 0.82em;
  opacity: 0.65;
}

.journal-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.journal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(90, 141, 238, 0.15);
  color: #8ab0ff;
  font-size: 0.78em;
  font-weight: 600;
}
.journal-badge-attention {
  background: rgba(232, 161, 60, 0.18);
  color: #e8a13c;
}
.journal-badge-images { color: #8fd19e; background: rgba(143, 209, 158, 0.15); }
.journal-badge-responses { color: #c79bff; background: rgba(199, 155, 255, 0.15); }

.journal-card-anchor {
  color: inherit;
  opacity: 0.5;
  text-decoration: none;
  padding: 2px 4px;
}
.journal-card-anchor:hover { opacity: 1; }

.journal-card-body {
  position: relative;
}
.journal-card-body .md-content {
  line-height: 1.55;
  word-wrap: break-word;
}
.journal-card-body .md-content p:last-child { margin-bottom: 0; }

.journal-card-collapsible.journal-card-collapsed .md-content {
  max-height: 12em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}
.journal-card-toggle {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  background: transparent;
  border: 1px solid currentColor;
  color: #8ab0ff;
  border-radius: 3px;
  font-size: 0.82em;
  cursor: pointer;
}

.journal-card-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.journal-card-image img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  cursor: zoom-in;
  transition: transform 0.15s ease;
}
.journal-card-image:hover img { transform: scale(1.02); }

/* DM response thread */
.journal-card-thread {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  background: rgba(199, 155, 255, 0.06);
  border-left: 2px solid #c79bff;
}
.journal-response { padding: 6px 0; }
.journal-response + .journal-response {
  border-top: 1px dashed rgba(127, 127, 127, 0.2);
  margin-top: 6px;
  padding-top: 8px;
}
.journal-response-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85em;
  margin-bottom: 4px;
}
.journal-response-author { font-weight: 600; }
.journal-response-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 0.72em;
  background: #5e35b1;
  color: #fff;
  border-radius: 8px;
  letter-spacing: 0.05em;
}
.journal-response-time { opacity: 0.6; font-size: 0.85em; }
.journal-response-body { line-height: 1.5; }

/* Inline DM response composer (admin only) */
.journal-respond-form {
  margin-top: 12px;
  padding: 10px;
  border-top: 1px solid rgba(127, 127, 127, 0.18);
}
.journal-respond-form textarea {
  width: 100%;
  min-height: 60px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  resize: vertical;
  font-size: 0.95em;
}
.journal-respond-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

/* Tag controls on the post form */
.journal-tag-controls {
  margin: 8px 0;
  padding: 10px 12px;
  background: rgba(232, 161, 60, 0.06);
  border: 1px solid rgba(232, 161, 60, 0.25);
  border-radius: 4px;
}
.journal-tag-controls label { font-weight: 500; cursor: pointer; }
.journal-tag-controls .journal-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
}

/* Search + month filter strip */
.journal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.journal-toolbar input[type="search"] {
  flex: 1;
  min-width: 180px;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(127, 127, 127, 0.4);
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
}

.journal-empty-state {
  padding: 24px;
  text-align: center;
  opacity: 0.6;
  font-style: italic;
}

/* Notification bell + dropdown */
.notification-bell { position: relative; }
.notification-badge {
  position: absolute;
  top: 0;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #d9534f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
}
.notification-list {
  min-width: 320px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0;
}
.notification-list .notification-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  color: inherit;
  text-decoration: none;
}
.notification-list .notification-item:hover { background: #f5f7fb; }
.notification-list .notification-item.unread {
  background: #f0f6ff;
  border-left: 3px solid #5a8dee;
}
.notification-item .notification-title { font-weight: 600; font-size: 0.92em; }
.notification-item .notification-message { font-size: 0.85em; opacity: 0.75; margin-top: 2px; }
.notification-item .notification-time { font-size: 0.75em; opacity: 0.55; margin-top: 2px; }
.notification-empty { padding: 16px; text-align: center; opacity: 0.6; }

/* ===========================================================================
   Inline lightbox - opens journal images on top of the page rather than
   navigating away. Built and toggled by js/journal.js; the .open class is
   what makes it visible.
   ========================================================================*/
body.journal-lightbox-active { overflow: hidden; }

.journal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  padding: 32px;
}
.journal-lightbox.open { display: flex; }

.journal-lightbox-figure {
  margin: 0;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.journal-lightbox-figure img {
  max-width: 96vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.6);
  background: #111;
}
.journal-lightbox-figure figcaption {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85em;
  letter-spacing: 0.04em;
}

.journal-lightbox-close,
.journal-lightbox-prev,
.journal-lightbox-next {
  position: absolute;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 44px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.journal-lightbox-close:hover,
.journal-lightbox-prev:hover,
.journal-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.18);
}
.journal-lightbox-close { top: 16px; right: 16px; font-size: 28px; line-height: 40px; }
.journal-lightbox-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.journal-lightbox-next  { right: 16px; top: 50%; transform: translateY(-50%); }
