/* ═══════════════════════════════════════════════════════════
   InterFilm — Notifications & annonces premium
   ═══════════════════════════════════════════════════════════ */

:root {
  --if-toast-top: 84px;
  --if-toast-w: 440px;
  --if-orange: #f77f00;
  --if-orange-dim: rgba(247, 127, 0, 0.35);
}

/* ─── Stack toasts (haut droite) ─── */
#ifToastStack,
.notif-popup-wrap.if-toast-stack {
  position: fixed;
  top: var(--if-toast-top);
  right: 20px;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: var(--if-toast-w);
  width: calc(100vw - 32px);
}

#toast.legacy-toast-hidden {
  display: none !important;
}

.if-toast {
  pointer-events: all;
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 50px 20px 16px;
  border-radius: 16px;
  background: rgba(8, 8, 12, 0.82);
  border: 1px solid var(--if-orange-dim);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 24px rgba(247, 127, 0, 0.06);
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.45, 0.64, 1), opacity 0.35s ease;
  overflow: hidden;
  cursor: default;
}

.if-toast.if-toast--in {
  transform: translateX(0);
  opacity: 1;
}

.if-toast.if-toast--out {
  transform: translateX(calc(100% + 24px));
  opacity: 0;
}

.if-toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--toast-accent, var(--if-orange)), var(--toast-accent2, #ff9500));
  border-radius: 3px 0 0 3px;
}

.if-toast-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(247, 127, 0, 0.12);
  border: 1px solid rgba(247, 127, 0, 0.22);
  color: var(--if-orange);
}

.if-toast-icon svg {
  width: 20px;
  height: 20px;
}

.if-toast-body {
  flex: 1;
  min-width: 0;
}

.if-toast-label {
  display: none;
}

.if-toast-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.if-toast-text {
  margin-top: 5px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.if-toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
}

.if-toast-close:hover {
  background: rgba(247, 127, 0, 0.18);
  border-color: var(--if-orange-dim);
  color: #fff;
}

.if-toast-close svg {
  width: 11px;
  height: 11px;
}

.if-toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.if-toast-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--toast-accent, var(--if-orange)), var(--toast-accent2, #ff9500));
  transform-origin: left center;
  animation: ifToastProgress var(--toast-dur, 4.5s) linear forwards;
}

@keyframes ifToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Style unifié — toutes les notifs noir + orange */
.notif-dot-if {
  background: rgba(247, 127, 0, 0.12);
  color: var(--if-orange);
}

.notif-inbox .notif-item.unread {
  background: linear-gradient(90deg, rgba(247, 127, 0, 0.1) 0%, rgba(247, 127, 0, 0.02) 100%);
}

.notif-inbox .notif-item.unread::before {
  background: linear-gradient(180deg, #ff9500, var(--if-orange));
  box-shadow: 0 0 8px rgba(247, 127, 0, 0.45);
}

.if-toast.if-toast--clickable {
  cursor: pointer;
}

.if-toast.if-toast--clickable:hover {
  border-color: rgba(247, 127, 0, 0.5);
  transform: translateX(-3px);
}

/* ─── Centre notifications (cloche) ─── */
.notif-inbox {
  width: min(420px, calc(100vw - 24px));
  max-height: min(640px, calc(100vh - 100px));
  border-radius: 18px;
  border: 1px solid var(--if-orange-dim);
  background: rgba(6, 6, 10, 0.92);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.75), 0 0 40px rgba(247, 127, 0, 0.05);
}

.notif-inbox-head {
  padding: 18px 18px 14px;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.notif-inbox-actions,
.notif-inbox-toolbar,
.notif-inbox-foot {
  display: none !important;
}

.notif-inbox-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.notif-inbox-title::before {
  background: var(--if-orange);
  box-shadow: 0 0 10px rgba(247, 127, 0, 0.6);
}

.notif-inbox-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.notif-inbox-toolbar {
  padding: 0 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.notif-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px 10px 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-size: 13px;
  margin-bottom: 10px;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m14 14-3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.notif-search:focus {
  border-color: var(--if-orange-dim);
}

.notif-filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.notif-filter-chips::-webkit-scrollbar {
  display: none;
}

.notif-filter-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s ease;
}

.notif-filter-chip.active,
.notif-filter-chip:hover {
  border-color: var(--if-orange-dim);
  color: var(--if-orange);
  background: rgba(247, 127, 0, 0.1);
}

.notif-item {
  align-items: flex-start;
}

.notif-item-delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  opacity: 0;
  transition: 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-item:hover .notif-item-delete {
  opacity: 1;
}

.notif-item-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.notif-item-delete svg {
  width: 14px;
  height: 14px;
}

.notif-inbox-foot {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  flex-shrink: 0;
}

/* ─── Modale annonce premium ─── */
.if-announce-modal {
  z-index: 99999999;
}

.if-announce-modal .legal-box {
  max-width: 560px;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--if-orange-dim);
  background: rgba(8, 8, 12, 0.95);
  backdrop-filter: blur(24px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
}

.if-announce-banner {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.if-announce-head {
  padding: 20px 22px 14px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.if-announce-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(247, 127, 0, 0.1);
  color: var(--if-orange);
}

.if-announce-icon svg {
  width: 20px;
  height: 20px;
}

.if-announce-meta {
  flex: 1;
  min-width: 0;
}

.if-announce-priority {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.if-announce-priority--normal { background: rgba(247, 127, 0, 0.12); color: #f77f00; }
.if-announce-priority--important { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.if-announce-priority--urgent { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.if-announce-priority--maintenance { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.if-announce-priority--update { background: rgba(34, 197, 94, 0.12); color: #4ade80; }

.if-announce-title {
  font-family: var(--ff-head);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin: 0 0 6px;
}

.if-announce-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.if-announce-body {
  padding: 0 22px 18px;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  max-height: 42vh;
  overflow-y: auto;
}

.if-announce-body img {
  max-width: 100%;
  border-radius: 12px;
  margin: 10px 0;
}

.if-announce-foot {
  padding: 14px 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.if-announce-reactions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.if-announce-react {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.if-announce-react:hover,
.if-announce-react.active {
  border-color: var(--if-orange-dim);
  color: var(--if-orange);
  background: rgba(247, 127, 0, 0.1);
}

.if-announce-react svg {
  width: 14px;
  height: 14px;
}

.if-announce-views {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 5px;
}

.if-announce-views svg {
  width: 12px;
  height: 12px;
}

.if-announce-close-btn {
  padding: 12px 22px;
  border-radius: 11px;
  border: none;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  background: linear-gradient(135deg, #f77f00, #ea580c);
  color: #fff;
  margin-left: auto;
}

/* Staff announce cards */
.sp-announce-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.sp-announce-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.sp-announce-card-banner {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.sp-announce-card-body {
  padding: 14px 16px;
}

.sp-announce-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.sp-announce-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.sp-announce-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sp-announce-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

@media (max-width: 768px) {
  #ifToastStack,
  .notif-popup-wrap.if-toast-stack {
    top: calc(var(--mobile-nav-h, 56px) + 8px);
    right: 12px;
    left: 12px;
    max-width: none;
    width: auto;
  }

  .notif-inbox {
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
  }
}
