/* Social Feed Styles */

/* iOS Safe Area Fallbacks */
:root {
  --safe-area-inset-top: 0px;
  --safe-area-inset-left: 0px;
  --safe-area-inset-right: 0px;
  --safe-area-inset-bottom: 0px;
}

/* Use env() with fallbacks */
@supports (padding-top: env(safe-area-inset-top)) {
  :root {
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
  }

  /*
    Avoid horizontal safe-area padding in embedded contexts (iframes/app shell).
    Only enable left/right safe-area in true PWA fullscreen display modes.
  */
  @media (display-mode: standalone), (display-mode: fullscreen) {
    :root {
      --safe-area-inset-left: env(safe-area-inset-left);
      --safe-area-inset-right: env(safe-area-inset-right);
    }
  }
}

/* Main Layout */
.social-container {
  display: flex;
  max-width: 1200px;
  margin: 70px auto 0;
  padding: 0 15px;
  /* iOS Safe Area Support - Add top padding for safe area */
  padding-top: calc(70px + var(--safe-area-inset-top));
  margin-top: 0; /* Remove margin since we're using padding */
}

.sidebar {
  width: 300px;
  margin-right: 20px;
  position: sticky;
  top: calc(80px + var(--safe-area-inset-top));
  height: calc(100vh - 100px - var(--safe-area-inset-top));
}

.feed-container {
  flex: 1;
  max-width: 600px;
}

/* Sidebar Styles */
.sidebar-section {
  background-color: #222;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-section h2 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #fff;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
}

.user-mini-profile {
  display: flex;
  align-items: center;
}

.profile-image img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-info {
  margin-left: 15px;
}

.profile-info h3 {
  font-size: 16px;
  margin-bottom: 5px;
}

.profile-info p {
  font-size: 14px;
  color: #aaa;
}

/* Search Form */
.search-form {
  display: flex;
  margin-bottom: 15px;
}

.search-form input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 4px 0 0 4px;
  background-color: #333;
  color: #fff;
}

.search-form button {
  background-color: #1DB954;
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  padding: 0 15px;
  cursor: pointer;
}

/* Search Results */
.search-results-container {
  max-height: 300px;
  overflow-y: auto;
}

.user-search-result {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #333;
  cursor: pointer;
  transition: background-color 0.2s;
}

.user-search-result:hover {
  background-color: #333;
}

.result-image img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.result-info {
  margin-left: 10px;
  flex: 1;
}

.result-username {
  font-size: 14px;
  margin-bottom: 5px;
}

.result-bio {
  font-size: 12px;
  color: #aaa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follow-button {
  background-color: #1DB954;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.follow-button:hover {
  background-color: #1ed760;
}

.follow-button.following {
  background-color: #333;
}

/* Post Creation */
.post-creation-card {
  background-color: #222;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.post-creation-header {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  flex-wrap: nowrap; /* Prevent wrapping on mobile */
  width: 100%;
}

.post-creation-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0; /* Prevent avatar from shrinking */
}

/* AGGRESSIVE MOBILE FIXES - FORCE SAME LINE LAYOUT */
@media (max-width: 767px) {
  .post-creation-header {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  .post-creation-header img {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0 !important;
    flex-basis: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
  }
  
  .post-creation-card textarea {
    flex: 1 !important;
    min-width: 0 !important;
    width: calc(100% - 50px) !important;
    max-width: calc(100% - 50px) !important;
    height: 80px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
  }
}

/* EXTRA AGGRESSIVE FOR VERY SMALL SCREENS */
@media (max-width: 480px) {
  .post-creation-header {
    gap: 8px !important;
  }
  
  .post-creation-card textarea {
    width: calc(100% - 48px) !important;
    max-width: calc(100% - 48px) !important;
    padding: 8px !important;
    font-size: 13px !important;
  }
}

.post-header {
  display: flex;
  margin-bottom: 15px;
}

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

.post-creation-card textarea {
  flex: 1;
  height: 100px;
  padding: 10px;
  border: none;
  border-radius: 4px;
  background-color: #333;
  color: #fff;
  resize: none;
  min-width: 0; /* Allow textarea to shrink below its content width */
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.media-options {
  display: flex;
}

.media-button {
  background-color: transparent;
  color: #aaa;
  border: none;
  padding: 8px 12px;
  margin-right: 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.media-button:hover {
  background-color: #333;
  color: #fff;
}

.submit-button {
  background-color: #1DB954;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.submit-button:hover {
  background-color: #1ed760;
}

.media-preview {
  margin-top: 15px;
  padding: 10px;
  background-color: #333;
  border-radius: 4px;
}

.media-preview.hidden {
  display: none;
}

/* Feed Tabs */
.feed-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #333;
}

.tab-button {
  background-color: transparent;
  color: #aaa;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 16px;
}

.tab-button.active {
  color: #1DB954;
  border-bottom: 2px solid #1DB954;
}

.tab-button:hover {
  background-color: #333;
}

/* Posts Container */
.posts-container {
  margin-bottom: 40px;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top: 4px solid #1DB954;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Post Card */
.post-card {
  background-color: #222;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Highlighted post when navigating from notifications */
.post-card.highlighted {
  box-shadow: 0 0 15px rgba(29, 185, 84, 0.8);
  transform: scale(1.01);
  border: 1px solid rgba(29, 185, 84, 0.4);
}

.post-user-info {
  margin-left: 15px;
  flex: 1;
}

.post-username {
  font-size: 16px;
  margin: 0;
}

.post-time {
  font-size: 12px;
  color: #aaa;
}

/* Post Menu Styles */
.post-menu-container {
  position: relative;
  margin-left: auto;
}

.post-menu-button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s ease, color 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-menu-button:hover {
  background-color: #333;
  color: #fff;
}

.post-menu-button.hidden {
  display: none;
}

.post-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #333;
  border: 1px solid #444;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 150px;
  z-index: 1000;
  overflow: hidden;
}

.post-menu-dropdown.hidden {
  display: none;
}

.post-menu-dropdown button {
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-menu-dropdown button:hover {
  background-color: #444;
}

.post-menu-dropdown .delete-post-button {
  color: #ff4444;
}

.post-menu-dropdown .delete-post-button:hover {
  background-color: #ff4444;
  color: #fff;
}

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

/* Edit Post Modal Styles */
.edit-post-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.edit-post-modal .modal-content {
  background-color: #222;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.edit-post-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #333;
}

.edit-post-modal .modal-header h3 {
  margin: 0;
  color: #fff;
}

.edit-post-modal .close-modal {
  background: none;
  border: none;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-post-modal .close-modal:hover {
  color: #fff;
}

.edit-post-modal .modal-body {
  padding: 20px;
}

.edit-post-modal .form-group {
  margin-bottom: 15px;
}

.edit-post-modal .form-group label {
  display: block;
  margin-bottom: 5px;
  color: #fff;
  font-weight: 500;
}

.edit-post-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid #333;
  border-radius: 6px;
  background-color: #333;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}

.edit-post-textarea:focus {
  outline: none;
  border-color: #1DB954;
}

.edit-post-media-preview {
  margin-top: 15px;
  padding: 10px;
  background-color: #333;
  border-radius: 4px;
  display: none;
}

.edit-post-media-preview.has-media {
  display: block;
}

.edit-post-media-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
}

.edit-post-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid #333;
  /* Fixed positioning to clear bottom menu on all screen sizes */
  padding-bottom: 80px; /* Desktop: 60px bottom menu + 20px clearance */
}

/* Mobile devices - smaller bottom menu */
@media screen and (max-width: 767px) {
  .edit-post-modal .modal-footer {
    padding-bottom: 55px; /* Mobile: 35px bottom menu + 20px clearance */
  }
}

.edit-post-modal .cancel-edit {
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.edit-post-modal .cancel-edit:hover {
  background-color: #444;
}

.edit-post-modal .save-edit {
  background-color: #1DB954;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.edit-post-modal .save-edit:hover {
  background-color: #1ed760;
}

.edit-post-modal .save-edit:disabled {
  background-color: #666;
  cursor: not-allowed;
}

.post-content {
  margin: 15px 0;
  line-height: 1.5;
}

/* Base media styling for both mobile and desktop */
.post-media {
  margin: 15px 0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.post-media img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
}

.post-media audio, .post-media video {
  width: 100%;
  display: block;
}

/* Mobile-specific styling for edge-to-edge media */
@media (max-width: 767px) {
  .post-card {
    padding: 15px 0 0 0;
    border-radius: 0;
    margin-bottom: 8px;
    background-color: #1a1a1a;
  }
  
  .post-content {
    padding: 0 15px;
  }
  
  .post-header {
    padding: 0 15px 15px 15px;
  }
  
  /* Edge-to-edge media container */
  .post-media {
    width: 100vw;
    margin: 0 -15px;
    border-radius: 0;
    left: 0;
    right: 0;
    position: relative;
  }
  
  /* Full-width images like Instagram */
  .post-media img {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: cover;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }
  
  /* Full-width videos like Instagram */
  .post-media video {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background-color: #000;
  }
  
  /* Audio players need slight padding */
  .post-media audio {
    width: calc(100vw - 10px);
    max-width: calc(100vw - 10px);
    margin: 0 5px;
    padding: 0;
    border: 0;
  }
  
  /* Add Instagram-like padding for actions */
  .post-actions {
    padding: 8px 15px;
    margin-top: 8px;
    gap: 6px;
  }
  
  /* Loading indicators should also be edge-to-edge */
  .loading-media {
    width: 100vw;
    border-radius: 0;
    margin: 0;
    padding: 15px 0;
  }
}

/* Desktop styling refinements */
@media (min-width: 768px) {
  .post-media {
    border-radius: 8px;
    margin: 15px 0;
  }
  
  .post-media img {
    max-height: 600px;
    border-radius: 8px;
    object-fit: contain;
  }
  
  .post-media video, .post-media audio {
    border-radius: 8px;
  }
}

.post-actions {
  display: flex;
  padding: 8px 10px;
  border-top: 1px solid #444;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.like-button, .comment-button, .share-button, .delete-button {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  padding: 5px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
  margin-right: 8px;
}

.like-button:hover, .comment-button:hover {
  color: #1DB954;
}

.like-button.liked {
  color: #E5446D;
}

.like-button.liked i {
  font-weight: 900;
}

/* New like section styling */
.like-section {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.like-button {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.like-button:hover {
  color: #1DB954;
  background: rgba(29, 185, 84, 0.1);
}

.like-button.liked {
  color: #E5446D;
  background: rgba(229, 68, 109, 0.1);
}

.like-button.liked i {
  font-weight: 900;
}

.like-button.liked .liked-guitar {
  color: #E5446D;
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* Improve touch target on phones/tablets */
@media (hover: none) and (pointer: coarse) {
  .like-button {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
}

.like-count-display {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #aaa;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.like-count-display:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Hide on very small screens */
@media (max-width: 480px) {
  .like-count-display {
    max-width: 120px;
  }
}

/* Like popup styling */
.likes-popup {
  position: absolute;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-width: 300px;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
}

.likes-popup-header {
  font-weight: bold;
  margin-bottom: 8px;
  color: #fff;
  border-bottom: 1px solid #444;
  padding-bottom: 8px;
}

.likes-popup-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.likes-popup-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #333;
}

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

.likes-popup-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.likes-popup-username {
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.likes-popup-username:hover {
  color: #1DB954;
}

.likes-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
}

.likes-popup-close:hover {
  color: #fff;
}

.share-button {
  margin-left: auto; /* Push to right side */
  margin-right: 0; /* Override the common margin-right */
  color: #aaa;
}

.share-button:hover {
  color: #1DB954;
}

.share-button i {
  font-size: 16px;
}

.delete-button {
  color: #ff6b6b;
  margin-right: 0;
}

.delete-button.hidden {
  display: none;
}

.post-comments-container {
  margin-top: 15px;
  position: relative;
  padding-bottom: 10px;
}

.comments-list {
  margin-bottom: 15px;
  max-height: 300px;
  overflow-y: auto;
}

.comment-item {
  display: flex;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

.comment-user-image {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 10px;
}

.comment-content {
  flex: 1;
  position: relative;
  padding-right: 25px;
}

.comment-username {
  font-weight: bold;
  margin-right: 5px;
}

.comment-text {
  word-break: break-word;
  margin-right: 20px;
}

.comment-time {
  font-size: 12px;
  color: #aaa;
  margin-top: 5px;
}

/* Add comment input styling */
.add-comment {
  display: flex;
  width: 100%;
  gap: 8px;
  position: relative;
  align-items: center;
}

.comment-input-container {
  position: relative;
  width: 100%;
  flex: 1;
}

.comment-input {
  width: 96%;
  padding: 8px 12px;
  border: 1px solid #555;
  background: #444;
  color: #fff;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.2;
  height: 18px;
}

.submit-comment {
  padding: 8px 14px;
  background: #1DB954;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  height: 36px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow: auto;
}

.modal-content {
  background-color: #333;
  margin: 10% auto;
  padding: 30px;
  width: 80%;
  max-width: 500px;
  border-radius: 8px;
  position: relative;
}

/* Enhanced Edit Profile Modal Styles */
#edit-profile-modal .modal-content {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 5vh auto;
}

#edit-profile-modal .form-group {
  margin-bottom: 20px;
}

#edit-profile-modal .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #ddd;
  font-size: 14px;
}

#edit-profile-modal .form-group input,
#edit-profile-modal .form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #444;
  border-radius: 6px;
  background-color: #222;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

#edit-profile-modal .form-group input:focus,
#edit-profile-modal .form-group textarea:focus {
  border-color: #1DB954;
  outline: none;
}

#edit-profile-modal textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

#edit-profile-modal .submit-button {
  background-color: #1DB954;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.2s;
}

#edit-profile-modal .submit-button:hover {
  background-color: #1ed760;
}

/* SoundCloud tracks styling in modal */
.soundcloud-track-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.soundcloud-track-url,
.soundcloud-track-title {
  flex: 1;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #222;
  color: #fff;
  font-size: 14px;
}

.remove-track-btn {
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

.add-track-btn {
  background: #1DB954;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
}

.char-count {
  font-size: 12px;
  color: #aaa;
  text-align: right;
  margin-top: 5px;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 4px;
  background-color: #222;
  color: #fff;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Mobile Modal Improvements */
@media (max-width: 768px) {
  .modal {
    padding: 10px;
    z-index: 5000;
  }
  
  .modal-content {
    margin: 5vh auto !important;
    width: 95% !important;
    max-width: none !important;
    padding: 20px !important;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
  }
  
  #edit-profile-modal .modal-content {
    margin: 3vh auto !important;
    max-height: 94vh;
  }
  
  #edit-profile-modal h2 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-right: 50px; /* Space for close button */
  }
  
  #edit-profile-modal .form-group {
    margin-bottom: 16px;
  }
  
  #edit-profile-modal .form-group input,
  #edit-profile-modal .form-group textarea {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 14px 12px;
  }
  
  .soundcloud-track-item {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  
  .soundcloud-track-url,
  .soundcloud-track-title {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px;
  }
  
  .remove-track-btn {
    align-self: flex-end;
    margin-top: 5px;
  }
  
  .close-modal {
    font-size: 28px;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    line-height: 1;
  }
  
  .close-modal:hover {
    background: rgba(0, 0, 0, 0.5);
  }
}

@media (max-width: 480px) {
  .modal {
    padding: 5px;
  }
  
  .modal-content {
    margin: 2vh auto !important;
    width: 98% !important;
    padding: 15px !important;
    border-radius: 8px;
  }
  
  #edit-profile-modal .modal-content {
    margin: 1vh auto !important;
    max-height: 98vh;
  }
  
  #edit-profile-modal h2 {
    font-size: 16px;
    margin-bottom: 15px;
  }
  
  #edit-profile-modal .form-group {
    margin-bottom: 12px;
  }
  
  #edit-profile-modal .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .soundcloud-track-item {
    margin-bottom: 8px;
  }
  
  .close-modal {
    font-size: 24px;
    width: 32px;
    height: 32px;
    top: 10px;
    right: 10px;
  }
}

/* Media query for responsive design */
@media (max-width: 900px) {
  .social-container {
    flex-direction: column;
    padding: 0 10px;
  }
  
  .sidebar {
    width: 100%;
    margin-right: 0;
    margin-bottom: 20px;
    height: auto;
    position: static;
  }
  
  .feed-container {
    width: 100%;
  }
}

/* Header Styles */
.main-header {
  background-color: #111;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  /* iOS Safe Area Support with fallbacks */
  padding-top: var(--safe-area-inset-top);
  padding-left: var(--safe-area-inset-left);
  padding-right: var(--safe-area-inset-right);
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px;
}

.nav-logo {
  font-size: 24px;
  font-weight: bold;
  color: #1DB954;
  text-decoration: none;
}

.nav-links {
  display: flex;
}

.nav-links a {
  color: #aaa;
  text-decoration: none;
  margin-left: 30px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #fff;
}

.nav-links a.active {
  color: #1DB954;
}

/* Utilities */
.hidden {
  display: none;
}

/* Links in posts and comments */
.post-content a,
.comment-text a {
  color: #1DB954;
  text-decoration: none;
  word-break: break-word;
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
  padding: 2px 0;
  font-weight: 500;
}

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

/* Style for @mention tags */
.post-content a.mention,
.comment-text a.mention {
  color: #1DB954; 
  font-weight: 600;
  background-color: rgba(29, 185, 84, 0.1);
  padding: 2px 5px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.post-content a.mention:hover,
.comment-text a.mention:hover {
  background-color: rgba(29, 185, 84, 0.2);
  text-decoration: none;
}

/* For touchscreens, make links easier to press */
@media (hover: none) and (pointer: coarse) {
  .post-content a,
  .comment-text a {
    padding: 4px 2px;
    margin: 0 -2px;
  }
  
  .post-content a.mention,
  .comment-text a.mention {
    padding: 4px 6px;
  }
}

/* Ensure images are non-zoomable and non-saveable, but allow taps for double-tap like */
.post-media img {
  -webkit-touch-callout: none !important;  /* iOS Safari */
  -webkit-user-select: none !important;  /* Safari */
  user-select: none !important;   /* Prevent text selection */
  pointer-events: auto !important;  /* Allow tap/double-tap interactions */
  -webkit-user-drag: none !important;  /* Safari */
  -khtml-user-drag: none !important;  /* Konqueror */
  -moz-user-drag: none !important;  /* Firefox */
  -ms-user-drag: none !important;  /* IE */
  user-drag: none !important;  /* Generic */
  touch-action: manipulation;  /* Prefer taps without blocking scroll */
}

/* Prevent videos from being downloadable */
.post-media video {
  -webkit-touch-callout: none !important;
  pointer-events: auto !important;  /* Allow touch for playback controls */
}

/* Delete button for comments */
.delete-comment-button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 12px;
  padding: 4px;
  cursor: pointer;
  transition: color 0.2s;
  margin-left: 5px;
  position: absolute;
  top: 5px;
  right: 5px;
}

.delete-comment-button:hover {
  color: #ff6b6b;
}

/* Enhanced Comment mention suggestion styling */
.mention-suggestions {
  position: fixed;
  z-index: 9999;
  background-color: #222;
  border-radius: 8px;
  box-shadow: 0 0 0 2px #1DB954, 0 4px 12px rgba(0, 0, 0, 0.8);
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  max-width: 300px;
  border: 1px solid #555;
  display: none;
  animation: fadeInSuggestions 0.2s ease-in;
}

@keyframes fadeInSuggestions {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.suggestion-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  border-bottom: 1px solid #444;
  -webkit-user-select: none;
  user-select: none;
}

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

.suggestion-item:hover,
.suggestion-item.selected {
  background-color: #444;
  transform: translateX(2px);
}

.suggestion-item.selected {
  background-color: #333;
  border-left: 3px solid #1DB954;
}

.suggestion-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
  border: 2px solid #555;
  transition: border-color 0.2s;
}

.suggestion-item:hover .suggestion-avatar,
.suggestion-item.selected .suggestion-avatar {
  border-color: #1DB954;
}

.suggestion-username {
  color: #1DB954;
  font-weight: 600;
  font-size: 14px;
}

/* Enhanced mention styling in comments */
.comment-text .mention {
  color: #1DB954;
  font-weight: 600;
  background-color: rgba(29, 185, 84, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid rgba(29, 185, 84, 0.3);
}

.comment-text .mention:hover {
  background-color: rgba(29, 185, 84, 0.25);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(29, 185, 84, 0.2);
}

/* Comment input with mentions */
.comment-input.has-mentions {
  border-color: #1DB954 !important;
}

/* Make sure the mention suggestions are visible when shown */
.mention-suggestions[style*="display: block"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Share modal styles */
.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.share-modal-content {
  background-color: #333;
  padding: 20px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.share-platform-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.share-platform-button:hover {
  background-color: #444;
}

.share-platform-button i {
  font-size: 24px;
  margin-bottom: 5px;
}

.share-platform-button span {
  font-size: 12px;
} 