/* ===== TOAST NOTIFICATIONS ===== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  border-radius: 10px;
  box-shadow: var(--toast-shadow);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 320px;
  transition: all 0.2s;
}

.toast:hover {
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

.toast-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--toast-title-color);
  margin-bottom: 4px;
  line-height: 1.4;
}

.toast-message {
  font-size: 13px;
  color: var(--toast-message-color);
  line-height: 1.5;
  word-wrap: break-word;
}

.toast-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--toast-close-color);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 16px;
  padding: 0;
}

.toast-close:hover {
  background: var(--toast-close-hover-bg);
  color: var(--toast-close-hover-color);
}

/* Success */
.toast.success {
  border-left: 4px solid var(--status-success-border);
}

.toast.success .toast-icon {
  background: var(--status-success-icon-bg);
  color: var(--status-success-icon-color);
}

/* Error */
.toast.error {
  border-left: 4px solid var(--status-danger-border);
}

.toast.error .toast-icon {
  background: var(--status-danger-icon-bg);
  color: var(--status-danger-icon-color);
}

/* Warning */
.toast.warning {
  border-left: 4px solid var(--status-warning-border);
}

.toast.warning .toast-icon {
  background: var(--status-warning-icon-bg);
  color: var(--status-warning-icon-color);
}

/* Info */
.toast.info {
  border-left: 4px solid var(--status-info-border);
}

.toast.info .toast-icon {
  background: var(--status-info-icon-bg);
  color: var(--status-info-icon-color);
}

/* Toast History View */
.toast-history-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--toast-history-toggle-bg);
  border: 1px solid var(--toast-history-toggle-border);
  border-radius: 50%;
  color: var(--toast-history-toggle-text);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 20px;
}

.toast-history-toggle:hover {
  background: var(--toast-history-toggle-hover-bg);
  border-color: var(--toast-history-toggle-hover-border);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.toast-history-toggle .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  background: var(--toast-history-badge-bg);
  color: var(--toast-history-badge-text);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  border: 2px solid var(--toast-history-badge-border);
}

.toast-history-panel {
  position: fixed;
  bottom: 80px;
  left: 24px;
  z-index: 9998;
  width: 420px;
  max-height: 600px;
  background: var(--toast-history-panel-bg);
  border: 1px solid var(--toast-history-panel-border);
  border-radius: 12px;
  box-shadow: var(--toast-history-panel-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.toast-history-panel.open {
  display: flex;
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.toast-history-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--toast-history-header-text);
  margin: 0;
}

.toast-history-actions {
  display: flex;
  gap: 8px;
}

.toast-history-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--toast-history-btn-color);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  padding: 0;
}

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

.toast-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--toast-history-item-bg);
  border: 1px solid var(--toast-history-item-border);
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s;
}

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

.toast-history-item .toast-icon {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

.toast-history-item-content {
  flex: 1;
  min-width: 0;
}

.toast-history-item-title {
  font-weight: 600;
  color: var(--toast-history-item-title);
  margin-bottom: 2px;
}

.toast-history-item-message {
  color: var(--toast-history-item-message);
  line-height: 1.4;
  word-wrap: break-word;
}

.toast-history-item-time {
  font-size: 11px;
  color: var(--toast-history-item-time);
  margin-top: 4px;
}

.toast-history-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--toast-history-empty-text);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .toast-container {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
  
  .toast {
    min-width: 280px;
  }
  
  .toast-history-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 64px;
  }
  
  .toast-history-toggle {
    left: 12px;
    bottom: 12px;
  }
}
