/**
 * Posts Page Styles
 * Apple-inspired unified feed design
 */

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
  padding: 0 24px;
}

.filter-tab {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
}

.filter-tab:hover {
  background: rgba(0,122,255,0.08);
  border-color: var(--blue-light);
  color: var(--blue-light);
}

.filter-tab.active {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-color: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0,122,255,0.3);
}

/* Posts Feed - Grid Layout */
.posts-feed {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

/* Post Card */
.post-card {
  background: rgba(28,28,30,0.6);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: saturate(180%) blur(20px);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--blue-light);
  box-shadow: 0 12px 32px rgba(0,122,255,0.25);
}

.post-card[data-type="album"]:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 32px rgba(0,122,255,0.3);
}

.post-card[data-type="video"]:hover {
  border-color: #FF3B30;
  box-shadow: 0 12px 32px rgba(255,59,48,0.3);
}

/* Post Header */
.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1.5px solid rgba(255,255,255,0.08);
}

.post-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.post-type-icon.album {
  background: linear-gradient(135deg, rgba(0,122,255,0.2), rgba(90,200,250,0.2));
  border: 1.5px solid rgba(0,122,255,0.3);
}

.post-type-icon.video {
  background: linear-gradient(135deg, rgba(255,59,48,0.2), rgba(255,149,0,0.2));
  border: 1.5px solid rgba(255,59,48,0.3);
}

.post-type-icon svg {
  width: 20px;
  height: 20px;
}

.post-header-info {
  flex: 1;
  min-width: 0;
}

.post-type-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.post-type-label.album {
  color: var(--blue-light);
}

.post-type-label.video {
  color: #FF3B30;
}

.post-date {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  letter-spacing: -0.01em;
}

/* Post Content */
.post-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
  position: relative;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
  transform: scale(1.08);
}

.post-thumbnail .video-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.85);
  color: var(--white);
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.post-thumbnail .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover .play-overlay {
  opacity: 1;
}

.play-overlay svg {
  width: 56px;
  height: 56px;
  fill: var(--white);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.post-title {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-description {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  letter-spacing: -0.01em;
  margin-top: auto;
}

.post-stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

.post-stat svg {
  width: 16px;
  height: 16px;
}

/* Loading Animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1200px) {
  .posts-feed {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .posts-feed {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 20px;
  }
  
  .filter-tabs {
    padding: 0 16px;
    gap: 8px;
  }
  
  .filter-tab {
    padding: 10px 20px;
    font-size: 13px;
  }
  
  .post-header {
    padding: 14px;
  }
  
  .post-content {
    padding: 14px;
  }
  
  .post-title {
    font-size: 16px;
  }
  
  .post-description {
    font-size: 13px;
  }
  
  .post-type-icon {
    width: 36px;
    height: 36px;
  }
  
  .post-type-icon svg {
    width: 18px;
    height: 18px;
  }
}


/* Playlist Styles */
.post-card[data-type="playlist"]:hover {
  border-color: #FF9500;
  box-shadow: 0 12px 32px rgba(255,149,0,0.3);
}

.post-type-icon.playlist {
  background: linear-gradient(135deg, rgba(255,149,0,0.2), rgba(255,204,0,0.2));
  border: 1.5px solid rgba(255,149,0,0.3);
}

.post-type-label.playlist {
  color: #FF9500;
}

.playlist-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover .playlist-overlay {
  opacity: 1;
}

/* Album Slideshow */
.album-slideshow {
  position: relative;
}

.album-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.album-slide.active {
  opacity: 1;
  position: relative;
}
