/* History and reactions */

.history-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.35) 70%, transparent 100%);
  pointer-events: none;
}
.history-top-bar > * {
  pointer-events: auto;
}

.friends-filter-dropdown {
  position: absolute;
  top: 66px;
  left: 14px;
  right: 14px;
  max-height: 430px;
  background-color: rgba(30, 32, 38, 0.96);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.75);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px) scale(0.96);
  transform-origin: top center;
  transition:
    opacity 0.24s var(--spring-out),
    transform 0.28s var(--spring-bounce),
    visibility 0.24s;
}
.friends-filter-dropdown.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.ff-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(233, 237, 243, 0.06);
  cursor: pointer;
  transition: background-color 0.18s var(--smooth-ease), padding-left 0.18s var(--smooth-ease);
}
.ff-item:last-child { border-bottom: none; }
.ff-item:hover, .ff-item.active {
  background-color: rgba(72, 118, 255, 0.12);
  padding-left: 20px;
}
.ff-chevron {
  color: #969fac;
  font-size: 18px;
  font-weight: 600;
}

/* History grid */
.history-grid-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 66px 6px 92px;
}
.history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
@keyframes cardRiseIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.history-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  background-color: #181a20;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transform: translateZ(0);
  animation: cardRiseIn 0.34s var(--spring-out) backwards;
  transition: transform 0.24s var(--spring-bounce), border-color 0.2s, box-shadow 0.24s;
}
.history-cell:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(72, 118, 255, 0.55);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
  z-index: 2;
}
.history-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.32s var(--spring-out);
}
.history-cell:hover img {
  transform: scale(1.07);
}
.history-video-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(24, 27, 34, 0.76);
  backdrop-filter: blur(6px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.history-bottom-shutter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3.5px solid var(--locket-gold);
  padding: 4px;
  background: rgba(12, 14, 18, 0.75);
  backdrop-filter: blur(10px);
  cursor: pointer;
  z-index: 32;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s var(--spring-bounce), box-shadow 0.25s;
}
.history-bottom-shutter:hover {
  transform: translateX(-50%) scale(1.08);
  box-shadow: 0 10px 28px rgba(255, 180, 0, 0.28);
}
.history-bottom-shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #ffffff;
}

/* Moment feed */
.history-view-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.97);
  transition:
    opacity 0.28s var(--spring-out),
    transform 0.32s var(--spring-out),
    visibility 0.28s;
}
.history-view-layer.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  z-index: 10;
}

.history-feed-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.history-feed-scroll::-webkit-scrollbar { display: none; }

.moment-feed-slide {
  width: 100%;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 66px 2px 124px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  position: relative;
}

.feed-media-card {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 52px;
  overflow: hidden;
  position: relative;
  background-color: #111318;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.72);
  flex-shrink: 0;
  margin-top: 8px;
}
.feed-media-card img,
.feed-media-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feed-caption-pill {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(20, 22, 28, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 6;
}
.feed-caption-pill .ov-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.feed-hide-moment-btn {
  -webkit-appearance: none;
  appearance: none;
  margin-left: 4px;
  padding: 0;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  border: 0;
  outline: none;
  background: rgba(255, 255, 255, 0.10);
  color: inherit;
  opacity: 0.76;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.feed-hide-moment-btn:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  color: #fca5a5 !important;
  opacity: 1 !important;
  transform: scale(1.08);
}

.feed-sender-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 10px;
  border-radius: 999px;
}
.feed-sender-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #2c323d;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.feed-sender-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feed-sender-name {
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
}
.feed-sender-time {
  font-size: 15.5px;
  font-weight: 600;
  color: #71717a;
}

/* Feed reply and navigation */
.feed-bottom-chrome {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.72) 68%, transparent 100%);
  z-index: 28;
}

.feed-own-activity-pill {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background-color: rgba(42, 43, 48, 0.94);
  backdrop-filter: blur(14px);
  color: #d4d4d8;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--spring-bounce), background-color 0.2s;
}
.feed-own-activity-pill:hover {
  background-color: rgba(56, 58, 64, 0.98);
  transform: translateY(-1px);
}

.feed-reply-pill {
  width: 100%;
  height: 46px;
  border-radius: 999px;
  background-color: rgba(42, 43, 48, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 10px 0 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.feed-reply-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
}
.feed-reply-input::placeholder {
  color: #9ca3af;
  font-weight: 600;
}
.feed-quick-emoji {
  background: transparent;
  border: none;
  font-size: 21px;
  cursor: pointer;
  padding: 4px 5px;
  line-height: 1;
  transition: transform 0.22s var(--spring-bounce);
}
.feed-quick-emoji:hover {
  transform: translateY(-3px) scale(1.25);
}
.feed-more-emoji-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  cursor: pointer;
  transition: transform 0.22s var(--spring-bounce), color 0.2s;
}
.feed-more-emoji-btn:hover {
  transform: scale(1.15);
  color: #ffffff;
}

.feed-bottom-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}
.feed-nav-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  transition: transform 0.22s var(--spring-bounce), color 0.2s, background-color 0.2s;
}
.feed-nav-icon-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.08);
}

.feed-center-shutter {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3.5px solid var(--locket-gold);
  padding: 4px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.24s var(--spring-bounce);
}
.feed-center-shutter:hover {
  transform: scale(1.08);
}
.feed-center-shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #ffffff;
}

/* Reaction animation */
.emoji-burst-float {
  position: absolute;
  bottom: 110px;
  left: 50%;
  font-size: 38px;
  pointer-events: none;
  z-index: 80;
  animation: emojiFloatUp 0.95s var(--spring-out) forwards;
}
@keyframes emojiFloatUp {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(0.5); }
  25% { opacity: 1; transform: translate(-50%, -25px) scale(1.25); }
  100% { opacity: 0; transform: translate(-50%, -140px) scale(0.9); }
}

/* Emoji picker */
.emoji-picker-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 82%;
  background-color: #1f2024;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 28px 28px 0 0;
  z-index: 92;
  display: flex;
  flex-direction: column;
  padding: 16px 14px 58px;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.85);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(100%);
  transition:
    opacity 0.26s var(--spring-out),
    transform 0.32s var(--spring-out),
    visibility 0.26s;
}
.emoji-picker-sheet.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.emoji-search-input {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  background-color: #35363b;
  border: none;
  padding: 0 20px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.emoji-search-input::placeholder {
  color: #9ca3af;
}
.emoji-sheet-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
}
.emoji-sheet-scroll::-webkit-scrollbar { display: none; }
.emoji-cat-title {
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  margin: 10px 4px 12px;
}
.emoji-grid-9 {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
}
.emoji-cell-btn {
  aspect-ratio: 1 / 1;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s var(--spring-bounce), background-color 0.15s;
}
.emoji-cell-btn:hover {
  transform: scale(1.24);
  background-color: rgba(255, 255, 255, 0.08);
}
.emoji-cat-dock {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 94%;
  height: 38px;
  border-radius: 12px;
  background: rgba(43, 44, 49, 0.96);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
.emoji-dock-btn {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  color: #71717a;
  font-size: 17px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s, background-color 0.18s, transform 0.18s;
}
.emoji-dock-btn:hover, .emoji-dock-btn.active {
  color: #e4e4e7;
  background-color: rgba(255, 255, 255, 0.10);
}
.md-storm-btn {
  padding: 0 12px !important;
  width: auto !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.16) !important;
  border: 1px solid rgba(251, 191, 36, 0.45) !important;
}
.md-storm-btn:hover {
  background: rgba(251, 191, 36, 0.28) !important;
  transform: scale(1.08);
}
