/* card-styles.css */

/* Common styles for Card Preview Modal */
.card-preview-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card-preview-content {
  background: #1A1A1A;
  border-radius: 8px;
  max-width: 1000px;
  width: 100%;
  padding: 2rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.card-preview-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-preview-images {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.card-preview-image {
  text-align: center;
}

.card-preview-image img {
  max-height: 400px;
  max-width: 100%;
  border-radius: 8px;
  border: 2px solid #333;
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.card-preview-image img:hover {
  opacity: 0.9;
}

.card-preview-image p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #aaa;
}

.card-preview-details h3 {
  margin-top: 0;
  color: #F5B700;
  font-size: 1.5rem;
}

.card-preview-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

/* Like Feature Styles */
/* .like-action-group is being replaced by .like-group and .favorite-like-wrapper */
/*
.like-action-group {
  display: flex;
  align-items: center;
  gap: 0.25rem; / Space between thumb and count /
}
*/

/* NEW ACTION STYLES START */
.card-action-cluster {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Right-align items within the cluster */
    gap: 0.5rem; /* Space between share button, icon row, and count */
}

.fav-like-icons-row {
    display: flex;
    flex-direction: row;
    align-items: center; /* Vertically center fav and like icons */
    gap: 0.5rem; /* Space between favorite and like icons */
}
/* NEW ACTION STYLES END */

/* Obsolete .favorite-like-wrapper and .like-group are removed */

.like-thumb {
  font-size: 1.6rem; /* Adjusted to be visually balanced with favorite star */
  color: #555; /* Default color for inactive, same as favorite */
  cursor: pointer;
  user-select: none; /* Prevent text selection on click */
  transition: color 0.2s ease; /* Smooth color transition */
}

.like-thumb:hover {
  color: #777; /* Slightly lighter on hover for inactive */
}

.like-thumb.active {
  color: #3498db; /* Blue for active like, as previously chosen */
}

.like-thumb.active:hover {
  color: #2980b9; /* Darker blue on hover for active */
}

.like-count {
  font-size: 0.9rem; /* Slightly smaller than main text, similar to other meta */
  color: #aaa; /* Lighter gray for count */
  /* margin-left: 0.1rem; Removed as it's now vertically stacked or aligned by parent */
  user-select: none;
}

/* Card Header Alignment */
.card-info-section > .card-header { /* Specific to card.php context */
  display: flex;
  justify-content: space-between;
  align-items: baseline; /* Changed from flex-start */
}

/* For collection.php, gallery.php */
.card-details-header {
  display: flex;
  align-items: baseline; /* Changed from flex-start */
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

/* --- Icon and Count Sizing --- */

/* General favorite-star style (applies to collection/gallery contexts by default) */
.favorite-star {
  color: #F5B700;
  font-size: 1.5rem;
  cursor: pointer;
  user-select: none;
}

.favorite-star.active {
  color: #F5B700;
}

.favorite-star.inactive {
  color: #555;
}

/* General like thumb size for collection/gallery */
/* Targets .card-action-cluster within .card-details-header (collection.php, gallery.php) */
.card-details-header .card-action-cluster .fav-like-icons-row .like-thumb {
  font-size: 1.4rem;
}
/* General like-count for these contexts uses the default .like-count style (0.9rem) */


/* Specific Icon Sizing for card.php context */
/* Targets .card-action-cluster within .card-info-section > .card-header */
.card-info-section > .card-header > .card-action-cluster .fav-like-icons-row .favorite-star {
  font-size: 2rem;
}
.card-info-section > .card-header > .card-action-cluster .fav-like-icons-row .like-thumb {
  font-size: 1.8rem;
}
.card-info-section > .card-header > .card-action-cluster .like-count {
  font-size: 1rem;
}


/* Obsolete rules for .card-actions, .card-item-actions, .card-actions-row relating to old structure's icon sizing are removed. */
/* The generic layout rule for these was already commented out in a previous step. */


.card-preview-title-row h3 {
  margin: 0;
  color: #F5B700;
  font-size: 1.5rem;
}

.favorite-star {
  color: #F5B700;
  font-size: 1.5rem;
  cursor: pointer;
  user-select: none;
}

.favorite-star.active {
  color: #F5B700;
}

.favorite-star.inactive {
  color: #555;
}

.card-preview-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card-preview-metadata span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-preview-description {
  margin-bottom: 1.5rem;
  line-height: 1.6;
  background: #222;
  padding: 1rem;
  border-radius: 4px;
}

/* Full Screen Image Modal */
.fullscreen-image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 3000;
  overflow: hidden;
}

.fullscreen-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3100;
  display: flex;
  gap: 10px;
}

.fullscreen-close {
  background: rgba(93, 58, 155, 0.8);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.fullscreen-close:hover {
  background: rgba(93, 58, 155, 1);
}

.zoom-controls {
  display: flex;
  gap: 5px;
  background: rgba(26, 26, 26, 0.8);
  padding: 5px;
  border-radius: 8px;
}

.zoom-controls button {
  background: rgba(93, 58, 155, 0.8);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.zoom-controls .zoom-reset {
  width: auto;
  padding: 0 10px;
  font-size: 14px;
}

.zoom-controls button:hover {
  background: rgba(93, 58, 155, 1);
}

.fullscreen-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fullscreen-image-container img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  cursor: grab;
  transform-origin: center;
  transition: transform 0.1s ease-out;
}

.fullscreen-image-container img.active-pan {
  cursor: grabbing;
}

/* Share Button Styles */
.share-btn-grid {
  background: #5D3A9B;
  color: #fff;
  border: none;
  padding: 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
}

.share-btn-grid:hover {
  background: #4C2D8A;
}

.share-btn-grid svg,
.share-btn-modal svg {
  width: 16px;
  height: 16px;
  stroke: white;
  fill: none;
}

.share-btn-modal {
  background: #5D3A9B;
  color: #fff;
  border: none;
  padding: 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  width: 30px;
  height: 30px;
}

.share-btn-modal:hover {
  background: #4C2D8A;
}

/* Copy Notification */
.copy-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #2ecc71;
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10000;
  pointer-events: none;
}

.copy-notification.show {
  opacity: 1;
}

/* Card Actions Row for Grid View */
.card-actions-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}