/* styles.css */
/* Reset and base styles for a modern, clean look */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #8B0000 100%);
    color: #ffffff;
    line-height: 1.5;
    min-height: 100vh;
    padding: 20px;
    padding-top: 65px; /* Adjusted padding-top to account for the fixed top bar height (45px) plus original padding */
}

/* Feed container: Full-width with subtle card elevation */
.feed-container {
    max-width: 600px;
    margin: 0 auto;
}

.post {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(139, 0, 0, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid #8B0000;
}

/* Post Header: Compact and aligned */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #8B0000;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 2px solid #ff0000;
}

.avatar.small {
    width: 32px;
    height: 32px;
    border-width: 1px;
}

.username {
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
}

.timestamp {
    font-size: 13px;
    color: #ffcccc;
    font-weight: 400;
}

.post-options {
    background: none;
    border: none;
    font-size: 20px;
    color: #ffcccc;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.post-options:hover {
    background-color: #8B0000;
}

/* Post Content: Spacious with gradient overlay option */
.post-content {
    padding: 20px;
}

.post-content p {
    font-size: 16px;
    margin-bottom: 16px;
    color: #ffffff;
}

.post-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}

/* Post Actions: Modern pill buttons */
.post-actions {
    display: flex;
    padding: 12px 20px;
    border-top: 1px solid #8B0000;
    gap: 8px;
}

.action-btn {
    flex: 1;
    background: none;
    border: 1px solid #ff0000;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #ffcccc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: #8B0000;
    border-color: #ff0000;
    color: #ffffff;
}

.like-btn:hover {
    border-color: #ff0000;
    color: #ff0000;
}

/* Comments Section: Clean threaded layout */
.comments-section {
    padding: 0 20px 20px;
}

.comment-input-wrapper,
.reply-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid #8B0000;
}

.comment-field {
    flex: 1;
    border: 1px solid #ff0000;
    background: #1a1a1a;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 15px;
    outline: none;
    color: #ffffff;
    transition: border-color 0.2s ease;
}

.comment-field:focus {
    border-color: #ff0000;
    background: #000000;
}

.comment-field::placeholder {
    color: #ffcccc;
}

.send-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #ff0000;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.send-btn:hover {
    background-color: #8B0000;
}

/* Comment Threads: Grouped with subtle separators */
.comment-thread {
    margin: 8px 0;
}

.comment-thread:not(:last-child) {
    border-bottom: 1px solid #8B0000;
}

.comment {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    position: relative;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.comment-header .username {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.comment-header .timestamp {
    font-size: 13px;
    color: #ffcccc;
}

.reply-to {
    font-size: 13px;
    color: #ff0000;
    font-weight: 500;
}

.comment-body p {
    font-size: 15px;
    color: #ffffff;
    margin-bottom: 8px;
}

.comment-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reaction-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #ffcccc;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.reaction-btn:hover {
    color: #ff0000;
}

.reaction-count {
    font-size: 13px;
    color: #ffcccc;
    font-weight: 500;
}

.reply-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: #ff0000;
    cursor: pointer;
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.reply-btn:hover {
    background-color: #8B0000;
}

/* Reply Items: Enhanced indented threading with vertical and horizontal connectors */
.reply-item {
    position: relative;
    margin-left: 44px;
    padding-left: 12px;
    margin-top: 4px;
}

.reply-item::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #ff0000, #8B0000);
    border-radius: 1px;
}

.reply-item .comment {
    padding: 8px 0;
    position: relative;
    z-index: 1;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 8px;
    margin-left: -12px;
    padding-left: 16px;
}

/* Horizontal connector: Short horizontal line from vertical to comment body (now on the right side of vertical) */
.reply-item .comment::before {
    content: '';
    position: absolute;
    left: 0; /* Start from the left edge of comment (right of vertical) */
    top: 50%;
    transform: translateY(-50%);
    width: 8px; /* Shorter horizontal extending right from vertical */
    height: 1px;
    background: linear-gradient(to right, #ff0000, #8B0000);
    z-index: 2;
}

/* Deeper levels will stack the margin-left and enhance the line stacking */
.reply-item .reply-item {
    margin-left: 44px; /* Additional indent for each level */
}

.reply-item .reply-item::before {
    width: 3px; /* Thicker for deeper levels */
    background: linear-gradient(to bottom, #ff0000, #8B0000); /* Gradient with accent color */
}

/* Reply Input: Nested within threads with inherited indentation and enhanced styling */
.reply-input-wrapper {
    border-top: none;
    padding: 8px 0;
    position: relative;
    z-index: 1;
    background: rgba(26, 26, 26, 0.9);
    border-radius: 12px;
    margin-left: -12px;
    padding-left: 16px;
    padding: 12px 16px;
    border: 1px solid #8B0000;
}

.reply-input-wrapper::before {
    content: '';
    position: absolute;
    left: 0; /* Start from the left edge (right of vertical) */
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 1px;
    background: linear-gradient(to right, #ff0000, #8B0000);
    z-index: 2;
}

.reply-input-wrapper .comment-field {
    background: #000000;
    border-color: #ff0000;
    color: #ffffff;
}

.reply-input-wrapper .comment-field::placeholder {
    color: #ffcccc;
}

ul {
  list-style-type: none;
  margin: 0;
  padding: 5px;
  overflow: hidden;
  background-color: #000000;
  position: fixed;
  top: 0;
  width: 100%;
  height: 45px; /* Increased height slightly to match padding */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px; /* Kept gap */
  z-index: 1000; /* Ensure it sits on top of everything */
}

.justify_right {
  float: right;
}

.justify_right a {
  display: block;
  color: white;
  text-align: right;
  padding: 15px 10px;
  text-decoration: none;
}

li {
  display: inline-block; /* Changed from float for better flex compatibility */
}

li a {
  display: block;
  color: #ffcccc; /* Matched to action-btn color */
  text-align: center;
  padding: 8px 12px; /* Matched padding to action-btn */
  text-decoration: none;
  border: 1px solid #ff0000; /* Red border for pill buttons */
  border-radius: 20px; /* Matched border-radius to action-btn */
  background: none; /* Transparent background initially */
  font-weight: 500;
  font-size: 14px; /* Matched font size */
  transition: all 0.2s ease;
  cursor: pointer; /* Added cursor to match */
}

li a:hover:not(.active) {
  background-color: #8B0000; /* Dark red background on hover */
  border-color: #ff0000; /* Matched hover border-color */
  color: #ffffff;
}
