/**
 * Стили для страницы /explore (Вдохновиться)
 * Включает табы и общую ленту
 */

/* ============================================
   СТРАНИЦА EXPLORE
   ============================================ */

.explore-page {
  padding: 20px 16px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 60vh;
}

.explore-title {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  color: #fff;
  text-align: center;
}

/* ============================================
   ТАБЫ
   ============================================ */

.explore-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  margin-left: auto;
  margin-right: auto;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
}

.explore-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.explore-tab:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.explore-tab.active {
  background: #b4ff39;
  color: #000;
}

/* ============================================
   КОНТЕНТ
   ============================================ */

.explore-content {
  min-height: 300px;
}

.explore-sections-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============================================
   ЗАГРУЗКА И СОСТОЯНИЯ
   ============================================ */

.explore-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 16px;
  color: rgba(255, 255, 255, 0.6);
}

.explore-empty,
.explore-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.explore-empty .empty-icon,
.explore-error .error-icon {
  font-size: 48px;
  opacity: 0.5;
}

.explore-empty h3,
.explore-error h3 {
  font-size: 18px;
  color: #fff;
  margin: 0;
}

.explore-empty p,
.explore-error p {
  font-size: 14px;
  margin: 0;
}

/* ============================================
   ОБЩАЯ ЛЕНТА (FEED)
   ============================================ */

.feed-container {
  width: 100%;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

@media (max-width: 640px) {
  .feed-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 400px) {
  .feed-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.feed-loader {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.feed-sentinel {
  height: 1px;
  width: 100%;
}

/* ============================================
   КАРТОЧКА ЛЕНТЫ
   ============================================ */

.feed-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feed-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.feed-card--vertical {
  grid-row: span 2;
}

.feed-card__preview {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  overflow: hidden;
}

.feed-card--vertical .feed-card__preview {
  aspect-ratio: 9 / 16;
}

.feed-card__preview video,
.feed-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-card__type-icon {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  backdrop-filter: blur(4px);
}

.feed-card__info {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feed-card__author {
  flex: 1;
  min-width: 0;
}

.feed-card__author-name {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   КНОПКА ЛАЙКА
   ============================================ */

.feed-card__like-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.feed-card__like-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.feed-card__like-btn.liked {
  color: #ff4757;
  background: rgba(255, 71, 87, 0.15);
}

.feed-card__like-btn.liked .like-icon {
  animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.like-icon {
  font-size: 16px;
  line-height: 1;
}

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

/* ============================================
   КНОПКА ПУБЛИКАЦИИ В ИСТОРИИ
   ============================================ */

.history-action-btn.share-btn {
  font-size: 11px;
  padding: 6px 10px;
  background: rgba(180, 255, 57, 0.1);
  color: #b4ff39;
  border: 1px solid rgba(180, 255, 57, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.history-action-btn.share-btn:hover {
  background: rgba(180, 255, 57, 0.2);
}

.history-action-btn.share-btn.published {
  background: rgba(255, 71, 87, 0.1);
  color: #ff4757;
  border-color: rgba(255, 71, 87, 0.3);
}

.history-action-btn.share-btn.published:hover {
  background: rgba(255, 71, 87, 0.2);
}

.history-action-btn.share-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
  .explore-page {
    padding: 16px 12px;
    padding-bottom: 80px; /* Для мобильной навигации */
  }
  
  .explore-title {
    font-size: 20px;
    margin-bottom: 16px;
    text-align: left;
  }
  
  .explore-tabs {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  
  .explore-tab {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
  }
  
  .feed-card__info {
    padding: 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .feed-card__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============================================
   СПИННЕР ЗАГРУЗКИ
   ============================================ */

.loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(180, 255, 57, 0.2);
  border-top-color: #b4ff39;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ЛЕНТЫ
   ============================================ */

.feed-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.feed-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.feed-modal__container {
  position: relative;
  background: #1a1a1a;
  border-radius: 16px;
  max-width: 900px;
  max-height: 90vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.feed-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 18px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.feed-modal__close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.feed-modal__media {
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 60vh;
  overflow: hidden;
}

.feed-modal__media video,
.feed-modal__media img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
}

.feed-modal__info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 30vh;
}

.feed-modal__author {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.feed-modal__author-label {
  color: rgba(255, 255, 255, 0.5);
}

.feed-modal__author-name {
  color: #b4ff39;
  font-weight: 500;
}

.feed-modal__prompt {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-modal__prompt-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feed-modal__prompt-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 3px solid #b4ff39;
  word-break: break-word;
}

.feed-modal__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.feed-modal__like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.feed-modal__like-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.feed-modal__like-btn.liked {
  color: #ff4757;
  background: rgba(255, 71, 87, 0.15);
}

.feed-modal__like-btn .like-icon {
  font-size: 18px;
}

.feed-modal__download-btn {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #b4ff39;
  color: #000;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.feed-modal__download-btn:hover {
  background: #a0e632;
}

/* Мобильная адаптация модального окна */
@media (max-width: 768px) {
  .feed-modal {
    padding: 0;
  }
  
  .feed-modal__container {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
  }
  
  .feed-modal__media {
    max-height: 50vh;
  }
  
  .feed-modal__media video,
  .feed-modal__media img {
    max-height: 50vh;
  }
  
  .feed-modal__info {
    max-height: none;
    flex: 1;
    padding: 16px;
  }
  
  .feed-modal__actions {
    flex-direction: column;
  }
  
  .feed-modal__like-btn,
  .feed-modal__download-btn {
    justify-content: center;
  }
}
