/* ============================================
   Sirr - Feed Styles
   Dark Theme | RTL | Mobile-First
   ============================================ */

/* --- Design Tokens (shared) --- */
:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-surface: #1a1a25;
  --bg-hover: #1e1e2a;
  --bg-highlight: rgba(255, 255, 255, 0.06);
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --accent: #fd79a8;
  --accent-light: #fdcb6e;
  --text: #eee;
  --text-muted: #888;
  --text-secondary: #bbb;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

/* ============================================
   STORIES BAR
   ============================================ */

.stories-bar {
  display: flex;
  gap: 12px;
  padding: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stories-bar::-webkit-scrollbar {
  display: none;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.story-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform var(--transition);
}

.story-ring:active {
  transform: scale(0.95);
}

.story-ring.mine {
  background: none;
  border: 2px dashed var(--text-muted);
}

.story-ring.seen {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  padding: 2px;
}

.story-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--bg);
  object-fit: cover;
}

.story-plus {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--bg);
}

.story-name {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* ============================================
   POST CARD
   ============================================ */

.post-card {
  border-bottom: 1px solid var(--border);
  padding: 14px;
  background: var(--bg-card);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.post-header .more-btn {
  margin-right: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: background var(--transition);
}

.post-header .more-btn:hover {
  background: var(--bg-highlight);
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.post-meta {
  flex: 1;
  min-width: 0;
}

.post-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-name .verified {
  color: var(--primary);
  font-size: 13px;
}

.post-user {
  font-size: 12px;
  color: var(--text-muted);
}

.post-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* Post Content */
.post-text {
  font-size: 14px;
  line-height: 1.7;
  color: #ddd;
  margin-bottom: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.post-text .hashtag {
  color: var(--primary-light);
  cursor: pointer;
  font-weight: 600;
}

.post-text .hashtag:hover {
  text-decoration: underline;
}

.post-text .mention {
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

.post-text .mention:hover {
  text-decoration: underline;
}

.post-text a {
  color: var(--primary-light);
  text-decoration: none;
}

.post-text a:hover {
  text-decoration: underline;
}

/* Post Media */
.post-media {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
}

.post-media img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: auto;
}

.post-media video {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #000;
}

/* Post Image Gallery */
.post-gallery {
  display: grid;
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
}

.post-gallery.gallery-2 {
  grid-template-columns: 1fr 1fr;
}

.post-gallery.gallery-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.post-gallery.gallery-3 .gallery-img:first-child {
  grid-row: 1 / 3;
}

.post-gallery.gallery-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.post-gallery .gallery-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: opacity var(--transition);
}

.post-gallery .gallery-img:hover {
  opacity: 0.85;
}

.post-gallery .gallery-more {
  position: relative;
}

.post-gallery .gallery-more::after {
  content: attr(data-more);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

/* Post Actions */
.post-actions {
  display: flex;
  flex-direction: row;
  gap: 4px;
  margin-top: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.action-btn:hover {
  background: var(--bg-highlight);
  color: var(--text);
}

.action-btn:active {
  transform: scale(0.95);
}

.action-btn .icon {
  font-size: 18px;
  line-height: 1;
}

.action-btn.liked {
  color: var(--accent);
}

.action-btn.liked .icon {
  color: var(--accent);
}

.action-btn.bookmarked {
  color: var(--accent-light);
}

.action-btn.shared {
  color: var(--primary-light);
}

/* Like animation */
@keyframes likeHeart {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.action-btn.liked .icon {
  animation: likeHeart 0.4s ease;
}

/* ============================================
   FEED UTILITIES
   ============================================ */

.feed-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.feed-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.feed-empty .empty-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

.feed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.feed-loading .spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* New post indicator */
.new-posts-btn {
  position: sticky;
  top: 60px;
  z-index: 50;
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

.new-posts-btn:hover {
  background: var(--primary-light);
}

/* Shared / Repost label */
.post-repost-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.post-repost-label .icon {
  color: var(--primary-light);
}

/* Post location */
.post-location {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Comments preview */
.post-comments-preview {
  padding-top: 8px;
}

.post-comments-preview .comment-count {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.post-comments-preview .comment-count:hover {
  color: var(--text);
}
