/* Archive-specific styles */

/* Archive badge count */
.archives-count {
  font-size: 0.9rem;
  color: #666;
  margin-left: 10px;
  font-weight: normal;
}

/* Archive controls layout */
.archives-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

/* Search container */
.search-container {
  flex: 1;
  min-width: 250px;
}

/* Search input field */
.search-input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary-color);
  outline: none;
}

/* Sort controls */
.sort-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-container label {
  font-size: 14px;
  color: #555;
}

.sort-select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
}

.sort-select:focus {
  border-color: var(--primary-color);
  outline: none;
}

/* Archive date styling */
.ticket-archived-date {
  font-size: 0.85em;
  color: #666;
  margin-left: 10px;
  font-style: italic;
}

/* Restore button styling */
.restore-btn {
  background-color: #4caf50 !important;
  color: white !important;
}

.restore-btn:hover {
  background-color: #388e3c !important;
}

.archive-btn {
  background-color: #8e4a52 !important; /* Soft burgundy color */
  color: white !important;
}

.archive-btn:hover {
  background-color: #723a40 !important; /* Darker burgundy on hover */
}

.archive-btn:active {
  background-color: #5e2f34 !important; /* Even darker when pressed */
}

/* Load more button */
.load-more-btn {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.load-more-btn:hover {
  background-color: #e0e0e0;
}

/* Loading more indicator */
.loading-more {
  text-align: center;
  padding: 10px;
  color: #666;
  font-style: italic;
  grid-column: 1 / -1;
}

/* Empty state styling */
.empty-tickets {
  text-align: center;
  padding: 40px 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  margin: 20px 0;
  grid-column: 1 / -1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .archives-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .sort-container {
    margin-top: 5px;
  }
  
  .restore-btn, .delete-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .archives-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    margin-top: 10px;
    width: 100%;
  }
  
  #restoreAllBtn {
    width: 100%;
  }
}



/* ── Archive page layout ─────────────────────────────────────────────────── */

#ticketsDashboard .tickets-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* ── Archive cards: all overrides in one place ───────────────────────────── */
/* Archive cards: same fixed height as ticket cards, notes fill remaining space */
.ticket-card.archived-ticket-card {
  height: 300px !important;   /* Fixed height — same visual rhythm as tickets page */
  min-width: 0;                /* Allow grid item to shrink to column width */
  overflow: hidden;
  box-sizing: border-box;
}

/* Notes container fills remaining card height, matching tickets page behavior */
.archived-ticket-card .ticket-notes-expanded {
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden;
}

/* Notes content scrollable within the fixed area */
.archived-ticket-card .ticket-notes-content-expanded {
  flex: 1 !important;
  min-height: 0 !important;
  max-height: none !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  cursor: text;
}

/* Hide broadcast product images — only relevant in the edit modal */
.archived-ticket-card .broadcast-product-images {
  display: none !important;
}

/* Keep broadcast indicator small */
.archived-ticket-card .broadcast-indicator {
  font-size: 12px;
  position: absolute;
  top: 6px;
  right: 36px;
}

/* Restore button — green */
.restore-btn {
  background-color: #4caf50 !important;
  color: white !important;
  border-color: #4caf50 !important;
}
.restore-btn:hover {
  background-color: #388e3c !important;
  border-color: #388e3c !important;
}

/* Delete button — red */
.delete-btn {
  background-color: #e53e3e !important;
  color: white !important;
  border-color: #e53e3e !important;
}
.delete-btn:hover {
  background-color: #c53030 !important;
  border-color: #c53030 !important;
}

/* Search highlight pulse */
.ticket-card.search-highlighted {
  animation: archive-highlight 0.5s ease 3;
  outline: 3px solid #667eea;
}

@keyframes archive-highlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
  50%       { box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.3); }
}

/* Responsive */
@media (max-width: 768px) {
  #ticketsDashboard .tickets-list {
    grid-template-columns: 1fr;
  }
}
