/* ==========================================================================
   DollarHuge - Universal Notifications & Promotions System Styles
   Universal implementation per docs/tenant-promotions-notifications-guide.md
   ========================================================================== */

/* --- Bell Ring Animation --- */
@keyframes bell-ring {
  0% { transform: rotate(0deg); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-14deg); }
  45% { transform: rotate(10deg); }
  60% { transform: rotate(-10deg); }
  75% { transform: rotate(6deg); }
  85% { transform: rotate(-6deg); }
  100% { transform: rotate(0deg); }
}

.animate-bell-ring {
  animation: bell-ring 1.2s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
  transform-origin: top center;
  display: inline-block;
}

/* --- Bell Trigger --- */
.notification-bell-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
  outline: none;
  padding: 0;
}

.notification-bell-trigger:hover {
  background: rgba(0, 0, 0, 0.06);
}

.theme--dark .notification-bell-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.notification-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #f43f5e;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  line-height: 1.1;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.5);
  display: none;
  animation: badgePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification-badge.active {
  display: inline-block;
}

@keyframes badgePop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- Backdrop --- */
.notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.notif-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* --- Notification Drawer Container --- */
.notif-drawer {
  position: fixed;
  background: #ffffff;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  font-family: 'Montserrat', sans-serif;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme--dark .notif-drawer {
  background: #171c2d;
  color: #e2e8f0;
  box-shadow: -5px 0 35px rgba(0, 0, 0, 0.5);
}

/* Desktop: Right Slide-Over */
@media (min-width: 768px) {
  .notif-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 440px;
    transform: translateX(100%);
  }
  .notif-drawer.open {
    transform: translateX(0);
  }
  .notif-pull-bar-container {
    display: none;
  }
}

/* Mobile: Native Slide-Up Bottom Sheet */
@media (max-width: 767px) {
  .notif-drawer {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .notif-drawer.open {
    transform: translateY(0);
  }
  .notif-pull-bar-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0 2px;
    cursor: grab;
  }
  .notif-pull-bar {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #cbd5e1;
  }
  .theme--dark .notif-pull-bar {
    background: #475569;
  }
}

/* --- Header --- */
.notif-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
}

.theme--dark .notif-header {
  border-bottom-color: #2d3748;
}

.notif-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.notif-count-pill {
  font-size: 0.75rem;
  padding: 3px 9px;
  background: #e0f2fe;
  color: #0284c7;
  border-radius: 12px;
  font-weight: 600;
}

.theme--dark .notif-count-pill {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
}

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

.notif-mark-all-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.notif-mark-all-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.theme--dark .notif-mark-all-btn {
  border-color: #475569;
  color: #94a3b8;
}

.theme--dark .notif-mark-all-btn:hover {
  background: #334155;
  color: #f8fafc;
}

.notif-close-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: background 0.2s;
}

.notif-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.theme--dark .notif-close-btn:hover {
  background: #334155;
  color: #ffffff;
}

/* --- Tabs --- */
.notif-tabs {
  display: flex;
  padding: 8px 16px;
  gap: 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.theme--dark .notif-tabs {
  background: #111625;
  border-bottom-color: #2d3748;
}

.notif-tab {
  flex: 1;
  text-align: center;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.notif-tab.active {
  background: #00b894;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 184, 148, 0.35);
}

.theme--dark .notif-tab {
  color: #94a3b8;
}

.theme--dark .notif-tab.active {
  background: #00b894;
  color: #ffffff;
}

/* --- Body --- */
.notif-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- Empty States --- */
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  color: #94a3b8;
}

.notif-empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.theme--dark .notif-empty-icon-wrap {
  background: #1e2438;
}

.notif-empty-icon {
  font-size: 32px;
  color: #64748b;
}

.theme--dark .notif-empty-icon {
  color: #94a3b8;
}

.notif-empty-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  color: #334155;
}

.theme--dark .notif-empty-title {
  color: #e2e8f0;
}

.notif-empty-desc {
  font-size: 0.84rem;
  line-height: 1.5;
  max-width: 280px;
}

/* --- Notification Card --- */
.notif-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s, box-shadow 0.15s;
}

.notif-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.theme--dark .notif-card {
  background: #1e2438;
  border-color: #334155;
  box-shadow: none;
}

.notif-card.unread {
  border-left: 4px solid #00b894;
  background: #f0fdf4;
}

.theme--dark .notif-card.unread {
  background: #182729;
  border-left-color: #00b894;
}

.notif-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notif-type-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-type-icon i {
  font-size: 18px;
}

/* Type Color Schemes */
/* Emerald: Payment / Success */
.notif-type-emerald { background: #dcfce7; color: #059669; }
.theme--dark .notif-type-emerald { background: rgba(5, 150, 105, 0.2); color: #34d399; }

/* Rose: Security / Critical / Error */
.notif-type-rose { background: #ffe4e6; color: #e11d48; }
.theme--dark .notif-type-rose { background: rgba(225, 29, 72, 0.2); color: #fb7185; }

/* Amber: Warning / Compliance */
.notif-type-amber { background: #fef3c7; color: #d97706; }
.theme--dark .notif-type-amber { background: rgba(217, 119, 6, 0.2); color: #fbbf24; }

/* Indigo: Maintenance */
.notif-type-indigo { background: #e0e7ff; color: #4f46e5; }
.theme--dark .notif-type-indigo { background: rgba(79, 70, 229, 0.2); color: #818cf8; }

/* Fuchsia: Promotion */
.notif-type-fuchsia { background: #fae8ff; color: #c026d3; }
.theme--dark .notif-type-fuchsia { background: rgba(192, 38, 211, 0.2); color: #e879f9; }

/* Blue: Information / Broadcast */
.notif-type-blue { background: #e0f2fe; color: #0284c7; }
.theme--dark .notif-type-blue { background: rgba(2, 132, 199, 0.2); color: #38bdf8; }

.notif-card-content {
  flex: 1;
  min-width: 0;
}

.notif-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.notif-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00b894;
  display: inline-block;
  flex-shrink: 0;
}

.notif-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  color: #1e293b;
  line-height: 1.3;
}

.theme--dark .notif-card-title {
  color: #f1f5f9;
}

.notif-sticky-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  background: #fef3c7;
  color: #b45309;
  padding: 1px 5px;
  border-radius: 4px;
}

.theme--dark .notif-sticky-badge {
  background: rgba(217, 119, 6, 0.25);
  color: #fbbf24;
}

.notif-time {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-card-body {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
  margin: 4px 0 8px 0;
  word-break: break-word;
}

.theme--dark .notif-card-body {
  color: #cbd5e1;
}

.notif-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.notif-action-btn {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notif-action-primary {
  background: #00b894;
  color: #ffffff;
}

.notif-action-primary:hover {
  background: #00a383;
}

.notif-action-secondary {
  background: #f1f5f9;
  color: #475569;
}

.notif-action-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.theme--dark .notif-action-secondary {
  background: #2d3748;
  color: #cbd5e1;
}

.theme--dark .notif-action-secondary:hover {
  background: #3a475d;
  color: #ffffff;
}

.notif-action-disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: default;
}

.theme--dark .notif-action-disabled {
  background: #2d3748;
  color: #64748b;
}

/* ==========================================================================
   Cross-Tenant Promotions Styling
   ========================================================================== */

/* --- 1. Popup Promotion --- */
.promo-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
  animation: promoFadeIn 0.25s ease-out;
}

@keyframes promoFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.promo-popup-container {
  position: relative;
  width: 520px;
  max-width: 92vw;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  animation: promoZoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
}

.theme--dark .promo-popup-container {
  background: #171c2d;
  color: #f1f5f9;
}

.promo-popup-link {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.promo-popup-img {
  width: 100%;
  height: auto;
  max-height: 55vh;
  object-fit: cover;
  display: block;
  background: #0f172a;
}

.promo-popup-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.promo-popup-sponsor {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6366f1;
}

.promo-popup-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.35;
  color: #0f172a;
}

.theme--dark .promo-popup-title {
  color: #f8fafc;
}

.promo-popup-subtitle {
  font-size: 13.5px;
  line-height: 1.5;
  color: #64748b;
  margin: 0;
}

.theme--dark .promo-popup-subtitle {
  color: #94a3b8;
}

.promo-popup-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.promo-popup-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  height: 40px;
  line-height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.promo-popup-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* --- Common Ad Badges & Controls --- */
.promo-ad-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
  letter-spacing: 0.4px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.promo-ad-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s, transform 0.15s;
}

.promo-ad-close:hover {
  background: rgba(15, 23, 42, 0.95);
  transform: scale(1.08);
}

/* --- 2. Banner Promotions --- */
.promo-banners-wrapper {
  width: 100%;
  margin: 16px 0;
}

.promo-banners-desktop {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  justify-content: center;
}

.promo-banners-desktop.single-banner {
  grid-template-columns: 1fr !important;
  max-width: 680px !important;
  margin: 0 auto !important;
}

.promo-banners-mobile {
  display: none;
  width: 100%;
}

@media (max-width: 767px) {
  .promo-banners-desktop {
    display: none !important;
  }
  .promo-banners-mobile {
    display: block !important;
  }
}

.promo-banner-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

.theme--dark .promo-banner-card {
  background: #1e2438;
}

.promo-banner-link {
  display: block;
  line-height: 0;
  width: 100%;
}

.promo-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.promo-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.promo-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.25s;
}

.theme--dark .promo-carousel-dot {
  background: #475569;
}

.promo-carousel-dot.active {
  background: #00b894;
  width: 22px;
  border-radius: 10px;
}

/* --- 3. Native Cards --- */
.promo-native-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.promo-native-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

.theme--dark .promo-native-card {
  background: #1e2438;
}

.promo-native-link {
  display: block;
  line-height: 0;
}

.promo-native-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* --- 4. Footer Strip --- */
.promo-footer-strip {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 728px;
  width: calc(100% - 32px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
  z-index: 9990;
  background: #ffffff;
  animation: promoSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme--dark .promo-footer-strip {
  background: #171c2d;
}

@keyframes promoSlideUp {
  0% { transform: translate(-50%, 60px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

@media (max-width: 767px) {
  .promo-footer-strip {
    bottom: calc(1rem + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
    border-radius: 10px;
    animation: promoMobileSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes promoMobileSlideUp {
    0% { transform: translateY(60px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
  }
}

.promo-footer-link {
  display: block;
  line-height: 0;
}

.promo-footer-img {
  width: 100%;
  height: auto;
  max-height: 90px;
  object-fit: cover;
  display: block;
}

.promo-strip-fadeout {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
