/* ============================== */
/* ========== STORIES =========== */
/* ============================== */

/* WRAPPER */
.stories-section {
  padding: 10px 0;
  background: transparent;
  position: relative;
  overflow: hidden;
}
.stories-container {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.stories-wrapper {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 5px 10px;
  background: transparent;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.stories-wrapper::-webkit-scrollbar { display: none; background: transparent; }

/* STORY ITEM */
.story-item {
  position: relative;
  flex: 0 0 auto;
  text-align: center;
  cursor: pointer;
}
.story-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid transparent;
  background: linear-gradient(135deg, #e6c165, #cfa349, #f0ca32);
  background-clip: padding-box;
  box-shadow: 0 0 8px rgba(207,163,73,0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.story-avatar.seen { opacity: 0.6; box-shadow: none; background: #444; }
.story-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(240, 202, 50, 0.8);
}
.story-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}

/* LABEL */
.story-name {
  margin-top: 6px;
  font-size: 12px;
  color: #fff;
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: 64px;
}

/* ADD STORY */
.story-add {
  border: 3px dashed rgba(240, 202, 50, 0.5);
  background: rgba(240, 202, 50, 0.1);
  display: flex; align-items: center; justify-content: center;
}
.story-add i { color: #f0ca32; font-size: 20px; }
.story.add-story .story-avatar-wrap { border: 2px solid var(--gold); }
.add-icon {
  position: absolute; bottom: -4px; right: -4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: var(--black);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: bold;
  border: 2px solid var(--background);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  z-index: 5;
}

/* ============================== */
/* ========== MODAL ============= */
/* ============================== */

.story-modal {
  position: fixed; inset: 0;
  background: radial-gradient(circle at center, rgba(0,0,0,0.95) 0%, rgba(15,15,15,0.98) 100%);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  display: flex; align-items: center; justify-content: center;
  z-index: 1400;
  animation: fadeInViewer 0.35s ease;
}
.story-modal.hidden { display: none; }

.story-content {
  position: relative;
  width: 100%; height: 100%;
  max-width: 460px; max-height: 92vh;
  display: flex; flex-direction: column;
  border-radius: 18px;
  box-shadow: 0 0 60px rgba(240, 202, 50, 0.15), 0 0 30px rgba(0,0,0,0.8);
  animation: fadeStory 0.4s ease;
  overflow: hidden;
  background: #000;
}

/* Botão fechar */
.story-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.55);
  color: #fff; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 6;
  transition: all 0.25s ease;
}
.story-close:hover { background: rgba(255,255,255,0.12); transform: scale(1.1); }

/* Barra de progresso */
.progress-container {
  position: absolute; 
  top: calc(14px + env(safe-area-inset-top));
  left: 14px; right: 14px;
  display: flex; gap: 6px; z-index: 4;
}
.progress-bar {
  flex: 1; height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px; overflow: hidden;
}
.progress-bar .fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #a16d00, #ffd86f, #f0ca32, #a16d00);
  background-size: 400% 100%;
  border-radius: 999px;
  animation: progressFill 5s linear forwards, goldFlow 2.2s linear infinite;
  box-shadow: 0 0 8px rgba(240, 202, 50, 0.5),
              0 0 14px rgba(240, 202, 50, 0.3);
}

/* MÍDIA */
.story-image,
.story-video {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 18px;
  transition: opacity 0.4s ease;
}
.story-video.hidden,
.story-image.hidden { display: none; }

/* Áreas de navegação invisíveis */
.nav-area {
  position: absolute; top: 0; bottom: 0; width: 50%;
  z-index: 2; cursor: pointer;
}
.nav-area.left { left: 0; }
.nav-area.right { right: 0; }
@media (hover:hover) {
  .nav-area.left:hover,
  .nav-area.right:hover { background: rgba(255,255,255,0.04); }
}
@media (hover:none) {
  .nav-area.left, .nav-area.right { background: transparent !important; }
}

/* Sidebar de ações (luxo) */
.story-sidebar {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 5;
}
.story-sidebar .story-btn {
  background: rgba(15,15,15,0.55);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 18px;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.story-sidebar .story-btn:hover {
  background: rgba(240,202,50,0.2);
  border-color: var(--gold);
  transform: scale(1.12);
}
#story-like.liked { color: var(--gold); }
#like-count {
  position: absolute;
  bottom: -14px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Rodapé da modelo (glass) */
.story-model-footer {
  position: absolute;
  left: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  z-index: 5;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 14px;
  border-radius: 14px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.story-avatar-footer {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
}
.story-username {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

/* ============================== */
/* ======== COMMENTS MODAL ====== */
/* ============================== */

.comments-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.comments-modal.hidden { display: none; }

.comments-content {
  width: 92%; max-width: 460px;
  background: rgba(10,10,10,0.9);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 16px 16px 12px;
  color: #fff;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  position: relative;
}

.comments-title {
  font-size: 16px; font-weight: 600;
  margin: 0 0 10px 0;
}

.comments-close {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.5);
  color: #fff; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: 0.2s ease;
}
.comments-close:hover { background: rgba(255,255,255,0.1); transform: scale(1.06); }

.comments-list {
  max-height: 240px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding-right: 4px;
}
.comment {
  font-size: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 10px;
  border-radius: 10px;
}
.comment b { color: #fff; }

.comments-input {
  margin-top: 12px;
  display: flex; gap: 8px;
}
.comments-input input {
  flex: 1; height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #fff;
  outline: none;
}
.comments-input input::placeholder { color: rgba(255,255,255,0.55); }

.comments-input button {
  width: 46px; height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(240,202,50,0.45);
  background: linear-gradient(135deg, #a16d00, #ffd86f, #f0ca32);
  color: #111; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: 0.2s ease;
}
.comments-input button:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* ============================== */
/* ========= UTIL E MOBILE ====== */
/* ============================== */

.hidden { display: none !important; }

@keyframes progressFill { from { width: 0%; } to { width: 100%; } }
@keyframes goldFlow { 0% { background-position: 0% 0%; } 100% { background-position: 400% 0%; } }
@keyframes fadeStory { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeInViewer { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 420px) {
  .story-sidebar .story-btn { width: 48px; height: 48px; }
  .story-avatar-footer { width: 50px; height: 50px; }
  .story-model-footer { padding: 6px 12px; }
}


/* ============================== */
/* ========== STORIES =========== */
/* ============================== */

/* CONTAINER GERAL */
.stories-section {
  position: relative;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 0;
  overflow: hidden;
}

.stories-container {
  width: 86%;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* BOTÕES LATERAIS (iguais ao filtro) */
.story-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(0, 0, 0, 0.6);
  color: var(--gold);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 5;
}

.story-arrow:hover {
  background: var(--gold);
  color: var(--black);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 0 10px rgba(212,175,55,0.4);
}

.story-arrow.left { left: -20px; }
.story-arrow.right { right: -20px; }

/* LISTA DE STORIES */
.stories-wrapper {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 8px 0;
}
.stories-wrapper::-webkit-scrollbar { display: none; }

/* ITEM INDIVIDUAL */
.story-item {
  flex: 0 0 auto;
  text-align: center;
  cursor: pointer;
  width: 74px;
}

/* AVATAR */
.story-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 6px rgba(212,175,55,0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.story-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(240,202,50,0.8);
}

.story-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* NOME ABAIXO */
.story-name {
  margin-top: 6px;
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: 74px;
}

.stories-wrapper::before,
.stories-wrapper::after {
  content: "";
  flex: 0 0 18px;
}

#stories-wrapper,
.stories-container,
.stories-bar {
  position: relative;
  z-index: 1;
  margin-top: calc(var(--header-height, 54px) - 10px);
  display: flex;
  gap: 10px;
  overflow-x: hidden; 
  scroll-behavior: smooth;
  padding: 0 8px; 
}
