/* ==========================================================================
   USER PROFILE GRID
   ========================================================================== */
.user-profile {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  background: var(--border-color-main);
  padding: 20px 30px;
  border-radius: 8px;
}

.user-profile-header {
  width: 100%;
  position: relative;
  border-bottom: 1px solid var(--bg-secondary);
  padding-bottom: 15px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70px;
}

.user-profile-title {
  margin: 0;
  font-size: 20px;
}

.user-profile .button-link {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(calc(-50% - 7.5px));
  width: 50px;
  height: 50px;
  padding: 0;
}

.user-profile-data {
  flex: 1;
  min-width: 250px;
}

.user-profile-pic {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border-color: var(--bg-main);
}
.user-profile-pic img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
}

.user-profile-pic div {
  width: 150px;
  height: 150px;
  background: var(--bg-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-profile-pic i {
  font-size: 40px;
  color: #666;
}

/* ==========================================================================
   TABS & SORTING
   ========================================================================== */
.user-tabs-wrapper {
  padding: 2.2rem;
  padding-bottom: 0rem;
}

.user-tabs {
  display: flex;
  gap: 10px;
  margin-top: 25px;
  border-bottom: 1px solid var(--border-color-main);
}

.user-tabs a {
  padding: 12px 20px;
  border-radius: 6px 6px 0 0;
  background-color: var(--border-color-main);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid var(--bg-border-button);
  border-bottom: none;
}

.user-tabs a:hover {
  background-color: var(--bg-secondary);
  color: var(--text-main);
  text-decoration: none;
}

.user-tabs a.active {
  color: var(--bg-main);
  background-color: var(--bg-button);
  margin-bottom: -1px;
}

.user-like-section {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: baseline;
  margin: 0 auto 20px auto;
}

.user-liked {
  font-size: 24px;
}

details.sort-dropdown {
  position: relative;
}

.sort-toggle {
  cursor: pointer;
  font-weight: bold;
}

.sort-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-main);
  border: 1px solid var(--border-color-main);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  z-index: 100;
  list-style: none;
  margin: 10px 0 0 0;
  padding: 5px 0;
  min-width: 200px;
  border-radius: 4px;
}

.sort-menu li {
  padding: 10px 15px;
  transition: 0.2s ease;
}

.sort-menu a {
  color: var(--text-main);
  text-decoration: none;
  display: block;
}

.sort-menu a.active {
  font-weight: bold;
  color: var(--bg-border-button);
}

.sort-menu a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   GRID & COMMENTS
   ========================================================================== */
.empty-gallery-msg {
  grid-column: 1 / -1;
  text-align: center;
  color: #666;
  padding: 40px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 40px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.image-card {
  overflow: hidden;
  padding: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  background: var(--border-color-main);
  position: relative;
  border-radius: 4px;
}

.image-card a {
  text-decoration: none;
  color: inherit;
}

.image-card a:hover {
  text-decoration: none;
}

.image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.image-card:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.artwork-header {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  margin-top: 10px;
}

.user-comments {
  padding: 2.2rem;
  padding-top: 1.5rem;
}

.comment-card {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  border: 1px solid var(--border-color-main);
  border-radius: 8px;
  margin-bottom: 20px;
  transition: background 0.2s ease;
}

.comment-image-link {
  display: block;
  flex: 0 0 80px;
  text-decoration: none;
}

.comment-image-link:hover {
  text-decoration: none;
}

.comment-image-link img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color-main);
  transition: 0.2s ease;
}

.comment-image-link:hover img {
  transform: scale(1.05);
  filter: brightness(0.9);
}

.comment-image-placeholder {
  width: 80px;
  height: 80px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #666;
  border-radius: 4px;
}

.comment-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.comment-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.comment-content h3 {
  margin: 0 0 5px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.comment-content .artist {
  font-weight: bold;
  font-size: 0.9em;
  margin: 0 0 10px 0;
}

.comment-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.comment-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.comment-action-btn.edit {
  color: var(--text-main);
}

.comment-action-btn.delete {
  color: #c0392b;
}

.comment-delete-form {
  margin: 0;
}

.comment-text {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.more-link-open,
.more-link-close {
  cursor: pointer;
  font-weight: bold;
}

.more-link-close {
  margin-left: 5px;
}

.comment-edit-form {
  margin-top: 10px;
  width: 100%;
}

.comment-edit-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid var(--border-color-main);
  font-family: inherit;
  resize: vertical;
}

.comment-edit-actions {
  margin-top: 8px;
  text-align: right;
}

.btn-cancel-edit {
  background: #e0e0e0;
  color: #333;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 8px;
}

.btn-save-edit {
  background: var(--bg-button);
  color: var(--bg-main);
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.comment-content small {
  font-size: 0.75rem;
  color: #888;
}
