
/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* ============================================
  SEARCH INTERFACE STYLES
   ============================================ */
.community-header {
  text-align: center;
  margin-bottom: 15px;
}

/* Auth Choice Section */
.auth-choice-section {
  margin-bottom: 30px;
}
.auth-choice-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 30px;
  border: 1px solid #e8e8e8;
  text-align: center;;
  backdrop-filter: blur(10px);
}
.auth-choice-card h3 {
  margin: 0 0 15px 0;
  color: #8e37bd;
  font-size: 22px;
}
.auth-choice-description {
  color: #666;
  margin: 0 0 25px 0;
  font-size: 15px;
  line-height: 1.5;
}
.auth-choice-buttons {
  display: flex !important;
  flex-direction: column;
  text-align: center;
  margin-right: auto;
  gap: 12px;
  width: 100%;
  /* max-width: 300px; */
}

/* Light Theme (Default) */
.auth-choice-description a {
    font-size: 1.4em;
    color: #a020f0; 
    text-decoration: underline;
    transition: color 0.2s ease; /* Smooth color transition */
}

.auth-choice-description a:visited {
    color: #800080;
}

.auth-choice-description a:hover {
    color: #ff03f2;
}

/* Dark Theme Overrides */
body.dark-theme .auth-choice-description a {
    color: #f6f6f6; 
    background: #a020f0; 
    /* If you want a border/outline effect, define style and width */
    border-bottom: 1px solid #ececece3; 
    text-decoration: none; /* Removing underline if using border-bottom */
}

body.dark-theme .auth-choice-description a:hover {
    color: #ff03f2;
}

#loginWithNostrBtn{
    color: #ffffff;
    background-color: #8e37bd;
}
.auth-note {
  color: #888;
  font-size: 13px;
  margin: 0;
}
/* Search Section */
.search-section {
  margin-top: 20px;
}
/* User Profile Bar */
.user-profile-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 25px;
  border: 1px solid #e8e8e8;
}

#newPostBtn {
  width: 200px;
  max-width: 250px;
}

/* New Post Form Styling */
#newPostForm.new-post-form {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; /* Replaces width: 100vw; height: 100vh; */
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box; /* Ensures padding is included in dimensions */
}

/* body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
} */

#newPostForm.new-post-form.hidden {
    display: none;
}

#newPostForm .post-form {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(90, 124, 90, 0.2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-sizing: border-box; /* Ensures padding/border are included in width */
}

body.dark-theme #newPostForm .post-form {
    background: rgba(60, 60, 60, 0.95);
    border-color: rgba(139, 195, 74, 0.2);
}

#newPostForm .post-form h3 {
    margin: 0 0 25px 0;
    font-size: 28px;
    color: #5a7c5a;
    text-align: center;
    font-weight: 600;
}

body.dark-theme #newPostForm .post-form h3 {
    color: #8bc34a;
}

#newPostForm #postContent {
    width: 100%;
    min-height: 250px;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    font-size: 17px;
    line-height: 1.6;
    resize: vertical;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin-bottom: 25px;
    transition: all 0.2s;
}

/* Animation that ensures form is visible */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#newPostForm.new-post-form:not(.hidden) {
    animation: fadeIn 0.3s ease-out;
}

#newPostForm #postContent:focus {
    outline: none;
    border-color: #5a7c5a;
    box-shadow: 0 0 0 3px rgba(90, 124, 90, 0.15);
}

body.dark-theme #newPostForm #postContent {
    background: rgba(80, 80, 80, 0.9);
    border-color: #555;
}

/* Image Upload Styles */
.upload-section {
    margin: 15px 0;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    min-height: 50px;
}

.upload-preview {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e8e8e8;
    transition: transform 0.2s;
}

.upload-preview:hover {
    transform: scale(1.05);
    border-color: #5a7c5a;
}

body.dark-theme .upload-preview {
    border-color: #555;
}

body.dark-theme .upload-preview:hover {
    border-color: #8bc34a;
}

/* Loading state for upload button */
#uploadImageBtn.uploading,
.upload-image-btn.uploading {
    opacity: 0.7;
    cursor: not-allowed;
}

#uploadImageBtn.uploading::after,
.upload-image-btn.uploading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Search Interface */
.search-interface {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  border: 1px solid #e8e8e8;
}
.search-interface h3 {
  margin: 0 0 10px 0;
  color: #5a7c5a;
  font-size: 20px;
}
.search-description {
  color: #666;
  margin: 0 0 20px 0;
  font-size: 14px;
}
.search-input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.search-input {
  width: 100%; /* Full width for the input */
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 16px;
}
.search-input:focus {
  outline: none;
  border-color: #5a7c5a;
  box-shadow: 0 0 0 2px rgba(90, 124, 90, 0.1);
}
.search-btn {
  padding: 12px 24px;
  white-space: nowrap;
  width: 100%; /* Make button full width below input */
}

.refresh-btn {
  padding: 8px 16px;
  margin: 20px 20px 20px 0;
  white-space: nowrap;
}
.search-options {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 25px;
  padding: 15px;
  background: rgba(248, 248, 248, 0.8);
  border-radius: 8px;
}
.search-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
}
.search-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #5a7c5a;
}

#searchBtn {
    background-color: #8e37bd;
}

/* The Fermentation Bubble Animation for search */
.loading-posts {
    position: relative;
    padding: 20px;
    text-align: center;
    overflow: hidden; /* Keeps bubbles from floating outside the area */
}

.s-bubble-horizon {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px; /* How high the bubbles float up */
    pointer-events: none; /* Allows clicking through the animation */
}

.s-bubble {
    position: absolute;
    bottom: -10px; /* Start slightly below the visible edge */
    width: 10px;
    height: 10px;
    background-color: rgba(173, 3, 252, 0.5);
    border-radius: 50%;
    opacity: 0;
    animation: riseWobble 2.5s infinite ease-in;
}

@keyframes riseWobble {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    20% {
        opacity: 0.7;
    }
    50% {
        /* This creates the side-to-side "fizz" motion */
        transform: translateY(-30px) translateX(10px);
    }
    100% {
        transform: translateY(-70px) translateX(-5px);
        opacity: 0;
    }
}

#loadingMessage {
  font-size: 14px;
  color: #555;
}

/* Initial State */
.initial-state {
  text-align: center;
  padding: 60px 20px;
  color: #777;
}
.initial-state p {
  margin-bottom: 10px;
  font-size: 16px;
}
/* Feed Title */
#feedTitle {
  margin: 0;
}

/* Smaller avatars */
.post-avatar, .profile-avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
    object-fit: cover;
}

/* Better profile display */
.author-nip {
    font-size: 11px;
    color: #5a7c5a;
    opacity: 0.8;
    margin: 0;
}

/* Dark theme adjustments */
body.dark-theme .author-nip {
    color: #8bc34a;
}

/* Post Card Styles */
.post-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e8e8e8;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden; /* Prevent content overflow */
    max-width: 100%;
}

body.dark-theme .post-card {
    background: rgba(60, 60, 60, 0.9);
    border-color: #444;
}

/* Post Header */
.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 12px;
}

.post-author {
    flex: 1;
    min-width: 0; /* Allows text truncation */
}

.author-name {
    margin: 0 0 2px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

body.dark-theme .author-name {
    color: #eee;
}

.post-time {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

body.dark-theme .post-time {
    color: #aaa;
}

/* Post Content - Word Break Styles */
.post-content {
      max-width: 100%;
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 15px;
    color: #333;
    overflow: hidden;
    /* Word break properties */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    white-space: pre-wrap;
}

body.dark-theme .post-content {
    color: #ddd;
}

.post-content a {
    color: #5a7c5a;
    text-decoration: underline;
}

body.dark-theme .post-content a {
    color: #8bc34a;
}

/* Long URL and word break handling */
.post-content a {
    word-break: break-all;
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    align-items: center;
}

.post-tag {
    display: inline-flex;
    padding: 4px 10px;
    background: #e8f5e8;
    color: #5a7c5a;
    border-radius: 12px;
    font-size: 12px;
    white-space: nowrap;
    line-height: 1;
}
/* Ensure no extra margin or padding between tags */
.post-tag:last-child {
    margin-right: 0;
}

.post-actions {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}
/* Bubbles Reaction Button */
.like-btn {
    background: rgb(138, 138, 138);
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.like-btn:hover {
    background-color: rgba(135, 206, 235, 0.422); /* Light blue for bubbles */
}

.like-btn.reacted {
    background-color: rgba(135, 206, 235, 0.7); /* Stronger blue when reacted */
    color: white;
}

.like-btn.reacted:hover {
    background-color: rgba(135, 206, 235, 0.9);
}

.reaction-count {
    font-size: 12px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.reply-btn {
    background: rgb(138, 138, 138);
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.reply-btn:hover {
    background-color: rgba(2, 92, 249, 0.422);
}



.reply-btn {
    background: rgb(138, 138, 138);
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.reply-btn:hover {
    background-color: rgba(2, 92, 249, 0.422);
}

/* Reply Styling */
.reply-container {
    margin-top: 20px;
    padding-left: 20px;
    border-left: 3px solid rgba(90, 124, 90, 0.3);
}

.reply-card {
    background: rgba(248, 248, 248, 0.9);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

body.dark-theme .reply-card {
    background: rgba(80, 80, 80, 0.9);
    border-color: #444;
}

.reply-indicator {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reply-indicator::before {
    content: "↳";
    font-size: 14px;
    color: #5a7c5a;
}

/* Inline Reply Form */
.inline-reply-form {
    background: rgba(248, 248, 248, 0.95);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    border: 2px solid rgba(90, 124, 90, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dark-theme .inline-reply-form {
    background: rgba(60, 60, 60, 0.95);
    border-color: rgba(139, 195, 74, 0.3);
}

.reply-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.reply-form-header h4 {
    margin: 0;
    color: #5a7c5a;
    font-size: 16px;
}

body.dark-theme .reply-form-header h4 {
    color: #8bc34a;
}

.close-reply-form {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #ff0000;
    width: 24px;
    height: 24px;
    margin-bottom: 30px;
    display: flex;
    align-items: right;
    justify-content: right;
}

.close-reply-form:hover {
    color: #7e7e7e;
}

body.dark-theme .close-reply-form:hover {
    color: #fff;
}

.reply-textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    margin-bottom: 12px;
}

.reply-textarea:focus {
    outline: none;
    border-color: #5a7c5a;
    box-shadow: 0 0 0 2px rgba(90, 124, 90, 0.1);
}

body.dark-theme .reply-textarea {
    background: #444;
    border-color: #555;
    color: #fff;
}

body.dark-theme .reply-textarea:focus {
    border-color: #8bc34a;
    box-shadow: 0 0 0 2px rgba(139, 195, 74, 0.2);
}

.reply-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.reply-form-actions .secondary-btn,
.reply-form-actions .primary-btn {
    padding: 10px 20px;
    min-width: 100px;
}

/*nested replies of replies*/
.nested-reply-form {
    margin-top: 20px;
    padding-left: 5px;
    border-left: 3px solid rgba(135, 132, 97, 0.3);
}

.nested-reply-textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    margin-bottom: 10px;
}

.close-nested-reply-form {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #ff0000;
    width: 22px;
    height: 22px;
    margin-bottom: 30px;
    display: flex;
    align-items: right;
    justify-content: right;
}

.close-nested-reply-form:hover {
    color: #7e7e7e;
}

body.dark-theme .close-nested-reply-form:hover {
    color: #fff;
}

/* Loading state for submit button */
.submit-reply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animation for new reply form */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inline-reply-form {
    animation: slideIn 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .inline-reply-form {
        padding: 12px;
        margin: 10px 0;
    }
    
    .reply-textarea {
        min-height: 80px;
        padding: 10px;
    }
    
    .reply-form-actions .secondary-btn,
    .reply-form-actions .primary-btn {
        padding: 8px 16px;
        min-width: 80px;
    }
}


/* ===== MEDIA PREVIEWS - POST CONTENT ===== */
    .media-video {
        max-width: 100%; /* Never exceed container */
        max-height: 250px; /* Fixed maximum height for videos */
        width: 100%; /* Fill container width */
        height: auto; /* Maintain aspect ratio */
        background: #000; /* Black background for videos */
    }
    
    .post-media-preview {
        margin: 12px 0;
        max-width: 100%; /* Never exceed container width */
        border-radius: 8px;
        overflow: hidden; /* Hide anything that overflows */
        cursor: pointer;
        border: 1px solid #e8e8e8;
        background: #f9f9f9;
        display: flex; /* Add this */
        justify-content: center; /* Center horizontally */
        align-items: center; /* Center vertically */
        text-align: center; /* Fallback for non-flex browsers */
    }

.youtube-thumbnail {
    width: 100%; /* Fill container */
    max-width: 100%; /* Never exceed container */
    aspect-ratio: 16 / 9; /* Standard YouTube aspect ratio */
    object-fit: cover; /* Cover container, may crop */
    position: relative;
    display: block; /* Remove inline spacing */
}

/* For portrait images */
.media-image.portrait {
    max-height: 500px; /* Allow taller portrait images */
    max-width: 100%; /* Still constrained by width */
}

  .media-image {
    max-width: 100%; /* Never exceed container */
    max-height: 300px; /* Fixed maximum height */
    height: auto; /* Maintain aspect ratio */
    width: auto; /* Maintain aspect ratio */
    object-fit: contain; /* Show entire image */
    display: block; /* Remove inline spacing */
    margin: 0 auto; /* Center horizontally (fallback) */
  }
  
  .media-video {
    max-width: 100%; /* Never exceed container */
    max-height: 250px; /* Fixed maximum height for videos */
    width: 100%; /* Fill container width */
    height: auto; /* Maintain aspect ratio */
    background: #000; /* Black background for videos */
    display: block; /* Remove inline spacing */
    margin: 0 auto; /* Center horizontally */
  }

  /* Handle images with extreme aspect ratios */
.post-media-preview.wide-image {
    justify-content: flex-start; /* Align left for very wide images */
    overflow-x: auto; /* Allow horizontal scrolling if needed */
}

.post-media-preview.tall-image {
    justify-content: center;
    overflow-y: auto; /* Allow vertical scrolling if needed */
}

/* Optional: Add subtle loading background */
.post-media-preview:not(:has(img[src])) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

body.dark-theme .post-media-preview:not(:has(img[src])) {
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .media-image {
        max-height: 250px; /* Smaller on mobile */
    }
    
    .media-video {
        max-height: 200px; /* Smaller on mobile */
    }
}

/* ===== DARK THEME ===== */
body.dark-theme .post-card {
    background: rgba(60, 60, 60, 0.9);
    border-color: #444;
}

body.dark-theme .post-media-preview {
    border-color: #444;
    background: #2a2a2a;
}

body.dark-theme .media-video {
    background: #111; /* Darker background for videos */
}

/* ===== FULLSCREEN MEDIA VIEWER ===== */
#mediaViewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

#mediaViewer.active {
    display: flex;
}

.media-viewer-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.media-viewer-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10001;
}

.fullscreen-media {
    max-width: 90vw; /* Constrained to viewport */
    max-height: 80vh; /* Constrained to viewport */
    object-fit: contain; /* Show entire media */
    cursor: zoom-in;
    transition: transform 0.2s;
}

.fullscreen-media.zoomed {
    cursor: grab;
    transform-origin: center center;
}

body.dark-theme #mediaViewer {
    background: rgba(0, 0, 0, 0.95);
}

/* ============================================
   DARK THEME
   ============================================ */
body.dark-theme .auth-choice-card {
  background: rgba(60, 60, 60, 0.9);
  border-color: #444;
}
body.dark-theme .auth-choice-card h3 {
  color: #8e37bd;
}
body.dark-theme .auth-choice-description {
  color: #ccc;
}
body.dark-theme .auth-note {
  color: #999;
}
body.dark-theme .user-profile-bar {
  background: rgba(70, 70, 70, 0.9);
  border-color: #555;
}
body.dark-theme .search-interface {
  background: rgba(60, 60, 60, 0.9);
  border-color: #444;
}
body.dark-theme .search-interface h3 {
  color: #8bc34a;
}
body.dark-theme .search-description {
  color: #ccc;
}
body.dark-theme .search-input {
  background: #444;
  border-color: #555;
  color: white;
}
body.dark-theme .search-input:focus {
  border-color: #8bc34a;
  box-shadow: 0 0 0 2px rgba(139, 195, 74, 0.2);
}
body.dark-theme .search-options {
  background: rgba(70, 70, 70, 0.8);
}
body.dark-theme .search-option {
  color: #ddd;
}
body.dark-theme .initial-state {
  color: #aaa;
}
body.dark-theme .post-tag {
    background: #2e3d2e;
    color: #8bc34a;
}
/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 480px) {
  .auth-choice-buttons {
    flex-direction: column;
  }
  
  .auth-choice-buttons button {
    width: 100%;
  }
  
  .user-profile-bar {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .search-input-group {
    flex-direction: column;
  }
  
  .search-btn {
    width: 100%;
  }
  
  .search-options {
    flex-direction: column;
    gap: 10px;
  }
  
}