/**
 * QuickDNSCheck History Styles
 * Styling for history panel and related components
 */

/* History Panel Container */
.history-panel {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
}

/* Dark mode adjustments */
html.dark .history-panel {
  background: var(--card-bg-dark);
  box-shadow: var(--shadow-sm-dark);
}

/* Empty history state */
.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  text-align: center;
}

.history-empty svg {
  opacity: 0.5;
  margin-bottom: 16px;
}

.history-empty p {
  margin: 6px 0;
}

.text-muted {
  color: var(--text-tertiary);
  font-size: 0.9em;
}

/* Clear history button */
.clear-history-button {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 12px;
  font-size: 0.9em;
}

/* Date header for history groups */
.history-date-header {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 4px;
  margin-top: 12px;
  border-bottom: 1px solid var(--border-color);
}

/* History item */
.history-item {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  margin: 4px 0;
  border-radius: 8px;
  transition: background-color 0.2s;
  cursor: pointer;
  position: relative;
}

.history-item:hover {
  background-color: var(--hover-bg);
}

html.dark .history-item:hover {
  background-color: var(--hover-bg-dark);
}

.history-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--accent-light);
  color: var(--accent-color);
  margin-right: 12px;
}

html.dark .history-item-icon {
  background-color: var(--accent-light-dark);
}

.history-item-content {
  flex: 1;
}

.history-item-domain {
  font-weight: 500;
  margin-bottom: 4px;
}

.history-item-meta {
  display: flex;
  align-items: center;
  font-size: 0.85em;
  color: var(--text-secondary);
}

.history-item-type {
  margin-right: 8px;
}

.history-item-time {
  font-size: 0.9em;
  color: var(--text-tertiary);
}

.history-item-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
  cursor: pointer;
}

.history-item:hover .history-item-delete {
  opacity: 1;
}

.history-item-delete:hover {
  background-color: var(--hover-bg);
  color: var(--danger-color);
}

html.dark .history-item-delete:hover {
  background-color: var(--hover-bg-dark);
}

/* History toggle button */
.history-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background-color 0.2s, color 0.2s;
  position: relative;
}

.history-toggle:hover {
  background-color: var(--hover-bg);
  color: var(--accent-color);
}

html.dark .history-toggle:hover {
  background-color: var(--hover-bg-dark);
}

/* History dot indicator */
.history-toggle .history-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-color);
  display: none;
}

.history-toggle.has-history .history-dot {
  display: block;
}

/* History dropdown */
.history-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  z-index: 1000;
  background-color: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

html.dark .history-dropdown {
  background-color: var(--card-bg-dark);
  box-shadow: var(--shadow-md-dark);
}

.history-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.history-dropdown-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-dropdown-title {
  font-weight: 600;
  font-size: 1.1em;
}

.history-dropdown-content {
  padding: 8px;
  max-height: 400px;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .history-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
  }
  
  .history-dropdown.show {
    transform: translateY(0);
  }
}