/* =====================================================
   FEED - Home feed, posts, likes, grid
   ===================================================== */

/* Feed Header */
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 100%;
  max-width: 600px;
}

@media (min-width: 768px) {
  .feed-header {
    max-width: 600px;
  }
}

@media (max-width: 600px) {
  .feed-header {
    max-width: 100%;
  }
}

.feed-header.header-centered {
  justify-content: center;
  position: relative;
}

/* Header alineado a la derecha solo en perfil personal y otherprofile */
#view-profile .feed-header.header-centered,
#view-otherprofile .feed-header.header-centered {
  justify-content: flex-end;
}

.feed-header.header-centered .btn-back {
  position: absolute;
  left: 12px;
}

.feed-header.header-centered .btn-menu {
  position: relative;
}

.feed-username {
  font-size: 16px;
  font-weight: 500;
  color: #000;
}

.feed-username-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.feed-username-container .verified-badge-small {
  position: absolute;
  left: 100%;
  margin-left: 4px;
}

/* Feed Grid */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: #fafafa;
}

.feed-item {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  cursor: pointer;
  background: #f0f0f0;
}

.feed-item img,
.feed-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feed-item:active {
  opacity: 0.8;
}

#view-otherprofile #otherFeedGrid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 2px !important;
  width: 100% !important;
}

#view-otherprofile .feed-item {
  position: relative !important;
  aspect-ratio: 3 / 4 !important;
  overflow: hidden !important;
  cursor: pointer !important;
  background: #f0f0f0 !important;
  width: 100% !important;
}

#view-otherprofile .feed-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* Feed States */
.feed-state {
  text-align: center;
  padding: 24px 12px;
  color: #999;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 0;
  width: 100%;
}

.coming-soon {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 14px;
  font-style: italic;
}

/* Home Feed */
.home-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
  padding-top: 62px;
  margin: 0 auto;
  width: 100%;
}

.home-feed-item {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.home-feed-item .post-media {
  aspect-ratio: 3 / 4;
}

/* Post Elements */
.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
}

.post-username {
  font-weight: 600;
  font-size: 14px;
  color: #000;
  cursor: pointer;
}

.post-username:hover {
  text-decoration: underline;
}

.post-media {
  width: 100%;
  aspect-ratio: 1;
  background: #f0f0f0;
  position: relative;
}

.post-media img,
.post-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-title {
  padding: 8px 16px 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.post-caption {
  padding: 12px 16px;
  font-size: 14px;
  color: #000;
  line-height: 1.4;
}

.post-actions {
  padding: 8px 16px 12px 16px;
  font-size: 14px;
  color: #666;
}

/* Like Button */
.btn-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  padding: 8px 12px;
  border-radius: 20px;
  transition: background 0.2s, transform 0.15s;
}

.btn-like:hover {
  background: #f5f5f5;
}

.btn-like:active {
  transform: scale(0.95);
}

.btn-like:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-like .heart-icon {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s;
}

.btn-like.liked .heart-icon {
  animation: heartPop 0.3s ease;
}

.btn-like .likes-count {
  font-weight: 500;
}

.post-likes {
  cursor: pointer;
}

/* SVG Icons */
.heart-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.send-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
