/**
 * ========================================
 * 09-history.css
 * ========================================
 * Назначение: Стили для истории загрузок
 * ========================================
 */

/* ========== History Sidebar ========== */
.history-sidebar {
  position: fixed;
  right: 0;
  top: 70px;
  width: 350px;
  height: calc(100vh - 70px);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--glass-border);
  padding: var(--spacing-xl);
  z-index: var(--z-dropdown);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.05);
}

.history-sidebar--open {
  transform: translateX(0);
}

/* ========== History Toggle ========== */
.history-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 12px 8px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: var(--z-dropdown);
}

.history-toggle:hover {
  background: var(--primary-color);
  color: white;
}

/* ========== History Section ========== */
.history-section {
  max-height: 600px;
  overflow-y: auto;
}

.history-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.history-section__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin-bottom: 0;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== History Close Button ========== */
.history-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.history-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
  transform: rotate(90deg);
}

/* ========== History List ========== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.history-list--empty {
  text-align: center;
  padding: var(--spacing-2xl) 0;
  color: var(--text-muted);
}

/* ========== History Item ========== */
.history-item {
  background: var(--bg-secondary);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-base);
  cursor: pointer;
  animation: slideLeft 0.3s ease;
}

.history-item:hover {
  border-color: var(--primary-color);
  transform: translateX(-4px);
  box-shadow: var(--shadow-sm);
}

/* ========== History Item Header ========== */
.history-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.history-item__filename {
  font-weight: var(--font-medium);
  color: var(--text-primary);
  font-size: var(--text-sm);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== History Item Status ========== */
.history-item__status {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  white-space: nowrap;
  margin-left: var(--spacing-sm);
}

.history-item__status--success {
  background: var(--gradient-success);
  color: white;
}

.history-item__status--error {
  background: var(--gradient-error);
  color: white;
}

.history-item__status--processing {
  background: var(--gradient-secondary);
  color: white;
  animation: pulse 2s infinite;
}

/* ========== History Item Meta ========== */
.history-item__meta {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.history-item__date,
.history-item__size {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========== History Item Actions ========== */
.history-item__actions {
  display: flex;
  gap: var(--spacing-sm);
}

.history-item__action {
  flex: 1;
  padding: 8px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-align: center;
  cursor: pointer;
}

.history-item__action:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.history-item__action--delete:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

/* ========== History Clear ========== */
.history-clear {
  margin-top: var(--spacing-xl);
  padding: 12px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.history-clear:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* ========== Custom Scrollbar ========== */
.history-section::-webkit-scrollbar,
.history-sidebar::-webkit-scrollbar {
  width: 6px;
}

.history-section::-webkit-scrollbar-track,
.history-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.history-section::-webkit-scrollbar-thumb,
.history-sidebar::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: var(--radius-full);
}

.history-section::-webkit-scrollbar-thumb:hover,
.history-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ========== Animation ========== */
@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
