/* =========================[ NOTIFY COMPONENT ]========================= */

/* Container geral (fica ao lado da foto do usuário) */
.notify-wrapper {
  position: relative;
  display: inline-block;   /* volta pro inline-block */
  margin-left: 8px;
  margin-right: 8px;
  vertical-align: middle;
  height: 32px;            /* mesma altura da foto */
  width: 32px;             /* garante largura fixa também */
}

/* Botão do sininho */
#notify-button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-dark);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.2s ease;
  box-shadow: none;
}
#notify-button:hover { color: var(--color-blue-light); }

.btn-icon {
  box-shadow: none;
}

.btn-icon:hover {
  box-shadow: none;
}

/* Badge (contador vermelho) */
#notify-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-red);
  color: var(--color-text-light);
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  line-height: 1;
  display: none;
}
#notify-badge:not(.hidden) { display: inline-block; }

/* Dropdown de notificações */
#notify-dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  width: 320px;
  background: #fff;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-tiny);
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 999;

  /* Dynamic height */
  display: flex;
  flex-direction: column;

  /* Maximum size control */
  max-height: 400px;

  padding: 0;

  /* Hidden state */
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}


#notify-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#notify-dropdown .dropdown i {
  font-size: var(--font-size-small);
}

/* =========================[ HEADER ]========================= */
.notify-header {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--color-gray-medium);
  color: #fff;
  flex-shrink: 0;
  font-weight: 600;
}

.notify-title-header { display:flex; align-items:center; gap:10px; color: white; }
.notify-icon {
  width: 22px; height: 22px;
  display: flex;
  align-items: center; justify-content: center;
  border-radius: var(--radius-tiny);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.notify-icon i {
  font-size: 12px;
  color: var(--color-gray-medium);
  font-weight: 900;
  font-style: normal;
}

/* =========================[ LISTA / TIMELINE ]========================= */
#notify-list {
  --notify-axis: 18px;

  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;

  padding: 12px 12px 12px calc(var(--notify-axis) + 18px);

  /* Scroll only here */
  overflow-y: auto;
  flex: 1;
}


/* Eixo vertical */
#notify-list::before {
  content: "";
  position: absolute;
  left: var(--notify-axis);
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--color-gray-light);
  border-radius: var(--radius-tiny);
  z-index: 0;
}

/* =========================[ ITEM ]========================= */
.notify-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "title date"
    "message message";
  row-gap: 4px;

  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-gray-light);
  border-radius: var(--radius-tiny);
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  z-index: 1;
}

.notify-item:hover {
  background: var(--color-border-default);
  border-radius: var(--radius-tiny);
}

/* Bolinha */
.notify-item::before {
  content: "";
  position: absolute;
  left: calc(var(--notify-axis) - 43px);
  top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--color-gray-medium);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--color-gray-light);
  z-index: 1;
}
.notify-item.unread::before { background: var(--color-blue-primary); }

/* =========================[ TEXTOS ]========================= */
.notify-title {
  grid-area: title;
  display: block;                  /* deixa o título ocupar a linha toda */
  color: var(--color-dark);
  font-weight: 600;
  font-size: 12.5px;               /* levemente menor */
  margin: 0;
  line-height: 1.0;
  word-break: break-word;          /* quebra se for gigante */
  overflow: hidden;
  text-overflow: ellipsis;         /* reticências */
  white-space: normal;             /* permite quebra de linha */
  max-width: calc(100% - 30px);    /* evita colar na data */
}

.notify-message {
  grid-area: message;
  font-size: 12px;
  color: var(--color-gray);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notify-date {
  grid-area: date;
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* =========================[ VAZIO / FOOTER ]========================= */
.notify-empty {
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}
.notify-footer {
  padding: 10px;
  text-align: center;
  border-top: 1px solid var(--color-gray-light);
  background: #f9f9f9;
  flex-shrink: 0;
}

.notify-footer button {
  background: none;
  border: none;
  color: var(--color-blue);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}
.notify-footer button:hover { color: var(--color-dark); }

/* =============================[ NOTIFY VIEW – CARD ]============================= */

.notify-view-card {
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-tiny);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--color-border-default);
  overflow: hidden;
}

/* Header */
.notify-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(
    135deg,
    var(--color-blue-primary),
    var(--color-blue-light)
  );
  color: var(--color-text-light);
}

.notify-card-icon {
  width: 42px;
  height: 42px;
  background: var(--color-gray-light);
  color: var(--color-blue-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.notify-card-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.notify-card-subtitle {
  font-size: 12px;
  opacity: 0.85;
}

/* Body */
.notify-card-body {
  padding: 24px;
  background: #fff;
}

.notify-card-content {
  font-size: 13px;
  color: var(--color-gray);
  line-height: 1.6;
}

/* Melhorar visual do HTML interno */
.notify-card-content i {
  margin-right: 6px;
}

.notify-card-content b {
  color: var(--color-dark);
}

.notify-card-content hr {
  border: none;
  border-top: 1px solid var(--color-gray-light);
  margin: 14px 0;
}

/* Mensagem de sucesso / info */
.notify-card-content .success {
  color: var(--color-green);
  font-weight: 500;
}

.notify-card-content .muted {
  color: var(--color-text-muted);
  font-size: 12px;
}

@media (max-width: 768px) {

  #notify-dropdown {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;

    width: 100%;
    border-radius: 0;

    /* Limit height to viewport */
    max-height: 55vh;
  }

}
