html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f5f7fa;
  min-height: 100vh;
}

.footer {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(102, 126, 234, 0.2);
  margin-top: 40px;
  padding: 20px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
}

/* Modern Feed Design */
.feed-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}

.adsense-sidebar-left,
.adsense-sidebar-right {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.adsense-container {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.main-content-wrapper {
  border-radius: 0;
}

#filter-container .card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

#filter-container .card-body {
  padding: 16px 20px;
}

#clear-filter-btn {
  border-radius: 20px;
  padding: 6px 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

#clear-filter-btn:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.feed-wrapper {
  width: 100%;
}

.post-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
  position: relative;
  overflow: hidden;
}

.post-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #667eea;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-item:hover {
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
  border-color: #667eea;
  background: rgba(255, 255, 255, 1);
}

.post-item:hover::before {
  opacity: 1;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e1e8ed;
  transition: all 0.3s ease;
  cursor: pointer;
}

.author-avatar:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.author-avatar-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #667eea;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 20px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.author-avatar-placeholder:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.author-info {
  flex: 1;
}

.author-name {
  font-weight: 700;
  font-size: 15px;
  color: #14171a;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.author-name.clickable-username {
  cursor: pointer;
}

.author-name.clickable-username:hover {
  color: #667eea;
  text-decoration: none;
  opacity: 0.8;
}

.author-username {
  font-size: 14px;
  color: #657786;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.author-username.clickable-username {
  cursor: pointer;
}

.author-username.clickable-username:hover {
  color: #667eea;
  text-decoration: none;
  opacity: 0.8;
}

.post-time {
  font-size: 13px;
  color: #657786;
  white-space: nowrap;
}

.post-content {
  margin-bottom: 12px;
}

.post-content p {
  font-size: 15px;
  line-height: 1.6;
  color: #14171a;
  margin: 0;
  word-wrap: break-word;
  white-space: pre-wrap;
  max-height: none;
  overflow: visible;
  letter-spacing: 0.01em;
}

.post-images {
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
}

.post-image-single {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s;
}

.post-image-single:hover {
  opacity: 0.9;
}

.post-images-grid {
  display: grid;
  gap: 2px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

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

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

.post-images-grid.grid-3 .post-image:first-child {
  grid-row: 1 / 3;
}

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

.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s;
  min-height: 200px;
  display: block;
}

.post-image:hover {
  opacity: 0.9;
}

.post-image-more {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 8px 0 0 0;
}

.post-actions {
  display: flex;
  gap: 32px;
  padding-top: 16px;
  border-top: 1px solid #e1e8ed;
  margin-top: 4px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #657786;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

.action-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.action-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.action-btn.like-action:hover {
  background: rgba(224, 36, 94, 0.1);
  color: #e0245e;
}

.action-btn.comment-action:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

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

.action-count {
  font-weight: 500;
  min-width: 20px;
  text-align: left;
}

.like-action.liked .action-icon {
  color: #e0245e;
}

.like-action.liked .action-count {
  color: #e0245e;
}

.trending-sidebar {
  position: sticky;
  top: 20px;
}

.trending-item {
  padding: 12px;
  border-radius: 12px;
  transition: all 0.3s ease;
  margin-bottom: 8px;
}

.trending-item:hover {
  background-color: #f0f4f8;
}

.trending-link {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.trending-link:hover {
  color: #667eea;
  text-decoration: none;
  opacity: 0.8;
}

.hashtag-link, .mention-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hashtag-link:hover, .mention-link:hover {
  text-decoration: none;
  color: #0d8bd9;
  opacity: 0.8;
}

/* Comments Section */
.comments-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e1e8ed;
}

.comments-container {
  max-height: 500px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  margin-bottom: 8px;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-avatar,
.comment-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e1e8ed;
  flex-shrink: 0;
}

.comment-avatar-placeholder {
  background: #667eea;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.comment-author-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-author-name {
  font-weight: 600;
  font-size: 14px;
  color: #14171a;
}

.comment-author-username {
  font-size: 13px;
  color: #657786;
}

.comment-time {
  font-size: 12px;
  color: #657786;
}

.comment-content {
  margin-left: 46px;
  margin-bottom: 8px;
}

.comment-content p {
  font-size: 14px;
  line-height: 1.5;
  color: #14171a;
  margin: 0;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.comment-actions {
  margin-left: 46px;
  display: flex;
  gap: 16px;
}

.comment-like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #657786;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.comment-like-btn:hover {
  background-color: rgba(224, 36, 94, 0.1);
  color: #e0245e;
}

.comment-like-icon {
  font-size: 14px;
}

.comment-replies {
  margin-left: 46px;
  margin-top: 12px;
  padding-left: 12px;
  border-left: 2px solid #e1e8ed;
}

.comment-form-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e1e8ed;
}

.comment-form {
  margin: 0;
}

.comment-input {
  resize: none;
  font-size: 14px;
  border-radius: 20px;
  border: 1px solid #e1e8ed;
  padding: 10px 16px;
  transition: all 0.2s ease;
}

.comment-input:focus {
  border-color: #1da1f2;
  box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.1);
  outline: none;
}

@media (max-width: 768px) {
  .feed-container {
    padding: 10px;
  }
  
  .post-item {
    border-radius: 12px;
    padding: 12px;
  }
  
  .author-avatar, .author-avatar-placeholder {
    width: 40px;
    height: 40px;
  }
  
  .post-actions {
    gap: 16px;
  }
  
  .comment-avatar,
  .comment-avatar-placeholder {
    width: 32px;
    height: 32px;
  }
  
  .comment-content,
  .comment-actions {
    margin-left: 42px;
  }
  
  .comment-replies {
    margin-left: 42px;
  }
}
