/* =============================
   NOTIFICATIONS OVERLAY
============================= */

.notifications-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.notifications-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* =============================
   DRAWER
============================= */

.notifications-drawer {
  width: 420px;
  max-width: 90vw;
  height: 100%;
  background: #fff;
  border-radius: 16px 0 0 16px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -20px 0 60px rgba(12, 12, 10, 0.14);
}

.notifications-overlay:not(.hidden) .notifications-drawer {
  transform: translateX(0);
}

/* =============================
   HEADER
============================= */

.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(12, 12, 10, 0.08);
}

.notifications-header h3 {
  font-family: "Satoshi", sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #0c0c0a;
}

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

.notifications-mark-all,
.notifications-load-more {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #e8e2da;
  border-radius: 999px;
  background: #f8f4ef;
  color: #0c0c0a;
  font-family: "Satoshi", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.notifications-mark-all:hover,
.notifications-load-more:hover {
  background: #f1ebe3;
  border-color: #ddd5cb;
}

.notifications-mark-all:disabled,
.notifications-load-more:disabled {
  opacity: 0.55;
  cursor: default;
}

/* =============================
   CLOSE BUTTON
============================= */

.notifications-close {
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  color: #0c0c0a;
  transition:
    background-color 0.15s ease,
    transform 0.05s ease;
}

.notifications-close:hover {
  background: #b9b9b93d;
}

.notifications-close:active {
  background: #b9b9b96a;
  transform: scale(0.96);
}

.notifications-close:focus-visible {
  outline: 2px solid #0c0c0a;
  outline-offset: 2px;
}

/* =============================
   CONTENT
============================= */

.notifications-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.notifications-status {
  margin: 12px 20px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6f2ec;
  color: #5e5a55;
  font-family: "Satoshi", sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.notifications-status.is-error {
  background: #fff1f1;
  color: #a12a2a;
}

.notifications-status.is-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8f4ef;
  color: #77736f;
}

.notifications-status-loader {
  width: 18px;
  height: 18px;
  border-width: 2px;
  flex-shrink: 0;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.notifications-empty {
  padding: 24px 20px;
  color: #8f8c8b;
  font-family: "Satoshi", sans-serif;
  font-size: 14px;
}

.notifications-footer {
  padding: 12px 20px 20px;
}

/* =============================
   ITEM
============================= */

.notification-item {
  display: flex;
  gap: 12px;
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(12, 12, 10, 0.08);
  background: transparent;
  text-align: left;
  padding: 18px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.notification-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.notification-item.unread {
  background: rgba(255, 85, 1, 0.06);
}

.notification-item.unread::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #ff5501;
  border-radius: 50%;
  align-self: center;
  margin-right: 6px;
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: #e7e1d8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0c0c0a;
  stroke-width: 1;
  flex-shrink: 0;
}

.notification-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.notification-text {
  font-size: 14px;
  color: #0c0c0a;
  line-height: 1.45;
}

.notification-text strong {
  font-weight: 500;
}

.notification-time {
  font-size: 12px;
  color: #8f8c8b;
}

@media (max-width: 980px) {
  .notifications-overlay {
    justify-content: stretch;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
  }

  .notifications-drawer {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .notifications-header {
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-left: 16px;
    padding-right: 16px;
  }

  .notifications-content {
    min-height: 0;
  }

  .notifications-list {
    flex: 1;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .notifications-footer {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  }
}

/* =============================
   ADMIN AI DRAWER
============================= */

.admin-ai-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.admin-ai-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.admin-ai-drawer {
  width: 440px;
  max-width: 92vw;
  height: 100%;
  background: #fff;
  border-radius: 16px 0 0 16px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -20px 0 60px rgba(12, 12, 10, 0.14);
}

.admin-ai-overlay:not(.hidden) .admin-ai-drawer {
  transform: translateX(0);
}

.admin-ai-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 14px;
  border-bottom: 1px solid rgba(12, 12, 10, 0.08);
}

.admin-ai-drawer__header h3 {
  font-family: "Satoshi", sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #0c0c0a;
}

.admin-ai-drawer__close {
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  color: #0c0c0a;
}

.admin-ai-drawer__close:hover {
  background: #b9b9b93d;
}

.admin-ai-drawer__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 0;
}

.admin-ai-quick-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #e8e2da;
  border-radius: 999px;
  background: #f8f4ef;
  color: #0c0c0a;
  font-family: "Satoshi", sans-serif;
  font-size: 12px;
  cursor: pointer;
}

.admin-ai-quick-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.admin-ai-drawer__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 12px 20px 10px;
}

.admin-ai-drawer__status {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f2ec;
  color: #5e5a55;
  font-family: "Satoshi", sans-serif;
  font-size: 12px;
  line-height: 1.45;
}

.admin-ai-drawer__status.is-loading {
  background: #f8f4ef;
  color: #77736f;
}

.admin-ai-drawer__status.is-error {
  background: #fff1f1;
  color: #a12a2a;
}

.admin-ai-drawer__status.is-success,
.admin-ai-drawer__status.is-hint {
  background: #edf9f2;
  color: #13633f;
}

.admin-ai-drawer__feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-ai-msg {
  max-width: 90%;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: "Satoshi", sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.admin-ai-msg p {
  margin: 0;
}

.admin-ai-msg--assistant {
  align-self: flex-start;
  background: #f6f2ec;
  color: #0c0c0a;
}

.admin-ai-msg--user {
  align-self: flex-end;
  background: #0c0c0a;
  color: #fff;
}

.admin-ai-drawer__composer {
  display: flex;
  gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid rgba(12, 12, 10, 0.08);
}

.admin-ai-drawer__composer input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #e1d9cf;
  border-radius: 12px;
  padding: 0 12px;
  font-family: "Satoshi", sans-serif;
  font-size: 14px;
}

.admin-ai-drawer__composer button {
  min-height: 42px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  background: #0c0c0a;
  color: #fff;
  font-family: "Satoshi", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.admin-ai-drawer__composer button:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 980px) {
  .admin-ai-overlay {
    justify-content: stretch;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
  }

  .admin-ai-drawer {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .admin-ai-drawer__header {
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-ai-drawer__quick,
  .admin-ai-drawer__content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-ai-drawer__composer {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  }
}
