
/* Styles specific to the library page */

/* Story card styles */
.story-card {
  border-radius: var(--radius);
  overflow: hidden;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* prevents content spill during transition */
  justify-content: space-between; /* NEW */
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.story-card.collapsing {
  opacity: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.story-cover-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
}

.story-cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-card-content {
  padding: 1rem;
}

.story-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: var(--foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2; /* LIMIT TO 2 LINES */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-date {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.story-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto; /* pushes to bottom */
}

.story-actions .action-group {
  display: flex;
  gap: 0.5rem; /* Adjust spacing between Share and Delete */
}

/* Empty library message */
#empty-library-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

/* Delete confirmation modal */
.modal-body {
  color: var(--foreground);
}

.bg-destructive {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
}

.spinner {
  display: inline-flex;
  align-items: center;
  margin-left: 1rem;
}

.spinner.hidden {
  display: none;
}

.animate-spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Optional: More modern look for the text */
.spinner .text-sm {
  font-size: 0.92rem;
  color: #555;
  margin-left: 0.5rem;
}

.modal-footer.loading {
  pointer-events: none;
  opacity: 0.7;
}


.story-cover-image.shimmer {
  position: relative;
  overflow: hidden;
  background-color: #eee;
}

.story-cover-image.shimmer img {
  visibility: hidden;
}

.story-cover-image.shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150px;
  width: 100px;
  height: 100%;
  background: linear-gradient(to right, transparent 0%, #f0f0f0 50%, transparent 100%);
  animation: shimmer 1.8s infinite;
  z-index: 2;
}

@keyframes shimmer {
  0% { left: -150px; }
  100% { left: 100%; }
}


.loading-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: #848484;
    background: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.scroll-row {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.scroll-item {
  flex: 0 0 auto;
  width: 200px;
  scroll-snap-align: start;
}

.scroll-row::-webkit-scrollbar {
  display: none;
}
.scroll-row {
  scrollbar-width: none;
}

.story-card-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

hr {
  height: 1px;
  border:0.02px;
  background-color: lightgray
}


.genre-links {
  display: flex;
  gap: 0.5rem;
}

.genre-pill {
  display: inline-block;
  white-space: nowrap;
  background-color: var(--input);
  color: #334155;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.genre-pill:hover {
  background-color: #e2e8f0;
  border-color: #cbd5e1;
  color: #1e293b;
}

.genre-pill.premium::after {
  content: ' 👑';
  font-size: 0.9em;
}

.seller-cta {
  background-color: hsl(215.4deg 16.3% 46.9% / 82%);
  color:white
}

.btn-primary.seller-cta:hover {
  background-color: var(--muted-foreground) !important; 
  color: white;
}