/* User Lists Tab Styles */

/* Profile Inner Tabs */
.profile-inner-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.profile-inner-tab {
  flex: 1;
  padding: 0.7rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.profile-inner-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ddd;
}

.profile-inner-tab.active {
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.2) 0%, rgba(74, 158, 255, 0.1) 100%);
  color: #4a9eff;
  border-color: rgba(74, 158, 255, 0.3);
  box-shadow: 0 -2px 8px rgba(74, 158, 255, 0.15);
}

.profile-inner-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #4a9eff;
}

.profile-inner-content {
  display: none;
}

.profile-inner-content.active {
  display: block;
}

/* Sign-in prompt for non-authenticated users */
.user-signin-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 2rem;
}

.signin-prompt-content {
  text-align: center;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.03);
  padding: 3rem 2rem;
  border-radius: 16px;
  border: 2px solid rgba(74, 158, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.signin-prompt-icon {
  font-size: 80px;
  color: #4a9eff;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.signin-prompt-content h3 {
  font-size: 1.5rem;
  color: #fff;
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.signin-prompt-content p {
  color: #aaa;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 2rem 0;
}

.user-tab-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, #4a9eff, #3a7acc);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
  transition: all 0.3s ease;
}

.user-tab-signin-btn:hover {
  background: linear-gradient(135deg, #3a7acc, #2a5a9c);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

.user-tab-signin-btn:active {
  transform: translateY(0);
}

.user-tab-signin-btn .material-icons {
  font-size: 1.2rem;
}

/* Header section with create button */
.user-lists-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem 0;
}

.create-list-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.15) 0%, rgba(74, 158, 255, 0.08) 100%);
  color: #4a9eff;
  border: 2px solid rgba(74, 158, 255, 0.3);
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(74, 158, 255, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.create-list-btn:hover {
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.25) 0%, rgba(74, 158, 255, 0.15) 100%);
  border-color: rgba(74, 158, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.3);
  color: #60a5fa;
}

.create-list-btn:active {
  transform: translateY(-1px);
}

.create-list-btn .material-icons {
  font-size: 1.15rem;
}

/* Lists container */
#user-lists-container {
  position: relative;
  min-height: 200px;
  padding-bottom: 3rem; /* Add bottom padding for better scrolling */
}

.lists-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: #aaa;
  gap: 1rem;
}

.no-lists-message {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
}

.no-lists-message p {
  margin: 0.5rem 0;
  font-size: 1rem;
}

.no-lists-message p:first-child {
  font-size: 1.1rem;
  font-weight: 600;
}

/* List cards */
#user-lists-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 2rem; /* Additional padding for last items */
}

.user-list-card {
  background: rgba(30, 30, 30, 0.8);
  border-radius: 12px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.user-list-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--list-color, #4a9eff);
  transition: width 0.3s ease;
  z-index: 2;
}

.user-list-card:hover {
  /* Bookmark-like hover: lift and subtle scale */
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.12);
  /* base shadow + colored glow using palette variable (subtle) */
  box-shadow:
  0 8px 20px rgba(0, 0, 0, 0.34),
  0 0 20px rgba(0,0,0,0.09),
  0 0 12px var(--list-color, rgba(74,158,255,0.09));
}

.user-list-card:hover::before {
  width: 8px;
}

/* Sheen overlay similar to bookmark cards */
.user-list-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -150%;
  width: 60%;
  height: 220%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 35%,
    rgba(255,255,255,0.06) 45%,
    rgba(255,255,255,0.12) 52%,
    rgba(255,255,255,0.06) 60%,
    transparent 70%,
    transparent 100%
  );
  z-index: 10;
  opacity: 0;
  transition: all 0.5s ease-out;
  transform: rotate(25deg);
  pointer-events: none;
  mix-blend-mode: overlay;
}

.user-list-card:hover::after {
  left: 150%;
  opacity: 1;
}

/* Cover images stack */
.list-covers-stack {
  position: relative;
  height: 200px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
}

.list-covers-stack::after {
  /* subtle color shine using palette hue */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.06), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.cover-item {
  position: relative;
  flex: 1;
  width: 25%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: none;
  border-right: 1px solid rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 1;
}

.cover-item:last-child {
  border-right: none;
}

.cover-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--list-color-dark, rgba(30, 58, 138, 0.28)) 100%
  );
  opacity: 0.45;
  transition: opacity 0.25s ease;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.user-list-card:hover .cover-item {
  filter: brightness(1.1);
}

.user-list-card:hover .cover-item::after {
  opacity: 0.5;
}

/* List card content (bottom half) */
.list-card-content {
  padding: 1.25rem;
  flex: 1;
  /* subtle tint from palette into the default dark content */
  background: linear-gradient(to bottom,
    var(--list-color-dark, rgba(30, 58, 138, 0.07)) 0%,
    rgba(30, 30, 30, 0.96) 100%
  );
  position: relative;
}

.list-card-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  /* toned-down separator accent */
  background: linear-gradient(to right,
    transparent 0%,
    var(--list-color, rgba(59, 130, 246, 0.22)) 20%,
    var(--list-color, rgba(59, 130, 246, 0.22)) 80%,
    transparent 100%
  );
}

.list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.list-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  flex: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.list-card-actions {
  display: flex;
  gap: 0.5rem;
}


.list-action-btn {
  background: var(--list-color-dark, rgba(30, 58, 138, 0.18));
  border: 1px solid var(--list-color, rgba(59, 130, 246, 0.18));
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--list-color-light, #8fbff6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-action-btn:hover {
  background: var(--list-color, rgba(59, 130, 246, 0.22));
  border-color: var(--list-color-light, rgba(96, 165, 250, 0.34));
  color: #fff;
  box-shadow: 0 0 6px var(--list-color, rgba(59, 130, 246, 0.18));
}

.list-action-btn.delete-btn:hover {
  background: rgba(255, 0, 0, 0.3);
  border-color: rgba(255, 85, 85, 0.6);
  color: #ff5555;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.list-action-btn .material-icons {
  font-size: 1.1rem;
}

.list-card-description {
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.list-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #aaa;
  /* unify with bottom half: no separate colored background */
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  background: transparent;
  padding: 0.6rem 0 0;
  margin: 0;
  border-radius: 0;
}

.list-item-count {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--list-color-light, #60a5fa);
  font-weight: 600;
}

.list-created-date {
  color: #888;
}

.list-item-count .material-icons {
  color: var(--list-color, #4a9eff);
}

.list-created-date {
  font-style: italic;
}

/* Like button styles */
.list-like-section {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #aaa;
  font-size: 0.85rem;
}

.list-like-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #888;
}

.list-like-btn:hover {
  color: #ff6b9d;
  transform: scale(1.1);
}

.list-like-btn.liked {
  color: #ff6b9d;
}

.list-like-btn .material-icons {
  font-size: 1.2rem;
}

.list-like-count {
  color: #aaa;
  font-weight: 600;
}

/* Hide like count in Lists tab (public lists browse) */
.public-list-card .list-like-count {
  display: none;
}

/* Hide like count in Profile tab's Liked Lists section */
#liked-lists-list .list-like-count {
  display: none;
}

/* Liked Lists container - match spacing with other list views */
#liked-lists-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 2rem;
}

/* List Creation/Edit Modal */
.list-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.list-modal.active {
  display: flex;
}

.list-modal-content {
  background: #1a1a1a;
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  position: relative;
}

.list-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.list-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.list-modal-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.list-modal-body {
  padding: 1.5rem;
}

.list-form-group {
  margin-bottom: 1.5rem;
}

.list-form-label {
  display: block;
  color: #ddd;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.list-form-input,
.list-form-textarea {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.list-form-input:focus,
.list-form-textarea:focus {
  outline: none;
  border-color: #4a9eff;
  background: rgba(255, 255, 255, 0.08);
}

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

/* Description character counter */
.description-counter {
  text-align: right;
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.25rem;
}

/* Color palette selector */
.color-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 0.75rem;
}

.color-palette-option {
  position: relative;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  height: 70px;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-palette-option:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.color-palette-option.selected {
  border-color: #fff;
  box-shadow: 
    0 0 0 3px rgba(255, 255, 255, 0.3),
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(74, 158, 255, 0.4);
  transform: scale(1.05);
}

.color-palette-option.selected::before {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  z-index: 10;
  font-weight: bold;
}

.color-palette-preview {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
}

.color-palette-preview::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
}

.color-palette-preview .color-swatch {
  flex: 1;
  height: 100%;
  transition: flex 0.3s ease;
}

.color-palette-option:hover .color-palette-preview .color-swatch {
  flex: 1.2;
}

.color-palette-option:hover .color-palette-preview .color-swatch:not(:hover) {
  flex: 0.9;
}

.color-palette-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.5rem 0.25rem 0.25rem;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 5;
}

/* Item search and add section */
.list-items-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.list-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.list-items-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.list-items-count {
  color: #888;
  font-size: 0.9rem;
}

.item-search-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.item-search-input {
  flex: 1;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.item-search-input:focus {
  outline: none;
  border-color: #4a9eff;
  background: rgba(255, 255, 255, 0.08);
}

.item-search-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #4a9eff 0%, #3a7acc 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 3px 10px rgba(74, 158, 255, 0.3);
}

.item-search-btn:hover {
  background: linear-gradient(135deg, #3a8eef 0%, #2a6abc 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 158, 255, 0.4);
}

.item-search-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

/* Search results dropdown */
.item-search-results {
  display: none;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(20, 20, 20, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.item-search-results.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

.search-result-image {
  width: 50px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.search-result-info {
  flex: 1;
}

.search-result-title {
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.search-result-meta {
  font-size: 0.85rem;
  color: #888;
}

.search-result-add {
  padding: 0.5rem 1rem;
  background: #4a9eff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-result-add:hover {
  background: #3a7acc;
}

.search-result-add.added {
  background: #5cb85c;
  cursor: default;
}

/* List items display */
.list-items-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 100px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.list-items-container.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-style: italic;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: grab;
  transition: all 0.2s ease;
}

.list-item:active {
  cursor: grabbing;
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.list-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.list-item-drag-handle {
  color: #666;
  cursor: grab;
  user-select: none;
}

.list-item-drag-handle .material-icons {
  font-size: 1.2rem;
}

/* Position control buttons (up/down) */
.list-item-position-controls {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.list-item-move-up,
.list-item-move-down {
  background: rgba(74, 158, 255, 0.15);
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 4px;
  padding: 0.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #4a9eff;
  width: 24px;
  height: 24px;
}

.list-item-move-up:hover:not(:disabled),
.list-item-move-down:hover:not(:disabled) {
  background: rgba(74, 158, 255, 0.25);
  border-color: rgba(74, 158, 255, 0.5);
  transform: scale(1.1);
  color: #60a5fa;
}

.list-item-move-up:active:not(:disabled),
.list-item-move-down:active:not(:disabled) {
  transform: scale(0.95);
}

.list-item-move-up:disabled,
.list-item-move-down:disabled {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
  color: #444;
  cursor: not-allowed;
  opacity: 0.4;
}

.list-item-move-up .material-icons,
.list-item-move-down .material-icons {
  font-size: 0.9rem;
}

.list-item-image {
  width: 40px;
  height: 55px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.list-item-info {
  flex: 1;
}

.list-item-title {
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.list-item-meta {
  font-size: 0.8rem;
  color: #888;
}

.list-item-remove {
  background: none;
  border: none;
  color: #ff5555;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.list-item-remove:hover {
  color: #ff0000;
  transform: scale(1.1);
}

.list-item-remove .material-icons {
  font-size: 1.1rem;
}

/* Modal footer with action buttons */
.list-modal-footer {
  padding: 1.5rem;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.list-modal-btn {
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.list-modal-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.list-modal-btn:active::before {
  width: 300px;
  height: 300px;
}

.list-modal-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #ddd;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.list-modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.list-modal-btn-save {
  background: linear-gradient(135deg, #4a9eff 0%, #3a7acc 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.list-modal-btn-save:hover {
  background: linear-gradient(135deg, #3a8eef 0%, #2a6abc 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3);
}

.list-modal-btn-save:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(74, 158, 255, 0.4);
}

.list-modal-btn-save:disabled {
  background: linear-gradient(135deg, #555, #444);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  opacity: 0.6;
}

/* Scrollbar styling for modal */
.list-modal-content::-webkit-scrollbar,
.list-items-container::-webkit-scrollbar,
.item-search-results::-webkit-scrollbar {
  width: 8px;
}

.list-modal-content::-webkit-scrollbar-track,
.list-items-container::-webkit-scrollbar-track,
.item-search-results::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.list-modal-content::-webkit-scrollbar-thumb,
.list-items-container::-webkit-scrollbar-thumb,
.item-search-results::-webkit-scrollbar-thumb {
  background: rgba(74, 158, 255, 0.4);
  border-radius: 4px;
}

.list-modal-content::-webkit-scrollbar-thumb:hover,
.list-items-container::-webkit-scrollbar-thumb:hover,
.item-search-results::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 158, 255, 0.6);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .list-modal-content {
    max-width: 95%;
    max-height: 95vh;
  }
  
  .color-palette-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .color-palette-option {
    height: 60px;
  }
  
  .list-modal-footer {
    flex-direction: column;
  }
  
  .list-modal-btn {
    width: 100%;
  }
}

/* ============================================
   PUBLIC LISTS BROWSING (Lists Tab)
   ============================================ */

/* Browse view container */
#lists-browse-view {
  width: 100%;
  padding-bottom: 3rem; /* Add bottom padding so last items can be scrolled into view */
}

#public-lists-container {
  position: relative;
  min-height: 200px;
}

#public-lists-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  padding-bottom: 2rem; /* Additional padding at the bottom of the list */
}

/* Public list cards (in browse view) */
.public-list-card {
  background: rgba(30, 30, 30, 0.8);
  border-radius: 12px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.public-list-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--list-color, #4a9eff);
  transition: width 0.3s ease;
  z-index: 2;
}

.public-list-card:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.34),
    0 0 20px rgba(0,0,0,0.09),
    0 0 12px var(--list-color, rgba(74,158,255,0.09));
}

.public-list-card:hover::before {
  width: 8px;
}

.public-list-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -150%;
  width: 60%;
  height: 220%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 35%,
    rgba(255,255,255,0.04) 45%,
    rgba(255,255,255,0.08) 52%,
    rgba(255,255,255,0.04) 60%,
    transparent 70%,
    transparent 100%
  );
  z-index: 10;
  opacity: 0;
  transition: all 0.5s ease-out;
  transform: rotate(25deg);
  pointer-events: none;
  mix-blend-mode: overlay;
}

.public-list-card:hover::after {
  left: 150%;
  opacity: 1;
}

/* Cover hover effects for public lists */
.public-list-card:hover .cover-item {
  filter: brightness(1.1);
}

.public-list-card:hover .cover-item::after {
  opacity: 0.5;
}

/* Public list card content wrapper */
.public-list-card .list-card-content {
  padding: 1.25rem;
  flex: 1;
  background: linear-gradient(to bottom,
    var(--list-color-dark, rgba(30, 58, 138, 0.15)) 0%,
    rgba(30, 30, 30, 0.95) 100%
  );
  position: relative;
}

.public-list-card .list-card-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right,
    transparent 0%,
    var(--list-color, rgba(59, 130, 246, 0.6)) 20%,
    var(--list-color, rgba(59, 130, 246, 0.6)) 80%,
    transparent 100%
  );
}

.public-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.public-list-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  flex: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.public-list-description {
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.public-list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #aaa;
  padding-top: 0.75rem;
  /* unify with bottom half: remove separate colored background */
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  background: transparent;
  padding: 0.6rem 0 0;
  margin: 0;
  border-radius: 0;
}

.public-list-creator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--list-color-light, #60a5fa);
  font-weight: 600;
}

.public-list-creator .material-icons {
  font-size: 1rem;
  color: var(--list-color, #4a9eff);
}

.public-list-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.public-list-item-count {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--list-color-light, #60a5fa);
  font-weight: 600;
}

.public-list-item-count .material-icons {
  color: var(--list-color, #4a9eff);
}

/* Detail view */
#lists-detail-view {
  width: 100%;
}

.list-detail-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.back-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: #ddd;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

/* ===== List Detail View Styles ===== */
#lists-detail-view {
  flex: 1;
  overflow-y: auto;
}

.list-detail-wrapper {
  min-height: 100vh;
  position: relative;
}

.list-detail-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, 
    var(--list-color-light, rgba(30, 58, 138, 0.15)) 0%,
    var(--list-color-medium, rgba(30, 58, 138, 0.08)) 30%,
    var(--list-color-medium, rgba(30, 58, 138, 0.05)) 70%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

.list-detail-wrapper::after {
  content: '';
  position: absolute;
  top: -130px;
  left: 0;
  right: 0;
  height: 300px;
  background: url('../images/styletracery.png') center top no-repeat;
  background-size: 80%;
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
}

.list-detail-header {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  background: linear-gradient(to bottom,
    var(--list-color-medium, rgba(30, 58, 138, 0.12)),
    transparent
  );
  border-bottom: 2px solid var(--list-color-dark, rgba(30, 58, 138, 0.14));
  margin-bottom: 1rem;
}

.list-detail-like-section {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  backdrop-filter: blur(10px);
}

.list-detail-like-section .list-like-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.list-detail-like-section .list-like-btn:hover {
  color: #ff6b9d;
  transform: scale(1.1);
}

.list-detail-like-section .list-like-btn.liked {
  color: #ff6b9d;
}

.list-detail-like-section .list-like-btn .material-icons {
  font-size: 1.5rem;
}

/* Hide like count in opened list detail view */
.list-detail-like-section .list-like-count {
  display: none;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--list-color-dark, rgba(255, 255, 255, 0.15));
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.back-button:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--list-color-light, rgba(255, 255, 255, 0.3));
  transform: translateX(-2px);
  color: #fff;
}

.back-button .material-icons {
  font-size: 18px;
}

.share-list-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  background: rgba(74, 158, 255, 0.15);
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 6px;
  color: #4a9eff;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
  margin-left: 0.5rem;
}

.share-list-btn:hover {
  background: rgba(74, 158, 255, 0.25);
  border-color: rgba(74, 158, 255, 0.5);
  transform: translateY(-2px);
  color: #60a5fa;
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.share-list-btn .material-icons {
  font-size: 18px;
}

.list-detail-info h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.list-creator-name {
  font-size: 0.95rem;
  color: var(--list-color-light, #4a9eff);
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.list-creator-name::before {
  content: 'by';
  color: #888;
  margin-right: 0.25rem;
}

.list-detail-info p:last-child {
  font-size: 1rem;
  color: #ccc;
  line-height: 1.6;
  margin: 0;
}

#list-items-display {
  position: relative;
  z-index: 1;
  padding: 0 1rem 1rem;
}

/* Sort controls for list detail view */
.list-detail-controls {
  padding: 0 1.5rem 0.5rem;
  position: relative;
  z-index: 1;
}

.list-detail-controls .sort-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.list-detail-controls .sort-container label {
  color: #ddd;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.list-detail-controls .sort-container select {
  flex: 1;
  padding: 0.4rem 0.6rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.list-detail-controls .sort-container select option {
  background: #1a1a1a;
  color: #fff;
  padding: 0.5rem;
}

.list-detail-controls .sort-container select:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.25);
}

.list-detail-controls .sort-container select:focus {
  outline: none;
  border-color: #4a9eff;
  background: rgba(0, 0, 0, 0.5);
}

/* Empty state for public lists */
.no-public-lists {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
}

.no-public-lists p {
  margin: 0.5rem 0;
  font-size: 1rem;
}

.no-public-lists p:first-child {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Mobile responsiveness for Lists tab */
@media (max-width: 768px) {
  .public-list-meta,
  .list-detail-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .public-list-stats {
    width: 100%;
    justify-content: space-between;
  }
  
  /* Mobile padding for all tabs to prevent last item from being cut */
  body.mobile-mode .tab-content {
    padding: 15px 15px 60px 15px !important; /* Added 60px bottom padding */
  }
  
  /* ===== MOBILE LIST ITEMS - IDENTICAL TO HOME TAB ===== */
  /* Copy exact styles from mobile.css for consistency */
  
  /* Mobile list items in opened list view - match home tab exactly */
  body.mobile-mode #list-items-display .item-card,
  body.mobile-mode #list-items-display .book-card,
  body.mobile-mode #list-items-display .movie-card,
  body.mobile-mode #list-items-display .tvshow-card {
    margin: 5px auto !important;
    width: 98% !important;
    min-width: 98% !important;
    max-width: 98% !important;
    padding: 7px 8px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    min-height: 140px !important;
    max-height: 140px !important;
    height: 140px !important;
    box-sizing: border-box !important;
  }

  /* Image containers - match home tab */
  body.mobile-mode #list-items-display .book-card .book-image-container,
  body.mobile-mode #list-items-display .movie-card .movie-image-container,
  body.mobile-mode #list-items-display .tvshow-card .tvshow-image-container,
  body.mobile-mode #list-items-display .book-card .image-container,
  body.mobile-mode #list-items-display .movie-card .image-container,
  body.mobile-mode #list-items-display .tvshow-card .image-container {
    flex-shrink: 0 !important;
    margin-right: 12px !important;
    border-radius: 3px !important;
    overflow: hidden !important;
    background: #222 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
  }

  body.mobile-mode #list-items-display .item-card .item-image-container,
  body.mobile-mode #list-items-display .item-card .image-container {
    width: 150px !important;
    height: 200px !important;
    flex-shrink: 0 !important;
    margin-right: 12px !important;
    border-radius: 3px !important;
    overflow: hidden !important;
    background: #222 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
  }

  /* Card content - match home tab */
  body.mobile-mode #list-items-display .item-card .item-content,
  body.mobile-mode #list-items-display .book-card .book-content,
  body.mobile-mode #list-items-display .movie-card .movie-content,
  body.mobile-mode #list-items-display .tvshow-card .tvshow-content,
  body.mobile-mode #list-items-display .item-card .content,
  body.mobile-mode #list-items-display .book-card .content,
  body.mobile-mode #list-items-display .movie-card .content,
  body.mobile-mode #list-items-display .tvshow-card .content {
    flex: 1 !important;
    padding: 0 2px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-width: 0 !important;
    overflow: hidden !important;
    gap: 0 !important;
  }

  /* Titles - match home tab exactly */
  body.mobile-mode #list-items-display .item-card h3,
  body.mobile-mode #list-items-display .book-card h3,
  body.mobile-mode #list-items-display .movie-card h3,
  body.mobile-mode #list-items-display .tvshow-card h3,
  body.mobile-mode #list-items-display .item-card .title,
  body.mobile-mode #list-items-display .book-card .title,
  body.mobile-mode #list-items-display .movie-card .title,
  body.mobile-mode #list-items-display .tvshow-card .title {
    font-size: 13px !important;
    margin: 0 0 2px 0 !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    color: #fff !important;
  }
  
  /* Show small description on mobile */
  body.mobile-mode #list-items-display .item-card .description,
  body.mobile-mode #list-items-display .book-card .description,
  body.mobile-mode #list-items-display .movie-card .description,
  body.mobile-mode #list-items-display .tvshow-card .description {
    display: block !important;
    font-size: 12px !important;
    color: #999 !important;
    line-height: 1.2 !important;
    margin: 7px 0 4px 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    max-height: 3.6em !important;
    opacity: 0.8 !important;
  }
  
  /* Card meta - match home tab exactly */
  body.mobile-mode #list-items-display .item-card .card-meta,
  body.mobile-mode #list-items-display .book-card .card-meta,
  body.mobile-mode #list-items-display .movie-card .card-meta,
  body.mobile-mode #list-items-display .tvshow-card .card-meta,
  body.mobile-mode #list-items-display .item-card .item-meta,
  body.mobile-mode #list-items-display .book-card .book-meta,
  body.mobile-mode #list-items-display .movie-card .movie-meta,
  body.mobile-mode #list-items-display .tvshow-card .tvshow-meta {
    font-size: 10px !important;
    color: #ccc !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    opacity: 0.9 !important;
    display: block !important;
  }

  /* Style the span elements inside meta containers */
  body.mobile-mode #list-items-display .item-card .item-meta span,
  body.mobile-mode #list-items-display .book-card .book-meta span,
  body.mobile-mode #list-items-display .movie-card .movie-meta span,
  body.mobile-mode #list-items-display .tvshow-card .tvshow-meta span {
    font-size: 10px !important;
    color: #ccc !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Style the strong labels inside spans */
  body.mobile-mode #list-items-display .item-card .item-meta span strong,
  body.mobile-mode #list-items-display .book-card .book-meta span strong,
  body.mobile-mode #list-items-display .movie-card .movie-meta span strong,
  body.mobile-mode #list-items-display .tvshow-card .tvshow-meta span strong {
    font-size: 10px !important;
    font-weight: 600 !important;
  }

  /* Card desc - match home tab exactly */
  body.mobile-mode #list-items-display .item-card .card-desc,
  body.mobile-mode #list-items-display .book-card .card-desc,
  body.mobile-mode #list-items-display .movie-card .card-desc,
  body.mobile-mode #list-items-display .tvshow-card .card-desc {
    font-size: 9px !important;
    color: #aaa !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    opacity: 0.85 !important;
    display: block !important;
  }
  
  /* Hide author/studio/creator info - match home tab exactly */
  body.mobile-mode #list-items-display .item-card .author,
  body.mobile-mode #list-items-display .book-card .author,
  body.mobile-mode #list-items-display .book-card .book-author,
  body.mobile-mode #list-items-display .movie-card .movie-production,
  body.mobile-mode #list-items-display .movie-card .movie-creator,
  body.mobile-mode #list-items-display .tvshow-card .tvshow-creator,
  body.mobile-mode #list-items-display .item-card .game-developer {
    display: none !important;
  }
}
