/* ==========================================================================
   VIEW PAGE SPECIFIC (view.php)
   ========================================================================== */

/* Basis-Layout: Mobil & Tablets */
.view-grid-layout {
  max-width: 1400px;
  margin: 0 auto;
  grid-template-columns: 1fr 1.2fr;
  grid-template-areas:
    "image comments"
    "info comments"
    "more more";
}

.view-image-container,
.view-comments-container,
.view-info-container,
.view-more-container {
  min-width: 0;
}

.view-grid-layout .artist {
  color: var(--text-main);
  font-style: normal;
}

.view-grid-layout section {
  max-width: none;
  margin: 0;
  padding: 15px;
}

.view-comment-header .artwork-title,
.view-artwork-header .artwork-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
}

.view-comment-header {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 15px;
}

.comment-list {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 10px;
  margin-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color-main) transparent;
}

.more-link-open,
.more-link-close {
  color: var(--text-main);
  cursor: pointer;
  font-size: inherit;
  margin-left: 5px;
}

.more-link-open:hover,
.more-link-close:hover {
  color: var(--text-muted);
  text-decoration: underline;
}

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

main.view-main {
  max-width: 1400px !important;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Desktop-Layout */
@media (min-width: 900px) {
  .view-grid-layout {
    display: grid !important;
    grid-template-columns: 1fr 1.2fr !important;
    grid-template-areas:
      "image comments"
      "info info"
      "more more" !important;
    max-width: 100% !important;
    gap: 1rem;
  }
}

/* Kleine Bildschirme */
@media (max-width: 600px) {
  .view-image-container {
    width: 100%;
    max-width: 100%;
    padding: 15px;
    margin: 0 auto;
    min-width: 0;
  }

  .view-artwork img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
  }

  .view-image-container .artwork-title {
    font-size: 20px;
  }

  .interaction-stats {
    display: flex;
    justify-content: center;
    width: 100%;
  }
}

/* IMAGE-CONTAINER */
.view-image-container {
  grid-area: image;
  background: var(--border-color-main);
  border: 1px solid var(--border-color-main);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  min-width: 0;
  align-self: start;
}
.view-artwork-header {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
}
.view-image-container .artwork-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main);
}
.view-image-container .artist {
  color: var(--text-muted);
}
.separator {
  color: var(--text-main);
}
.view-artwork {
  display: flex;
  justify-content: center;
}
.view-artwork img {
  max-width: 100%;
  object-fit: cover;
}
.view-artwork-placeholder {
  height: 400px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  width: 100%;
}
.interaction-stats {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}
.ajax-like-form {
  display: inline-block;
  margin-right: 10px;
}
.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.heart {
  cursor: pointer;
  font-size: 24px;
  display: inline-block;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
  position: relative;
}
.heart:hover {
  transform: scale(1.2);
}
.heart::before {
  content: "♡";
}
.heart.fa-solid {
  color: #e63946 !important;
}
@keyframes like-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.6);
  }
  70% {
    transform: scale(0.8);
  }
  100% {
    transform: scale(1);
  }
}
.heart.liked {
  animation: like-pop 0.3s ease;
}

/* COMMENTS-CONTAINER */
.view-comments-container {
  grid-area: comments;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.view-comment-header {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding-top: 20px;
}
.comment {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px;
}
.commment-avatar {

  width: 40px;
  height: 40px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.commment-avatar img {
  width: 40px;
  height: 40px;
  object-fit: cover;

}
.comment-body {
  flex: 1 1 auto;
  min-width: 0;
}
.comment-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.comment-user {
  margin: 0 0 5px 0;
}
.comment-date {
  font-size: 0.8em;
  color: #888;
  margin-left: 10px;
}
.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: #c24a4a;
}
.comment-delete-form {
  margin: 0;
}
.comment-text-container p {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  margin: 0;
  margin-top: 5px;
  line-height: 1.4;
}
.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-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  margin-top: 20px;
}
.comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  display: block;
  margin: 0;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--border-color-main);
  border-radius: 8px;
  resize: none;
  font-size: 14px;
  outline: none;
  transition:
    border 0.2s,
    box-shadow 0.2s;
  scrollbar-color: var(--bg-button) transparent;
}
.comment-form textarea::-webkit-scrollbar-track {
  background: transparent;
}
.comment-form textarea::-webkit-scrollbar-thumb {
  background: var(--bg-button);
  border-radius: 999px;
}
.comment-form textarea::-webkit-scrollbar-thumb:hover {
  background: var(--bg-button-hover);
}
.comment-form textarea:focus {
  border-color: var(--bg-button);
  box-shadow: 0 0 5px
    color-mix(in srgb, var(--bg-button-hover) 40%, transparent);
}
.comment-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  box-sizing: border-box;
}
#counter {
  font-size: 12px;
}
.comment-form button {
  align-self: center;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background-color: var(--bg-button);
  color: white;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.1s;
}
.comment-form button:hover {
  background-color: var(--bg-button-hover);
}
.comment-form button:active {
  transform: scale(0.97);
}
.comment-login-required {
  display: flex;
  flex-direction: column;
  align-content: baseline;
  align-items: center;
  padding: 10px;
  margin: 10px;
  margin-top: 15px;
  text-align: center;
}
.comment-login-required p {
  font-size: 12px;
}
.no-comments-msg {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

/* INFO-CONTAINER */
.view-info-container {
  grid-area: info;
}
.view-info {
  border-bottom: 1px solid var(--border-color-main);
  padding: 10px;
}
.view-info > * {
  padding: 10px 0;
}
.view-info > * + * {
  border-top: 1px solid var(--border-color-main);
}
.view-info summary {
  cursor: pointer;
}
.view-see-more {
  font-weight: bold;
}
.artist-details,
.description-details {
  padding: 5px 0;
}
details summary::marker {
  color: var(--text-main);
}
details {
  overflow: hidden;
}
details[open] > *:not(summary) {
  animation: slideDown 0.4s ease;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
summary {
  list-style: none;
  position: relative;
  padding-right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: "↓";
  transition: transform 0.3s ease;
}
details[open] > summary::after {
  content: "↑";
}

/* VIEW-MORE-CONTAINER */
.view-more-container {
  grid-area: more;
}
.view-image-container img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.more-images-scroll {
  display: flex;
  gap: 60px;
  overflow-x: auto;
  padding: 20px 0;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--bg-button) transparent;
}
.more-images-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.more-images-scroll::-webkit-scrollbar-thumb {
  background: var(--bg-button);
  border-radius: 999px;
}
.more-images-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--bg-button-hover);
}
.more-image-box {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color-main);
  background: var(--border-color-main);
  min-width: 300px;
  height: 320px;
  scroll-snap-align: start;
  padding: 15px;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
}
.more-image-box:hover {
  text-decoration: none;
}
.more-image-box .view-artwork {
  display: flex;
  min-width: 250px;
  height: 250px;
  flex-shrink: 0;
  margin-top: 15px;
}
.more-artist-paintings-empty {
  padding: 10px;
  color: #666;
}
.more-artwork-thumb {
  height: 150px;
  overflow: hidden;
  border-radius: 4px;
}
.more-artwork-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.more-artwork-placeholder {
  background: #eee;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.more-artwork-title {
  margin-top: 5px;
  font-weight: bold;
  font-size: 0.9em;
}
