/**
 * Form Persistence Styles
 * Styles for form data restoration notices and related UI elements
 */

.form-restoration-notice {
  background: #e3f2fd;
  border: 1px solid #2196f3;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 16px;
  color: #1976d2;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideIn 0.3s ease-out;
}

.form-restoration-notice.success {
  background: #e8f5e8;
  border-color: #4caf50;
  color: #2e7d32;
}

.form-restoration-notice.warning {
  background: #fff3e0;
  border-color: #ff9800;
  color: #f57c00;
}

.form-restoration-notice.error {
  background: #ffebee;
  border-color: #f44336;
  color: #c62828;
}

.form-restoration-notice button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  margin-left: 12px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.form-restoration-notice button:hover {
  opacity: 1;
}

.form-restoration-notice .notice-icon {
  margin-right: 8px;
  font-size: 16px;
}

.form-restoration-notice .notice-text {
  flex: 1;
}

.form-restoration-notice .notice-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-restoration-notice .notice-actions button {
  margin-left: 0;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 12px;
  text-decoration: underline;
}

.form-restoration-notice .notice-actions button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Animation for notice appearance */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auto-save indicator */
.form-auto-save-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #4caf50;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 1000;
  opacity: 0;
  transform: translateX(100px);
  transition: all 0.3s ease;
}

.form-auto-save-indicator.show {
  opacity: 1;
  transform: translateX(0);
}

.form-auto-save-indicator.saving {
  background: #ff9800;
}

.form-auto-save-indicator.saved {
  background: #4caf50;
}

.form-auto-save-indicator.error {
  background: #f44336;
}

/* Form field highlighting for restored data */
.form-field-restored {
  border-color: #2196f3 !important;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
  animation: fieldRestore 0.5s ease-out;
}

@keyframes fieldRestore {
  0% {
    background-color: rgba(33, 150, 243, 0.1);
  }
  100% {
    background-color: transparent;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .form-restoration-notice {
    background: #1a237e;
    border-color: #3f51b5;
    color: #9fa8da;
  }
  
  .form-restoration-notice.success {
    background: #1b5e20;
    border-color: #4caf50;
    color: #a5d6a7;
  }
  
  .form-restoration-notice.warning {
    background: #e65100;
    border-color: #ff9800;
    color: #ffcc02;
  }
  
  .form-restoration-notice.error {
    background: #b71c1c;
    border-color: #f44336;
    color: #ef9a9a;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .form-restoration-notice {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .form-restoration-notice .notice-actions {
    align-self: flex-end;
  }
  
  .form-auto-save-indicator {
    top: 10px;
    right: 10px;
    font-size: 11px;
    padding: 6px 12px;
  }
}
