/* CSS Variables for Theming */
:root {
    /* Light mode (default) */
    --background-color: #FAF8F3; /* Linen White */
    --text-color: #3E3E3E; /* Charcoal */
    --text-color-secondary: rgba(62, 62, 62, 0.7); /* Charcoal with opacity */
    --text-color-tertiary: rgba(62, 62, 62, 0.5); /* Charcoal with opacity */
    --border-color: rgba(62, 62, 62, 0.1); /* Charcoal with opacity */
    --accent-color: #B29785; /* Muted Clay (Primary) */
    --accent-color-hover: rgba(178, 151, 133, 0.8); /* Muted Clay with opacity */
    --accent-color-light: rgba(178, 151, 133, 0.1); /* Muted Clay with opacity */
    --accent-color-1: #A7B9A8; /* Sage Green (Accent 1) */
    --accent-color-2: #AECBEA; /* Sky Blue (Accent 2) */
    --code-background: rgba(62, 62, 62, 0.05); /* Charcoal with opacity */
    --toolbar-background: #E1DED9; /* Warm Grey (Surface) */
    --box-shadow-color: rgba(62, 62, 62, 0.15); /* Charcoal with opacity */
    --overlay-color: rgba(62, 62, 62, 0.5); /* Charcoal with opacity */
    --link-color: #7C6B8D; /* Soft Plum (Link/Action) */
    --link-color-hover: rgba(124, 107, 141, 0.8); /* Soft Plum with opacity */
}

/* Dark Mode Variables */
.dark-mode {
    --background-color: #1E1E1C; /* Charcoal Mist (Background) */
    --text-color: #E3E0DB; /* Soft Linen (Text) */
    --text-color-secondary: rgba(227, 224, 219, 0.7); /* Soft Linen with opacity */
    --text-color-tertiary: rgba(227, 224, 219, 0.5); /* Soft Linen with opacity */
    --border-color: rgba(227, 224, 219, 0.1); /* Soft Linen with opacity */
    --accent-color: #5C4738; /* Deep Earth (Primary) */
    --accent-color-hover: rgba(92, 71, 56, 0.8); /* Deep Earth with opacity */
    --accent-color-light: rgba(92, 71, 56, 0.2); /* Deep Earth with opacity */
    --accent-color-1: #58675D; /* Forest Moss (Accent 1) */
    --accent-color-2: #6D859C; /* Haze Blue (Accent 2) */
    --code-background: rgba(42, 42, 40, 0.5); /* Coal Grey with opacity */
    --toolbar-background: #2A2A28; /* Coal Grey (Surface) */
    --box-shadow-color: rgba(0, 0, 0, 0.5);
    --overlay-color: rgba(0, 0, 0, 0.7);
    --link-color: #A69AB5; /* Twilight Plum (Link/Action) */
    --link-color-hover: rgba(166, 154, 181, 0.8); /* Twilight Plum with opacity */
}

/* General Styles */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;  /* Changed from height: 100% */
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* Header Styles */
header {
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    width: 80%;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Landing page header - left aligned */
.landing-header {
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 1.5rem 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    margin: 0;
    padding-left: 2rem;
    padding-right: 2rem;
}

header h1 {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.site-title {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.site-title:hover {
    color: var(--link-color);
}

.user-info {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
}

/* User Profile Styles */
.user-profile {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--accent-color-1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    position: relative;
    overflow: hidden;
}

.user-avatar-initials {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-avatar-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 10px var(--box-shadow-color);
    z-index: 10;
    min-width: 160px;
    display: none;
    margin-top: 8px;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: background-color 0.2s;
}

.user-menu-item:hover {
    background-color: var(--code-background);
}

/* Sign out button in red */
#sign-out {
    color: #e53935;
}

/* Header navigation styles */
.header-nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    margin-right: 1rem;
}

/* Navigation Link */
.nav-link {
    margin-left: 1rem;
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
}

.nav-link:hover {
    text-decoration: underline;
    color: var(--link-color-hover);
}

/* Main Content Styles */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 2rem 1rem;
}

.feed-container {
    background-color: var(--background-color);
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Feed Header Styles */
.feed-header {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.feed-container h2 {
    margin-top: 0;
    margin-bottom: 0;
    font-family: 'Spectral', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    padding-bottom: 0.5rem;
}

/* View Mode Toggle Styles */
.view-mode-toggle {
    display: flex;
    align-items: center;
    background-color: var(--code-background);
    border-radius: 20px;
    padding: 3px;
}

.view-mode-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 16px;
    color: var(--text-color-secondary);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-mode-btn:hover {
    color: var(--text-color);
}

.view-mode-btn.active {
    background-color: var(--background-color);
    color: var(--link-color);
    box-shadow: 0 1px 3px var(--box-shadow-color);
}

/* Grid View Styles */
.feed.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 1rem;
}

.feed.grid-view .post {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    padding: 12px;
}

.feed.grid-view .no-posts {
    grid-column: 1 / -1; /* Span all grid columns */
    text-align: center;
    justify-self: center;
}

.feed.grid-view .post-content {
    display: block;
    order: 1;
    margin-bottom: 0;
}

.feed.grid-view .post-header {
    order: 2;
    margin-top: 0;
    margin-bottom: 0;
    justify-content: flex-end;
}

.feed.grid-view .post-footer {
    order: 3;
    margin-top: 10px;
    text-align: center;
}

.feed.grid-view .post-content p,
.feed.grid-view .post-content h1,
.feed.grid-view .post-content h2,
.feed.grid-view .post-content h3,
.feed.grid-view .post-content h4,
.feed.grid-view .post-content h5,
.feed.grid-view .post-content h6,
.feed.grid-view .post-content ul,
.feed.grid-view .post-content ol,
.feed.grid-view .post-content blockquote,
.feed.grid-view .post-content pre,
.feed.grid-view .read-more-btn,
.feed.grid-view .preview-content,
.feed.grid-view .full-content {
    display: none;
}

.feed.grid-view .post-content img {
    display: none;
}

/* Grid View Image Container */
.grid-view-images {
    display: none;
}

.feed.grid-view .grid-view-images {
    display: flex;
    justify-content: center;
    order: 0;
    margin-bottom: 12px;
}

.feed.grid-view .grid-view-image {
    display: block;
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0;
}

.feed.grid-view .post-author {
    display: none;
}

.feed.grid-view .post-header-left {
    display: none;
}

.feed.grid-view .post-header-right {
    margin-left: auto;
}

.feed.grid-view .post-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

/* Hide comments in grid view */
.feed.grid-view .comments-container {
    display: none;
}

/* Post Styles */
.post {
    margin-bottom: 3.5rem;
    padding-bottom: 3.5rem;
    border-bottom: 1px solid var(--border-color);
}

.post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Markdown Styles */
.post-content h1,
.post-content h2,
.post-content h3 {
    margin-top: 0.3em; /* Further reduced from 0.7em */
    margin-bottom: 0.1em;
}

.post-content h1 {
  font-size: 1.6em;
  margin-top: 1.4em;
  margin-bottom: 0.6em;
  font-weight: 600;
  font-family: 'Spectral', serif;
}

.post-content h2 {
  font-size: 1.4em;
  margin-top: 1.4em;
  margin-bottom: 0.6em;
  font-weight: 600;
  font-family: 'Spectral', serif;
}

.post-content h3 {
  font-size: 1.25em;
  margin-top: 1.4em;
  margin-bottom: 0.6em;
  font-weight: 600;
  font-family: 'Spectral', serif;
}

.post-content h4, .post-content h5, .post-content h6 {
    font-size: 1.1em;
    margin-top: 0.2em; /* Reduced from 0.5em to match the reduction in h1-h3 */
    margin-bottom: 0.3em;
    font-weight: 600;
    font-family: 'Spectral', serif;
}

.post-content strong {
    font-weight: 600;
}

.post-content em {
    font-style: italic;
    opacity: 0.9;
}

.post-content code {
  background-color: var(--code-background);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

/* List styles */
.post-content ul, .post-content ol {
    margin-top: 0.6em;
    margin-bottom: 0.6em;
    padding-left: 1.5em;
    font-size: 0.95em;
}

.post-content li {
    margin-bottom: 0.3em;
}

.post-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 1rem;
  color: var(--text-color-secondary);
  font-style: italic;
  margin: 1.2em 0;
}

.post-header {
  margin-bottom: 1rem; /* better space under title/author */
  align-items: baseline;
  gap: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.post-author {
    font-weight: 600;
    color: var(--text-color);
    font-size: 16px;
    display: flex;
    align-items: center;
    margin-right: 0;
}

/* Post Avatar Styles */
.post-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--accent-color-1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.post-avatar-initials {
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.post-avatar-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-name {
    display: flex;
    align-items: center;
}

/* Dot separator between author and date */
.dot-separator {
    color: var(--text-color-secondary);
    font-size: 0.85rem;
    margin: 0 4px;
}

/* New badge styles */
.new-badge {
    display: inline-block;
    font-size: 14px;
    margin-left: 5px;
    color: var(--link-color); /* Accent color */
}

.post-footer {
    margin-top: 1rem;
    text-align: right;
}

.post-time {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-color-secondary);
  margin-left: 0;
}

.post-updated {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-color-tertiary);
  font-style: italic;
  margin-left: 0.5rem;
}

.post-header-left {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.post-header-right {
    position: relative;
}

.post-menu-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color-secondary);
    font-size: 16px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 0.4;
    transition: background-color 0.2s;
}

.post-menu-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-mode .post-menu-button:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.post-menu-button.selected {
    color: var(--text-color);
}

.post-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 10px var(--box-shadow-color);
    z-index: 10;
    min-width: 120px;
    display: none;
}

.post-menu-dropdown.show {
    display: block;
}

.post-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: background-color 0.2s;
}

.post-menu-item:hover {
    background-color: var(--code-background);
}

.post-menu-item.delete {
    color: #e53935;
}

.post-content {
  margin-top: 0rem;
  margin-bottom: 1.25rem;
  font-family: 'Inter', sans-serif;
  line-height: 1.4; /* Reduced from 1.6 to decrease vertical spacing */
}

.post-content p {
  font-size: 1em;
  margin-bottom: 1.2em;
  letter-spacing: -0.003em;
}

.post-content p:first-child {
  margin-top: 0.4rem;
  font-size: 1.05em;
  margin-bottom: 0.8rem;
}

.post-content img {
    max-width: 100%;
    max-height: 520px;
    display: block;
    margin: 1rem auto;
}

.post-media {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.post-media img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* Loading Indicator */
.loading {
    text-align: center;
    color: var(--text-color-secondary);
    padding: 2rem 0;
    font-size: 16px;
    font-style: italic;
}

/* Error and No Posts Messages */
.error, .no-posts {
    text-align: center;
    color: var(--text-color-secondary);
    padding: 2rem 0;
    font-size: 18px;
    line-height: 1.6;
}

/* Notification Message Styles */
.notification {
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.notification.show {
    display: block;
}

.notification.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Read More Button and Content Expansion */
.read-more-btn {
    background-color: transparent;
    color: var(--link-color);
    border: none;
    padding: 0.5rem 0;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.read-more-btn:hover {
    color: var(--link-color-hover);
    text-decoration: underline;
}

.read-more-btn:focus {
    outline: none;
}

.full-content {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

.full-content.expand-animation {
    opacity: 1;
    max-height: 100000px; /* Large value to ensure all content is shown */
    transition: opacity 0.5s ease, max-height 1s ease;
}

.preview-content {
    transition: opacity 0.3s ease;
}

/* Notification Bell Styles */
.notification-bell {
    position: relative;
    margin-left: 1rem;
}

.notification-bell-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-secondary);
    transition: background-color 0.3s, color 0.3s;
}

.notification-bell-btn:hover {
    background-color: var(--code-background);
    color: var(--text-color);
}

.notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: #e53935;
    border-radius: 50%;
    display: none;
}

.notification-dot.show {
    display: block;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 10px var(--box-shadow-color);
    z-index: 10;
    min-width: 280px;
    display: none;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-dropdown.show {
    display: block;
}

.notification-header {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.notification-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.notification-content {
    padding: 10px 0;
}

.notification-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

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

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color-1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    position: relative;
    overflow: hidden;
}

.notification-avatar-initials {
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.notification-avatar-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-details {
    flex-grow: 1;
}

.notification-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.notification-actions {
    display: flex;
    margin-top: 8px;
}

.notification-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.notification-btn-accept {
    background-color: var(--link-color);
    color: white;
    border: none;
    margin-right: 8px;
}

.notification-btn-accept:hover {
    background-color: var(--link-color-hover);
}

.notification-btn-decline {
    background-color: transparent;
    color: var(--text-color-secondary);
    border: 1px solid var(--border-color);
}

.notification-btn-decline:hover {
    background-color: var(--code-background);
    color: var(--text-color);
}

.no-notifications {
    padding: 15px;
    text-align: center;
    color: var(--text-color-secondary);
    font-size: 14px;
}

.notification-section-header {
    padding: 10px 15px;
    font-weight: bold;
    background-color: var(--code-background);
    border-bottom: 1px solid var(--border-color);
}

.notification-welcome-note {
    cursor: pointer;
}

.notification-welcome-note:hover {
    background-color: var(--code-background);
}

.notification-message {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--text-color);
}

/* Theme Toggle Styles */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--box-shadow-color);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--box-shadow-color);
}

/* Legacy class for compatibility */
.theme-toggle-bottom {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--box-shadow-color);
    transition: all 0.2s ease;
}

.theme-toggle-bottom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--box-shadow-color);
}

.theme-toggle-icon {
    display: block;
}

.dark-mode .theme-toggle-icon.sun {
    display: block;
    color: var(--text-color);
}

.dark-mode .theme-toggle-icon.moon {
    display: none;
    color: var(--text-color);
}

.theme-toggle-icon.sun {
    display: none;
    color: var(--text-color);
}

.theme-toggle-icon.moon {
    display: block;
    color: var(--text-color);
}

/* Comment Styles */
.comments-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.comment {
    margin-left: 2rem; /* Right shift for comments */
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    /* Removed bottom line
    border-bottom: 1px solid var(--border-color);
    */
    position: relative;
}

/* Style for new comments */
.comment.new {
    background-color: rgba(255, 255, 0, 0.1); /* Light yellow background */
    border-left: 3px solid #ffcc00; /* Yellow left border */
    padding-left: 10px;
    margin-left: calc(2rem - 13px); /* Adjust margin to account for the border */
}

.dark-mode .comment.new {
    background-color: rgba(255, 255, 0, 0.05); /* Darker yellow background for dark mode */
}

.comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Removed vertical line
.comment:before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}
*/

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    align-items: center;
}

.comment-author {
    color: var(--text-color-secondary);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    margin-right: 0;
}

.comment-author-name {
    display: flex;
    align-items: center;
}

.comment-footer {
    margin-top: 0.5rem;
    text-align: right;
}

.comment-time {
    color: var(--text-color-secondary);
    font-size: 12px;
    margin-left: 0;
}

.comment-header-left {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.comment-header-right {
    position: relative;
}

.comment-menu-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color-secondary);
    font-size: 14px;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 0.4;
    transition: background-color 0.2s;
}

.comment-menu-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-mode .comment-menu-button:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.comment-menu-button.selected {
    color: var(--text-color);
}

.comment-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 10px var(--box-shadow-color);
    z-index: 10;
    min-width: 120px;
    display: none;
}

.comment-menu-dropdown.show {
    display: block;
}

.comment-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: background-color 0.2s;
}

.comment-menu-item:hover {
    background-color: var(--code-background);
}

.comment-menu-item.delete {
    color: #e53935;
}

.comment-content {
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    font-size: 16px;
}

.comment-content p {
    margin-bottom: 0.8rem;
    letter-spacing: -0.003em;
}

.comment-content p:first-child {
    margin-top: 0;
    margin-bottom: 0.6rem;
}

.comment-content img {
    max-width: 100%;
    max-height: 320px;
    display: block;
    margin: 0.8rem auto;
}

/* Comment Form Styles */
.comment-form {
    margin-top: 1.5rem;
    margin-left: 2rem;
    padding: 0;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
}

.comment-textarea {
    width: 100%;
    padding: 0.8rem;
    padding-right: 3rem; /* Make room for the send button */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    resize: none; /* Disable resize since we have fixed height */
    margin-bottom: 0;
    height: 80px; /* Fixed height */
    overflow-y: auto; /* Enable scrolling for longer text */
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.comment-submit-btn {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    background-color: var(--link-color);
    color: white;
    border: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 1;
}

.comment-submit-btn:hover {
    background-color: var(--link-color-hover);
}

/* Comment Edit Form Styles */
.comment-edit-form {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-edit-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.comment-edit-form .comment-submit-btn {
    position: static;
    border-radius: 4px;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
}

.comment-cancel-btn {
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-cancel-btn:hover {
    background-color: var(--border-color);
}

/* Post Edit Form Styles */
.post-edit-form {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.post-textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    resize: vertical;
    min-height: 150px;
}

.post-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.post-edit-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.post-submit-btn {
    background-color: var(--link-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-submit-btn:hover {
    background-color: var(--link-color-hover);
}

.post-cancel-btn {
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-cancel-btn:hover {
    background-color: var(--border-color);
}

/* Note Page Styles */
.note-container {
    background-color: var(--background-color);
    padding: 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.note {
    margin-bottom: 2rem;
}

.full-note {
    border-bottom: none;
    padding-bottom: 0;
}

.full-note .post-content {
    font-size: 1.05em;
}

.full-note .post-content p:first-child {
    font-size: 1.1em;
}

.full-note .post-content img {
    max-width: 100%;
    max-height: 600px;
}

/* Footer Styles */
footer {
    width: 80%;
    margin: 0 auto;
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--text-color-secondary);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

/* CTA Button Styles */
.cta {
    display: block;
    width: fit-content; /* Ensure button width matches content */
    margin: 1rem auto 0; /* Top, horizontal, bottom margins */
    padding: 0.75rem 1.5rem;
    background: #B29785;
    color: #FAF8F3;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.cta:hover {
  background: #A0836F;
}
