:root {
  --navbar-height: 56px;
  --bottom-bar-height: 58px;
}

body {
  background: #000;
  font-family: 'Montserrat', sans-serif;
}

#feed-wrapper {
  position: fixed;
  top: calc(var(--navbar-height) + env(safe-area-inset-top));
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom));
  height: calc(100vh - var(--navbar-height) - var(--bottom-bar-height));
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: #000;
  scrollbar-width: none;
}

#feed-wrapper::-webkit-scrollbar {
  display: none;
}

.slide {
  width: 100vw;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.video-item {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.caption {
  position: absolute;
  right: 16px;
  bottom: 25px;
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  line-height: 1.2;
  font-size: 0.9rem;
  width: calc(100% - 32px);
  max-width: 80%;
  z-index: 10;
}

.username-container {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.comment-username-container {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  transition: transform 0.2s;
}

.avatar:hover {
  transform: scale(1.05);
}

.username {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.sub-btn {
  background: rgba(0, 0, 0, 0.45);
  border: none;
  border-radius: 9999px;
  color: #fff;
  font-weight: 500;
  padding: 0.5rem 1rem;
}

.title {
  flex: 1 1 100%;
  font-size: 16px;
  font-weight: 700;
  margin-top: 0.25rem;
  white-space: normal;
  word-break: break-word;
}

.overlay {
  position: absolute;
  right: 16px;
  bottom: calc(var(--bottom-bar-height) + 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  z-index: 10;
  pointer-events: auto;
}

.overlay button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
}

.overlay button.liked {
  color: #ff3860;
}

.like-count {
  font-size: 0.85rem;
  color: #fff;
}

.comment-section {
  position: fixed;
  bottom: -100px;
  left: 0;
  width: 100%;
  height: 60vh;
  display: flex;
  flex-direction: column;
  background: #353535;
  transform: translateY(100%);
  transition: transform 0.2s ease-in-out;
  z-index: 1000;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.comment-section.active {
  transform: translateY(-170px);
}

.comment-section .comments-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  padding: 12px 16px 8px;
  margin-top: 10px;
  margin-left: 8px;
}

.comment-section .comments-text p {
  margin: 0 !important;
  font-size: 18px !important;
  color: #acacac !important;
  font-weight: 500 !important;
  position: relative !important;
  left: 5px !important;
  top: 1.2px !important;
}

.comment-section .comments-list {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
}

.comment-section form {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid #444;
  background: #353535;
}

.comment-input {
  flex: 1;
  min-width: 0;
  border: 2px solid #2c2c2c;
  height: 25px;
  padding: 8px;
  border-radius: 16px;
  color: #fff;
  background: #2c2c2c;
}

.comment-input:focus {
  outline: none;
  border: 2px solid #ff0050;
}

.submit-btn {
  border: 2px solid #2c2c2c;
  color: #fff;
  background: #2c2c2c;
  padding: 8px;
  border-radius: 16px;
  width: 80px;
  height: 43.8px;
  font-size: 15px;
  transition: transform 0.2s;
}

.submit-btn:hover {
  transform: scale(1.05);
}

.comment-channel {
  color: #fff;
  text-decoration: none;
}

.avatar_2 {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  position: relative;
  top: 16px;
  margin-right: 5px;
  transition: transform 0.2s;
}

.avatar_2:hover {
  transform: scale(1.05);
}

.delete_button {
  padding: 7px 19px;
  font-size: 17px;
  background: #ff3939;
  color: #fff;
  border: none;
  border-radius: 7px;
  transition: all 0.3s ease;
}

.delete_button_2 {
  padding: 7px 19px;
  font-size: 17px;
  background: #ff3939;
  color: #fff;
  border: none;
  border-radius: 7px;
  transition: all 0.3s ease;
}

.video-galochka {
  background: #00b8ff;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.comment-galochka {
  background: #00b8ff;
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.search-form {
  display: none;
}

.share-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.share-btn svg {
  width: 48px;
  height: 48px;
  fill: #fff;
}

#share-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  width: 90vw;
  max-width: 400px;
  background-color: transparent;
  backdrop-filter: blur(5px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1001;
  transform: translate(-50%, 120%);
  transition: transform 0.3s ease-in-out;
  border-radius: 12px 12px 0 0;
  flex-wrap: wrap;
}

#share-panel.active {
  transform: translate(-50%, 0);
}

#share-url {
  flex: 1;
  min-width: 50px;
  max-width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background-color: transparent;
  backdrop-filter: blur(5px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 0.9rem;
  overflow-x: auto;
  outline: none;
}

#copy-share-url {
  background-color: transparent;
  backdrop-filter: blur(5px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.3s;
}

#copy-share-url.copied {
  background: rgba(40, 167, 69, 0.3);
}

#share-telegram-panel,
#share-whatsapp-panel,
#share-more-panel {
  background-color: transparent;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

#share-telegram-panel {
  background-color: #27a3e1;
}

#share-telegram-panel img {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

#share-whatsapp-panel:hover {
  background-color: #1ebe5d;
}

#share-whatsapp-panel img {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

#share-more-panel:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#close-share-panel {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bi-heart-fill {
  color: #ff0050;
}

.no-videos {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: #fff;
}

.search-form {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  padding: 5px 10px;
  background: transparent;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 15px;
  font-size: 16px;
  background: transparent;
  color: #fff;
}

.search-input::placeholder {
  color: #fff;
}

.search-button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  padding: 8px 15px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  height: 40px;
  width: 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
}

.search-button i {
  font-size: 18px;
  color: #fff;
}

.comment {
  margin-bottom: 1rem;
}

.comment-body {
  color: #fff;
  margin-top: 0.5rem;
}

.data-text {
  color: #acacac;
  font-size: 0.85rem;
  margin-left: 8px;
}

/* Стили для лайков комментариев и фото */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.comment-like-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.comment-like-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.comment-like-btn i {
  font-size: 1.1rem;
  transition: color 0.2s;
}

.comment-like-btn .bi-heart-fill {
  color: #ff4458;
}

.comment-like-count {
  font-weight: 500;
}

.comment-image {
  max-width: 300px;
  max-height: 300px;
  border-radius: 8px;
  margin-top: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.comment-image:hover {
  transform: scale(1.02);
}

.comment-image-label {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.comment-image-label:hover {
  background: rgba(255, 255, 255, 0.1);
}

.image-preview {
  padding: 0.5rem 0;
}

@media (max-width: 768px) {
  .comment-image {
    max-width: 100%;
    max-height: 200px;
  }
}
