/* Unread Stories Modal Styles */

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Container */
.unread-stories-modal {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mark-all-read-btn {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.mark-all-read-btn:hover:not(:disabled) {
  background-color: #2563eb;
}

.mark-all-read-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.close-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  font-size: 1.5rem;
  line-height: 1;
  transition: background-color 0.2s, color 0.2s;
}

.close-btn:hover {
  background-color: #f3f4f6;
  color: #111827;
}

/* Category Filters */
.category-filters {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
  scrollbar-width: thin;
}

.category-filter-btn {
  background-color: white;
  border: 1px solid #d1d5db;
  color: #6b7280;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.category-filter-btn:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.category-filter-btn.active {
  background-color: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

/* Content Area */
.unread-stories-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Stories List */
.unread-stories-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Story Card */
.unread-story-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.unread-story-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.story-thumbnail {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 0.375rem;
  overflow: hidden;
  background-color: #f3f4f6;
}

.story-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.story-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  line-height: 1.4;
}

.story-meta {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

.story-excerpt {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-category {
  display: inline-block;
  background-color: #f3f4f6;
  color: #6b7280;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
  width: fit-content;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.pagination button {
  background-color: white;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

.loading-state p {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.error-state p {
  color: #dc2626;
  font-size: 0.875rem;
  margin: 0 0 1rem 0;
}

.error-state button {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.error-state button:hover {
  background-color: #2563eb;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  text-align: center;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.5rem 0;
}

.empty-state p {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
  max-width: 300px;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .unread-stories-modal {
    max-width: 100%;
    max-height: 90vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    animation: slideUpMobile 0.3s ease;
  }

  @keyframes slideUpMobile {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-header h2 {
    font-size: 1.125rem;
  }

  .modal-actions {
    gap: 0.5rem;
  }

  .mark-all-read-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }

  .category-filters {
    padding: 1rem;
  }

  .unread-stories-content {
    padding: 1rem;
  }

  .unread-story-card {
    flex-direction: column;
  }

  .story-thumbnail {
    width: 100%;
    height: 180px;
  }
}

/* Scrollbar Styling */
.unread-stories-content::-webkit-scrollbar {
  width: 8px;
}

.unread-stories-content::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.unread-stories-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.unread-stories-content::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.category-filters::-webkit-scrollbar {
  height: 4px;
}

.category-filters::-webkit-scrollbar-track {
  background: transparent;
}

.category-filters::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}
